If the port installs configuration files to
PREFIX/etc
(or elsewhere) do
not list them in
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
extension. The filename
.sample@sample
macro automates this,
see Section 8.6.9, “@sample
file
[file
]” for what it does
exactly. For each sample file, add a line to
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
pkg-plist
, without the
@sample
followed by a space part, and add a
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 ${PREFIX}/etc
, use
ETCDIR
, which defaults to
${PREFIX}/etc/${PORTNAME}
, it can be
overridden in the ports Makefile
if there
is a convention for the port to use some other directory. The
%%ETCDIR%%
macro will be used in its
stead in pkg-plist
.
The sample configuration files should always have the
.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
or
@sample %%EXAMPLESDIR%%/orbit.conf etc/orbit.conf
The format is @sample
.sample-file
actual-config-file
All FreeBSD documents are available for download at https://download.freebsd.org/ftp/doc/
Questions that are not answered by the
documentation may be
sent to <freebsd-questions@FreeBSD.org>.
Send questions about this document to <freebsd-doc@FreeBSD.org>.