First, make sure your port is almost complete, with only
pkg-plist missing.
Next, create a temporary directory tree into which your port can be installed, and install any dependencies.
# mkdir /var/tmp/`make -V PORTNAME`
# mtree -U -f `make -V MTREE_FILE` -d -e -p /var/tmp/`make -V PORTNAME`
# make depends PREFIX=/var/tmp/`make -V PORTNAME`Store the directory structure in a new file.
# (cd /var/tmp/`make -V PORTNAME` && find -d * -type d) | sort > OLD-DIRSCreate an empty pkg-plist
file:
# :>pkg-plistIf your port honors PREFIX (which it
should) you can then install the port and create the package
list.
# make install PREFIX=/var/tmp/`make -V PORTNAME`
# (cd /var/tmp/`make -V PORTNAME` && find -d * \! -type d) | sort > pkg-plistYou must also add any newly created directories to the packing list.
# (cd /var/tmp/`make -V PORTNAME` && find -d * -type d) | sort | comm -13 OLD-DIRS - | sort -r | sed -e 's#^#@dirrm #' >> pkg-plistFinally, you need to tidy up the packing list by hand; it
is not all automated. Manual pages
should be listed in the port's Makefile
under MAN, and
not in the package list. User configuration files should be
removed, or installed as
n.
The filename.sampleinfo/dir file should not be listed
and appropriate install-info lines should
be added as noted in the info
files section. Any libraries installed by the port
should be listed as specified in the shared libraries
section.
Alternatively, use the plist script in
/usr/ports/Tools/scripts/ to build the
package list automatically. The plist
script is a Ruby script that
automates most of the manual steps outlined in the previous
paragraphs.
The first step is the same as above: take the first three
lines, that is, mkdir,
mtree and make depends.
Then build and install the port:
# make install PREFIX=/var/tmp/`make -V PORTNAME`And let plist create the
pkg-plist file:
# /usr/ports/Tools/scripts/plist -Md -m `make -V MTREE_FILE` /var/tmp/`make -V PORTNAME` > pkg-plistThe packing list still has to be tidied up by hand as stated above.
Another tool that might be used to create an initial
pkg-plist is ports-mgmt/genplist. As with any
automated tool, the resulting pkg-plist
should be checked and manually edited as needed.
This, and other documents, can be downloaded from ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/
For questions about FreeBSD, read the
documentation before
contacting <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.