English German (de_DE)
When being de-installed, a port has to remove empty directories it created. Most of these directories are removed automatically by man:pkg[8], but for directories created outside of [.filename]#${PREFIX}#, or empty directories, some more work needs to be done. This is usually accomplished by adding `@dir` lines for those directories. Subdirectories must be deleted before deleting parent directories.
@dir /var/games/oneko/saved-games
@dir /var/games/oneko
Creating Empty Directories
Empty directories created during port installation need special attention. They must be present when the package is created. If they are not created by the port code, create them in the [.filename]#Makefile#:
${MKDIR} ${STAGEDIR}${PREFIX}/some/directory
Add the directory to [.filename]#pkg-plist# like any other. For example:
@dir some/directory
Configuration Files
If the port installs configuration files to [.filename]#PREFIX/etc# (or elsewhere) do _not_ list them in [.filename]#pkg-plist#. That will cause `pkg delete` to remove files that have been carefully edited by the user, and a re-installation will wipe them out.
Instead, install sample files with a [.filename]#filename.sample# extension. The `@sample` macro automates this, see <<plist-keywords-sample>> for what it does exactly. For each sample file, add a line to [.filename]#pkg-plist#:
@sample etc/orbit.conf.sample
If there is a very good reason not to install a working configuration file by default, only list the sample filename in [.filename]#pkg-plist#, without the `@sample` followed by a space part, and add a <<porting-message,message>> pointing out that the user must copy and edit the file before the software will work.
When a port installs its configuration in a subdirectory of [.filename]#${PREFIX}/etc#, use `ETCDIR`, which defaults to `${PREFIX}/etc/${PORTNAME}`, it can be overridden in the ports [.filename]#Makefile# if there is a convention for the port to use some other directory. The `%%ETCDIR%%` macro will be used in its stead in [.filename]#pkg-plist#.
The sample configuration files should always have the [.filename]#.sample# suffix. If for some historical reason using the standard suffix is not possible, or if the sample files come from some other directory, use this construct:
@sample etc/orbit.conf-dist etc/orbit.conf
@sample %%EXAMPLESDIR%%/orbit.conf etc/orbit.conf
The format is `@sample _sample-file actual-config-file_`.
Dynamic Versus Static Package List
A _static package list_ is a package list which is available in the Ports Collection either as [.filename]#pkg-plist# (with or without variable substitution), or embedded into the [.filename]#Makefile# via `PLIST_FILES` and `PLIST_DIRS`. Even if the contents are auto-generated by a tool or a target in the Makefile _before_ the inclusion into the Ports Collection by a committer (for example, using `make makeplist`), this is still considered a static list, since it is possible to examine it without having to download or compile the distfile.