Bug 66032 - [PATCH] bsd.port.mk: clean room installation
Summary: [PATCH] bsd.port.mk: clean room installation
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-27 18:00 UTC by Oliver Eikemeier
Modified: 2007-05-25 04:07 UTC (History)
0 users

See Also:


Attachments
file.diff (14.88 KB, patch)
2004-04-27 18:00 UTC, Oliver Eikemeier
no flags Details | Diff
file.diff (1.12 KB, patch)
2004-04-27 18:00 UTC, Oliver Eikemeier
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Eikemeier 2004-04-27 18:00:39 UTC
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.
Comment 1 Oliver Eikemeier freebsd_committer freebsd_triage 2004-04-27 18:02:10 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

Over to our beloved port managers
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2007-05-25 04:06:38 UTC
State Changed
From-To: open->closed

This is obsoleted by the ongoing work in DESTDIR and other port improvements 
over the years.