Subject: Re: "package" target
To: Jan Danielsson <jan.m.danielsson@gmail.com>
From: Dave B. <spam@y2007.dberg.net>
List: pkgsrc-users
Date: 04/01/2007 01:28:01
On Thu, Mar 29, 2007 at 10:24:16PM +0200, Jan Danielsson wrote:
...
> I would really like to be able to create
> packages of already installed packages. Is is doable?
...

  You could use

    pkgsrc/mk/bulk/mksandbox

to build packages in a sandbox.  It creates a staging area with its
own, separate /usr/pkg/ via chroot(8), and makes other portions of
your system visible--but read only--via mount_null(8).

  Then, to do the actual builds, use (per info from packages(7))

    make update UPDATE_TARGET=bin-install

which installs your package, plus creates a binary package-file for
it (likewise for missing packages depended on).  Existing package-
files that satisfy a dependency are used as needed; so as an added
bonus, if one big package build removes installed packages needed
by another package build, it's no problem: cached binaries to the
rescue.  The trade-off for all this, of course, is disk capacity.

  Note: to limit the sites from which binary packages will automa-
tically be installed, alter /etc/mk.conf.  For "this host only" put

    BINPKG_SITES=

Cheers,  --Dave B.