Creating a package by hand with pkg_create

Joel Hatton freebsd-questions at
Sat Sep 17 08:11:21 PDT 2005


I'm trying to create a package from a set of binaries for local
installation only, without installing it first. I've added the files into
a temporary directory first:


I created a packing list file /tmp/application/work/.PLIST.mktmp with

@cwd /usr/local

I've tried some combinations of arguments and packing list options, but
I've not been able to hit upon a combination that both a) can find the
source files, and if it does b) installs the program properly, in only one

I believe that this is very close to what should work:

/usr/sbin/pkg_create -v -c /tmp/onelinedesc -d /tmp/application/pkg-descr -p /tmp/application/work \
	-s /tmp/application/work -f /tmp/application/work/.PLIST.mktmp -m /etc/mtree/BSD.local.dist \

(even the -p option seems redundant to me)

But, this results in output like:

Using SrcDir value of /tmp/application/work
Creating bzip'd tar ball in '/usr/ports/packages/All/application.tbz'
tar: bin/app: Could not stat: No such file or directory

The only way I've made it work is to add @srcdir /tmp/application/work to
the packing list, but this results in a duplicated installation to
/usr/local _and_ /tmp/application/work. Is there any way around this? I
can't believe that there could be so many options for declaring where the
files reside and are destined to not allow me to do what I want here, so
it must be something I'm not following correctly.

-- Joel Hatton --
Security Analyst                    | Hotline: +61 7 3365 4417
AusCERT - Australia's national CERT | Fax:     +61 7 3365 7031
The University of Queensland        | WWW:
Qld 4072 Australia                  | Email:   auscert at

More information about the freebsd-questions mailing list