Using pkg with build options

Matthew Seaman matthew at FreeBSD.org
Sun Mar 23 17:12:10 UTC 2014


On 23/03/2014 14:01, Polytropon wrote:
> On Sun, 23 Mar 2014 13:53:09 +0000 (UTC), Darrell Betts wrote:
>>    Currently have FreeBSD 9.2 installed. I would like to start using pkg
>>    install but I can't find how to use it with build options like the old
>>    make install clean method. Can anyone share a light on this?
> 
> Basically, you cannot do this. The new pkg obsoletes the
> traditional pkg_* tools which operate on binary packages
> which get built (by FreeBSD build systems) using the
> corresponding port's default settings.
> 
> If you need to use custom-configured packages (build via
> "make install clean" or using a port management tool
> such as portmaster), this does currently not integrate
> that well with pkg. However, "poudriere" is a solution:
> You build packages with your own options and can _then_
> use that package source with pkg.
> 
> Here's a summary: https://wiki.freebsd.org/PkgPrimer

Err... what?

pkg(8) can be used on 9.x pretty transparently when compiling from
ports.  All you need to do is install pkg(8) -- either by building the
ports-mgmt/pkg port, or by using the /usr/sbin/pkg bootstrap.  Then run
pkg2ng to convert your database of installed packages to pkgng style and
add 'WITH_PKGNG=YES' to /etc/make.conf.  You can (optionally) set up
/usr/local/etc/pkg.conf -- but you don't need this at all.  Most people
find the compiled in defaults are fine so they can use an empty or (in
fact) no pkg.conf at all.  If you want the option of using a package
repository, create a /usr/local/etc/pkg/repos/foo.conf file (for your
choice of 'foo').  See pkg.conf(5) for details of what should go into
foo.conf.

Once pkgng-ized, the experience with installing from ports is basically
exactly the same as with pkg_tools.  ie. it does some stuff behind the
scenes to register packages in the package database on installation, but
you never have to worry about it or invoke it directly.

You can twiddle port options to your heart's content and pkg will be
perfectly happy.

The difference comes when you want to look at the contents of your
package database.  'pkg info -fa' shows you somewhat more than the
pkg_info equivalent, including what OPTIONS settings were used to
compile each package.

Tools like portmaster(8) and portupgrade(8) understand how to work with
pkg(8) and should just work automatically as soon as pkg(8) is
installed.  Most tools in the ports tree that need pkg(8) support have
it available now, although some of them need to be rebuilt with changed
OPTION settings.

Yes, poudriere is a solution in general for package management, and it
is very good.  However poudriere really comes into its own when you have
several machines to maintain.  For just a single machine, simply
compiling ports locally is still a perfectly viable option.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.
PGP: http://www.infracaninophile.co.uk/pgpkey


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1036 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20140323/9034d18b/attachment.sig>


More information about the freebsd-questions mailing list