

I use portmaster to build software on our FreeBSD servers at work. It works great, but sometimes I get in a hurry and forget to delete a piece of software (a “port”) which I only need temporarily in order to build another piece of software. Some examples of build-only software are autoconf, gmake, m4, etc. Some of these ports take a significant amount of time to build, so I’d really like to build them once, create and save a package of that piece of software, then remove it from my server until it’s needed again. That would reduce my software inventory, without requiring that I rebuild these build-only packages over and over and over and…
Here are the options I have set in /usr/local/etc/portmaster.rc for my “package builder” box:
BACKUP=bopt
MAKE_PACKAGE=gopt
DONT_SCRUB_DISTFILES=Dopt
HIDE_BUILD=Hopt
SAVE_SHARED=wopt
PM_PACKAGES=first
PM_DEL_BUILD_ONLY=pm_dbo
LOCAL_PACKAGEDIR=/usr/ports/packages
PM_PACKAGES_LOCAL=pmp_local
These settings will create a saved package for any build-only dependencies, then deinstall the package after the build is complete. Next time that build-only dependency is needed, it will be (temporarily) restored via pkg_add in a matter of seconds instead of being rebuilt. Options that achieve this are:
MAKE_PACKAGE=gopt
PM_PACKAGES=first
PM_DEL_BUILD_ONLY=pm_dbo
LOCAL_PACKAGEDIR=/usr/ports/packages
PM_PACKAGES_LOCAL=pmp_local