Chapter 6. PLIST* issues

This section addresses some special issues that one needs to pay attention to when dealing with the PLIST file (or files, see below).

6.1. Miscellaneous

NetBSD RCS Id:

Be sure to add a RCS ID line as the first thing in any PLIST file you write:

	@comment $NetBSD$
   

``ranlib'':

Don't put any ``ranlib'' commands into your PLIST files, as they will cause troubles when the package is removed. Just make sure the build-process does run ``ranlib'' - it usually does - and you can leave this out. This is usually only a problem when using ports from FreeBSD.

``ldconfig'':

Don't put any ``ldconfig'' commands into your PLIST files, as they will cause problems. All shared object caching is done automatically in NetBSD (this takes place when you see the Automatic shared object handling message), and so you can leave this out. If any shared objects are found in the package, they will be dealt with automatically, running ``ldconfig'' on platforms that need it. This is usually only a problem when using ports from FreeBSD.

${MACHINE_ARCH}, ${MACHINE_GNU_ARCH}:

Some packages like emacs and perl embed information about which architecture they were built on into the pathnames where they install their file. To handle this case, PLIST will be preprocessed before actually used, and the symbol "${MACHINE_ARCH}" will be replaced by what ``sysctl -n hw.machine_arch'' gives. The same is done if the string "${MACHINE_GNU_ARCH}" is embedded in PLIST somewhere - use this on packages that use GNU autoconfigure. There are a few more variables that are expanded, please see the PLIST_SUBST variable in bsd.pkg.mk.

Legacy note: There used to be a symbol "<$ARCH>" that was replaced by the output of ``uname -m'', but that's no longer supported and has been removed.

${OPSYS}, ${OS_VERSION}:

Some packages want to embed the OS name and version into some paths. to do this, use these two variables in PLIST. "${OPSYS}" will be replaced by output from ``uname -s'', "${OS_VERSION}" will be set to what ``uname -r'' gives.

Manpage-compression:

The package should install manpages in compressed form if MANZ is set (in /etc/mk.conf), and uncompressed otherwise. To handle this in the PLIST file, the suffix ".gz" is appended/removed automatically for manpages according to MANZ and MANCOMPRESSED being set or not, see above for details. This modification of the PLIST file is done on a copy of it, not pkg/PLIST itself.

Semi-automatic PLIST generation:

You can use the ``make print-PLIST'' command to output a PLIST that matches any new files since the package was extracted. If the package installs files via tar(1) or other methods that don't update file access times, be sure to add these files manually to your pkg/PLIST!