5.4. pkg/*

This directory contains several files used to manage the creation of binary packages. Files from this directory are used in the binary package itself, and will thus be installed on other machines, so you should be aware that there is a wider audience than you might think for your comments and witticisms.

5.4.1. Mandatory files

pkg/COMMENT:

A one-line description of the piece of software. There is no need to mention the package's name - this will automatically be added by the pkg_* tools when they are invoked.

pkg/DESCR:

A multi-line description of the piece of software. This should include any credits where they are due. Please bear in mind that others do not share your sense of humour (or spelling idiosyncrasies), and that others will read everything that you write here.

pkg/PLIST:

This file governs the files that are installed on your system: all the binaries, manual pages, etc. There are other directives which may be entered in this file, to control the creation and deletion of directories, and the location of inserted files.

If you're updating a FreeBSD package to work for NetBSD, please pay special attention to the following things in pkg/PLIST:

You could also investigate the port2pkg package (pkgsrc/pkgtools/port2pkg), which does a lot of the donkey work for you.

5.4.2. Optional files

pkg/INSTALL:

Shell script invoked twice during pkg_add. First time after package extraction and before files are moved in place, the second time after the files to install are moved in place. This can be used to do any custom procedures not possible with ``@exec'' commands in PLIST. See pkg_add(1) and pkg_create(1) for more information.

pkg/DEINSTALL:

This script is executed before and after any files are removed. It is this script's responsibility to clean up any additional messy details around the package's installation, since all pkg_delete knows is how to delete the files created in the original distribution. See pkg_delete(1) and pkg_create(1) for more information.

pkg/REQ:

Require-script that is invoked before installation and de-installation to ensure things like certain accounts being available, user/sysadmin agreeing with usage policy, etc.

pkg/MESSAGE:

Display this file after installation of the package. Useful for things like legal notices on almost-free software, setup instructions etc.