Packaging - 4. Filesystem Layout
The following file system layout guidelines are part of the Fink packaging policy.
4.1 The Filesystem Hierarchy Standard
Fink follows the spirit of the Filesystem Hierarchy
Standard, or FHS for short.
It can only follow it in spirit because the FHS was created for system
vendors that have control over the /
and
/usr
hierarchies.
Fink is an add-on distribution that controls only its install
directory (or prefix).
The examples use the default prefix of /opt/sw
.
4.2 The Directories
Files should go into the following subdirectories of the hierarchy:
Field | Value |
---|---|
/opt/sw/bin |
This directory is for general executable programs. There are no subdirectories. |
/opt/sw/sbin |
This directory is for executable programs that are intended to be used by administrators only. Background daemons go here. There are no subdirectories. |
/opt/sw/include |
This directory is for C and C++ header files. Subdirectories can be created as necessary. If a package installs header files that can be confused with standard C headers, those headers must go to a subdirectory. |
/opt/sw/lib |
This directory is for architecture-dependent data files and
libraries.
Static and shared libraries should be placed directly in
A package is free to create a subdirectory to store private data or
loadable modules.
Make sure to use directory names that make sense for compatibility.
It is wise to use the package major version in the directory name or
as an additional hierarchy level, e.g. |
/opt/sw/lib/ppc64
/opt/sw/lib/x86_64 |
This directory is for 64-bit libraries on 32-bit systems,
with |
/opt/sw/share |
This directory is for architecture-independent data files.
The same rules as for |
/opt/sw/share/man |
This directory contains manual pages.
It is organized into the usual section tree.
Every program in |
/opt/sw/share/info |
This directory contains documentation in the Info format (produced
from Texinfo sources).
Maintenance of the |
/opt/sw/share/doc |
This directory contains documentation that is neither a man page nor
an Info document.
README, LICENSE and COPYING files go here.
Every package must create a subdirectory here, named after the
package.
The subdirectory name must not contain any version numbers (unless
they are a part of the package name proper).
Hint: Just use |
/opt/sw/share/locale |
This directory contains message catalogs for internationalization. |
/opt/sw/opt |
The |
/opt/sw/var |
The |
/opt/sw/etc |
This directory holds configuration files. For packages that have more than one or two files here a subdirectory should be made. The subdirectory must have the name of the package or program in it so that it is identifiable. |
/opt/sw/src |
This directory is for storing and building source code. Nothing should be installed here by a package. |
/opt/sw/Applications |
This directory is for storing OS X-style applications which are launched by double-clicking rather than from the command line. |
/opt/sw/Library/Frameworks |
This directory is for storing OS X-style frameworks, sometimes used by OS X-style applications. |
4.3 Things to Avoid
No other directories than the ones mentioned above should exist in
/opt/sw
.
In particular, the following should not be used:
/opt/sw/man
, /opt/sw/info
,
/opt/sw/doc
, /opt/sw/libexec
,
/opt/sw/lib/locale
.
Next: 5. Compilers