Code:
#!/bin/sh
if [ ! -d /usr/ports ] ; then echo "Ports tree not installed" ; exit 1 ; fi
cd /usr/ports
for port in $PORTLIST ; do
(cd ${port} && make install && make clean)
done
You can just write this out on the command line (minus the check to see if /usr/ports exists) and change "$PORTLIST" to whatever list of (space-delimited) ports you want installed, directory/portname form, or run it as a shell script and set that variable PORTLIST for it.
PORTLIST format would be like:
PORTLIST="x11/nvidia-driver devel/libmsocket security/nmap" ./portinstall.sh
Which would install the nvidia-driver port, the libmsocket port, and the nmap port, for example. Keep in mind you might get prompted for options in a port. You can check the port's Makefile to see if that'd be the case.