FreeBSD Handbook : Installing Applications: The Ports collection : Making a port yourself : Package Names
Previous: A Sample Makefile
Next: Categories

4.7.10. 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>-]<name>[[-]<compiled.specifics>]-<version.string.numbers>;

If your ${DISTNAME} doesn't look like that, set ${PKGNAME} to something in 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.
  2. The `<name>' part should be all lowercases, except for a really large package (with lots of programs in it). Things like XFree86 (yes there really is a port of it, check it out) and ImageMagick fall into this category. Otherwise, convert the name (or at least the first letter) to lowercase. If the capital letters are important to the name (for example, with one-letter names like R or V) you may use capital letters at your discretion. 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.
  4. The version string should be a period-separated list of integers and single lowercase alphabetics. 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.

Here are some (real) examples on how to convert a ${DISTNAME} into a suitable ${PKGNAME}:

DISTNAME	PKGNAME			Reason
mule-2.2.2	mule-2.2.2		no prob at all
XFree86-3.1.2	XFree86-3.1.2		ditto
EmiClock-1.0.2	emiclock-1.0.2		no uppercase names for single programs
gmod1.4		gmod-1.4		need hyphen after `<name>'
xmris.4.02	xmris-4.02		ditto
rdist-1.3alpha	rdist-1.3a		no strings like `alpha' allowed
es-0.9-beta1	es-0.9b1		ditto
v3.3beta021.src	tiff-3.3		what the heck was that anyway? ;)
tvtwm		tvtwm-pl11		version string always required
piewm		piewm-1.0		ditto
xvgr-2.10pl1	xvgr-2.10.1		`pl' allowed only when no maj/minor numbers
gawk-2.15.6	ja-gawk-2.15.6		Japanese language version
psutils-1.13	psutils-letter-1.13	papersize hardcoded at package build time
pkfonts		pkfonts300-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 (`yy.mm.dd') as the version.


FreeBSD Handbook : Installing Applications: The Ports collection : Making a port yourself : Package Names
Previous: A Sample Makefile
Next: Categories