This is an old revision of the document!


DESTDIR is a make environmental variable that we use in installing various parts of the FreeBSD operating system. According to its name, it sets the destination directory, where the desired components should go.

We use DESTDIR for populating a jail environment. Setting DESTDIR while making an installworld will result in an individual FreeBSD userland environment, what is called a jail. We make use of jails for virtual server hosting or imprisoning processes to improve security.

The compiled webpages and documentations go to ${DESTDIR}/data. While mirroring the FreeBSD webpages we should set this properly in conjunction with our webserver.

So far, the DESTDIR macro in ports tree hasn't been implemented. As a SummerOfCode2006 student, GáborKövesdán is working on the implementation. According to our interpretation of DESTDIR, it should install packages into existing environments (or jails). Specifically, it means that packages should go to ${DESTDIR}/${PREFIX} and be registered under ${DESTDIR}/var/db/pkg.

For example: Installing misc/foo with DESTDIR=/bla results in a package under /bla/usr/local and it is registered under /bla/var/db/pkg, so that it be removable from the environment with pkg_delete. Of course, LOCALBASE can be overriden so using DESTDIR=/bla and LOCALBASE=/opt (or PREFIX=/opt) installs the package into /bla/opt and the package info still goes to /bla/var/db/pkg.

Unfortunately, there are ports that should be fixed to work properly with DESTDIR. DESTDIR for ports has been a desired feature a long ago, but not at the beginning, so current ports and infrastructure aren't aware of it. Modifying existing code towards a radically different direction is always difficult, we cannot avoid fixing a bunch of ports.

  • destdir.1150496224.txt.gz
  • Last modified: 2006/06/16 22:17
  • by GáborKövesdán