The pkg and site subdirectories within the
opt directory structure are very similar in layout. They
both contain application directories, whose names are of the form
appname-version. Examples are
emacs-19.15 and xlockmore-4.04BETA.
The main difference between the contents of the pkg and
site directories is that pkg contains
packages which are freely available on the Internet; thus, the
appname directory normally contains the source code for the
application as well as the "installed" files (the binaries, libraries,
etc.) for the app. The site directory contains locally
maintained packages; their source code is usually elsewhere, in a
configuration management system's repository.
Pathnames which contain the pkg or site
directory names are used in only one place: in symbolic links in the
opt directory itself. Those links are normally of the
form
appname ---> pkg/appname-version
or
appname ---> site/appname-version
The appname directories within pkg and
site contain the actual files of the application--the
source (in the case of pkg directories), the binaries,
the documentation, everything. Just about the only things that aren't
in an application's appname directory are log files that the
application creates, PID files, user data files created or used by the
application, and sometimes configuration files. The intent is that
all "static" files related to an application be contained in its
appname directory.