Suggested improvements for ports

Scot Hetzel swhetzel at gmail.com
Fri Jan 11 08:34:17 PST 2008


n 1/11/08, Paul Schmehl <pauls at utdallas.edu> wrote:
> Some of this has been discussed ad infinitum, but, in an off-list conversation,
> I came up with this list of suggested improvements for port.  I'd like to see
> these things done, but I'm not sure how.  Improve the docs?  Create a checklist?
>
:
> 3) There's no standard for the format of pkg-plist, pkg-message or pkg-descr,
> so port maintainers are free to put whatever they want in there.  There's a
> customary way of doing it, but it's not set in stone and variations are found
> throughout ports.

There is a standard format for pkg-plist.  Which is documented in the
port's handbook.

pkg-descr does have a standard format:

<descr>

WWW: <projects web site>

pkg-message format is left to the maintainer.

The only requirement for pkg-descr and pkg-message is that it should
be able to display on an 80 column screen without the lines wrapping.

> 4) There's no standard for config files.  Do you overwrite?  Do you ignore?  Do
> you create port.conf-sample?  port.conf-dist?  port.conf-example?  Do you check
> to see if port.conf is there, and, if not, copy it to ${LOCALBASE}/etc?
> ${PREFIX}/etc?

There is a standard for config files, and is documented in the porters handbook.

The port maintainer should install configuration files so that they
don't overwrite existing configuration files.

The way that most ports take is by patching the src to install the
standard config files with an extension (currently we use -sample,
-dist, -orig, or -example).  Then the port should check for the
existance of the config file, and install one if it doesn't exist.
When the port is uninstalled, it compares the config file with the
default config file, and only removes the config file if they are the
same.

NOTE: should standardize a default extension.

When there are a large number of configuration files, a few ports
install the default configuration files into an alternate directory
(i.e PREFIX/share/example/<portname>), and then copy them to
PREFIX/etc when they don't exist.  On deinstall, they compare the
config file with the default config file, and only remove the config
files if they are the same.

Scot


More information about the freebsd-ports mailing list