The attached patch is a proposal for a new installation procedure, triggered by CLEANROOM_INSTALL= yes in a ports Makefile. If this variable is not present, everything proceed as normal. Otherwise, the package installs into WRKINST (default ${WRKDIR}/.inst), build a package from this installation and in installs this package. This is accomplished by installing with DESTDIR set, a procedure already supported by the Makefiles of many ports. Advantages of this approach are: - the packing list is always correct, since the real installation is done from the package - if a port installs unwanted files, they can just be omitted from the packing list without patching anything. - files can easily renamed before installation without conflicting with existing files (configuration files, man pages etc.) - splitting a port into multiple parts (like client and server) becomes trivial. - packages can be build without influencing installed ports, making upgrades faster (build a package first, then deinstall the old package and immediately install the new one) and enabling building multiple versions of a port (eg. with and without LDAP) without constantly installing and deinstalling them. future benefits may be: - automatic packing list generation, even for manual pages - building of multiple packages (client and server) in one step I used port net/rsync as a test case, simply insert CLEANROOM_INSTALL= yes in the ports Makefile and do sed -i '.bak' -Ee '/^(pre-|do-|post-)?install:/,/^$/s/\${(DOCSDIR|EXAMPLESDIR|PREFIX)}/${DESTDIR}&/g' Makefile This procedure should work as a starting point for many ports. Fix: The patch needs an updated version of pkg_create which understands `-S basedir'. It is available by installing pkg_install-devel version 20040426. Since I can't upgrade pkg_install-devel now (ports freeze), a patch for this port is attached. pkg_install on older systems could be upgraded with the mechanism already present in bsd.port.mk for CONFLICTS.
Responsible Changed From-To: freebsd-ports-bugs->portmgr Over to our beloved port managers
State Changed From-To: open->closed This is obsoleted by the ongoing work in DESTDIR and other port improvements over the years.