Creating a pkg

Matthew Seaman matthew at
Thu Jul 28 21:14:36 UTC 2016

On 28/07/2016 21:02, Andrew Wood via freebsd-questions wrote:
> Does that mean I can't create an all architecture package that will work
> on FreeBSD 11 when it comes out, I would have to create a separate
> package for future versions of FreeBSD?

Yes, you need a separate package for each different FreeBSD major version.

> Can I also clarify how I specify which files to put in the package and
> where I want them put on the target system during installation? Can I
> package up everything in a directory with dir: {/path: 'sha256hash'};  ?

You need to enumerate each file in your package separately. 'dir'
entries will create a directory -- frequently one that is left empty.
You don't need to list every directory needed to install all the files
in the package.  They are created automatically when the file is
installed.  You only need a dir entry if the directory wouldn't
otherwise be created.

> That only takes one path though,  is that the target path or the local
> path on my machine? How does the prefix value fit in? What if I want to
> put files in several places?

It's both. The path is where the file will be put after installation.
It's also where pkg(8) looks for the file in order to package it.
Except that when packaging a file you'ld generally create the installed
layout of files relative to some staging directory so you didn't end up
scribbling all over your system.   See the '-r' or '--rootdir' option in



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 931 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the freebsd-questions mailing list