Chapter 17. Automated package list creation

First, make sure your port is almost complete, with only pkg-plist missing. Create an empty pkg-plist.

    # touch pkg-plist

Next, create a new set of directories which your port can be installed, and install any dependencies.

    # mtree -U -f /etc/mtree/BSD.local.dist -d -e -p /var/tmp/port-name
    # make depends PREFIX=/var/tmp/port-name

Store the directory structure in a new file.

    # (cd /var/tmp/port-name && find * -type d) > OLD-DIRS

If your port honors PREFIX (which it should) you can then install the port and create the package list.

    # make install PREFIX=/var/tmp/port-name
    # (cd /var/tmp/port-name && find * \! -type d) > pkg-plist

You must also add any newly created directories to the packing list.

    # (cd /var/tmp/port-name && find * -type d) | comm -13 OLD-DIRS - | sed -e 's#^#@dirrm #' >> pkg-plist

Finally, you need to tidy up the packing list by hand; it isn't all automated. Manual pages should be listed in the port's Makefile under MANn, and not in the package list. User configuration files should be removed, or installed as filename.sample. The info/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.

For questions about the FreeBSD ports system, e-mail <ports@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.