Subject: DESTDIR support
To: None <>
From: Joerg Sonnenberger <>
List: tech-pkg
Date: 10/09/2006 15:04:49
Hi all,
I've just commited the initial DESTDIR support. To use it, set
in /etc/mk.conf and try building one of the modifed packages. You will
note, that it won't get installed into ${LOCALBASE} directly, but a
binary package is created first. This can be installed with
"make bin-install" afterwards.

Developers which want to modify existing packages should also try
This makes the build completely unprivileged and in turn detects any
attempt to write e.g. to ${LOCALBASE}. This is not supported for actual
installation yet, due to short comings of pkg_create.

To allow a package to use it, set
when the owner/group of all files is following the default rules
(e.g. because BSD_INSTALL_* was used) or at least are supposed so.
I'll add mechanisms to override owner and group for individual files
shortly to soften this requirement. If the package has weired hard-coded
user names and no easy way to change that is found, try
instead, but you will loose the protection in that case.

This works by setting DESTDIR in the environemnt of the installation for
packages using make (and additional on the command line to override
DESTDIR= entries in the Makefiles). Don't forgot to modify the
pre-install/post-install rules and keep in mind that INSTALL is *not*

The conversion for packages using imake or automake 1.4+ should be
straight forward, other systems might need more work.