Chapter 18. Package Names

The following are the conventions you should follow in naming your packages. This is to have our package directory easy to scan, as there are already lots and lots of packages and users are going to turn away if they hurt their eyes!

The package name should look like [language[_region]]-name[[-]compiled.specifics]-version.numbers.

The package name is defined as ${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION}. Make sure to set the variables to conform to that format.

  1. FreeBSD strives to support the native language of its users. The language- part should be a two letter abbreviation of the natural language defined by ISO-639 if the port is specific to a certain language. Examples are ja for Japanese, ru for Russian, vi for Vietnamese, zh for Chinese, ko for Korean and de for German.

    If the port is specific to a certain region within the language area, add the two letter country code as well. Examples are en_US for US English and fr_CH for Swiss French.

    The language- part should be set in the PKGNAMEPREFIX variable.

  2. The first letter of name part should be lowercase. (The rest of the name can contain capital letters, so use your own discretion when you are converting a software name that has some capital letters in it.) There is a tradition of naming Perl 5 modules by prepending p5- and converting the double-colon separator to a hyphen; for example, the Data::Dumper module becomes p5-Data-Dumper. If the software in question has numbers, hyphens, or underscores in its name, you may include them as well (like kinput2).

  3. If the port can be built with different hardcoded defaults (usually part of the directory name in a family of ports), the -compiled.specifics part should state the compiled-in defaults (the hyphen is optional). Examples are papersize and font units.

    The compiled.specifics part should be set in the PKGNAMESUFFIX variable.

  4. The version string should follow a dash (-) and be a period-separated list of integers and single lowercase alphabetics. In particular, it is not permissible to have another dash inside the version string. The only exception is the string pl (meaning `patchlevel'), which can be used only when there are no major and minor version numbers in the software. If the software version has strings like "alpha", "beta", "rc", or "pre", take the first letter and put it immediately after a period. If the version string continues after those names, the numbers should follow the single alphabet without an extra period between them.

    The idea is to make it easier to sort ports by looking at the version string. In particular, make sure version number components are always delimited by a period, and if the date is part of the string, use the yyyy.mm.dd format, not dd.mm.yyyy or the non-Y2K compliant yy.mm.dd format.

Here are some (real) examples on how to convert the name as called by the software authors to a suitable package name:

Distribution Name PKGNAMEPREFIX PORTNAME PKGNAMESUFFIX PORTVERSION Reason
mule-2.2.2 (empty) mule (empty) 2.2.2 No changes required
XFree86-3.3.6 (empty) XFree86 (empty) 3.3.6 No changes required
EmiClock-1.0.2 (empty) emiclock (empty) 1.0.2 No uppercase names for single programs
rdist-1.3alpha (empty) rdist (empty) 1.3.a No strings like alpha allowed
es-0.9-beta1 (empty) es (empty) 0.9.b1 No strings like beta allowed
mailman-2.0rc3 (empty) mailman (empty) 2.0.r3 No strings like rc allowed
v3.3beta021.src (empty) tiff (empty) 3.3 What the heck was that anyway?
tvtwm (empty) tvtwm (empty) pl11 Version string always required
piewm (empty) piewm (empty) 1.0 Version string always required
xvgr-2.10pl1 (empty) xvgr (empty) 2.10.1 pl allowed only when no major/minor version numbers
gawk-2.15.6 ja- gawk (empty) 2.15.6 Japanese language version
psutils-1.13 (empty) psutils -letter 1.13 Papersize hardcoded at package build time
pkfonts (empty) pkfonts 300 1.0 Package for 300dpi fonts

If there is absolutely no trace of version information in the original source and it is unlikely that the original author will ever release another version, just set the version string to 1.0 (like the piewm example above). Otherwise, ask the original author or use the date string (yyyy.mm.dd) as the version.

For questions about the FreeBSD ports system, e-mail <ports@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.