I install everything from source. Except for thing like desktop environments, building from source is a non-issue on modern hardware. It also gives me some confidence in the binary compatibility of the packages I have installed.
For installing:
pushd /usr/ports/*/$PACKAGE ; sudo make install clean && popd
I use FreeBSD on a desktop at home and for a personal web server. I'm not performing large scale deployments (but if I were, I'd probably write a port for my application, define my dependencies, and install it just like anything else).
You can also use parentheses to create a scope for the current directory and environment variables (the shell forks a subprocess to run parenthesized commands).
(cd /usr/ports/*/$PACKAGE ; sudo make install clean)
In your example, however, the failure of `make install clean` will put you back in the original directory and not in the port's directory where you probably want to be to debug the failure. My original example keeps you in the port's directory in the event of installation failure.
Personally, I couldn't anymore handle the way ports asks for configuration options for every package that has configurable options. I'm spoiled by the "sane defaults" stance of better Linux distros like Arch.
which runs `make config` on the package and all dependencies before installing. It's the best of both worlds IMO -- the port will build unattended and you still have a chance up-front to skim the available options for things you need.
Either set BATCH env variable or use portupgrade/portinstall with -c or -C flags. The latter gathers all the dependencies of a given port and let's you configure them up front, and then the compilation and installation goes without any interruptions.
-c
--config
Run "make config-conditional" before everything for all tasks.
-C
--force-config
Run "make config" before everything for all tasks.
For installing:
For upgrading (ports): (In reality, portsnap is run nightly).A quick read - http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/po...
I use FreeBSD on a desktop at home and for a personal web server. I'm not performing large scale deployments (but if I were, I'd probably write a port for my application, define my dependencies, and install it just like anything else).