CSW Filesystem Layout

Everything is under /opt/csw

That's the number 1 rule of filesystem layout right there: everything goes under /opt/csw. The reason for this is to simplify read-only NFS sharing of /opt/csw to multiple systems, and to simplify management in general.

The exceptions to this would be when some program is typically configured to be machine-specific in all cases. (ie: where NFS_sharing the configuration files doesnt make sense). For those types of packages, the SVR4 filesystem standard suggests that /etc/opt/csw/[softwarename] be used as a configuration directory (although clearly labeled examples may go in /opt/csw/etc).

Contrariwise, a program should ONLY write to /opt/csw/var, if it is presumed to never be run from a read-only /opt/csw. In other words, for programs that it only makes sense to have installed locally. Otherwise, it is better to use /var/opt/csw/[softwarename] for a 'var' type purposes.
It is possible, however, for sysadmin admins to mount a writable local /opt/csw/var, on top of a read-only /opt/csw, so the problem may not be fatal. But for the general case, /opt/csw/var is preferred.

General layout philosophy

Generally speaking, we will use a typical free software /usr/local style layout. Substitute /opt/csw in place of /usr/local, and everything should look "normal". In fact, if you make a symbolic link from /usr/local to /opt/csw, or lofs mount, etcetera, things should generally work as expected if you set your PATH to include /usr/local/bin

Subdirectories of /opt/csw

User runnable executables

32-bit executables optimized for sparc "v8+" instruction set. Should have its RPATH set to use libs in /opt/csw/lib/sparcv8plus.
32-bit executables optimized for sparc "v8+" instruction set, with use of the VIS extensions to the SPARC instruction set. Should have its RPATH set to use libs in /opt/csw/lib/sparcv8plus+vis. This is probably more useful than sparcv8plus, since all sun ultrasparcs support this sub-architecture.
64-bit executables for sparc, if isaexec is used in bin. Should have its RPATH set to use libs in /opt/csw/lib/sparcv9.
Configuration files

"library" files, and other architecture dependant files. Typically used for "libxxx.so" files. May also be used in some cases for datafiles for a program (would normally be stored under lib/progname/). However, the preferred location for non-library data would normally be under the 'share' directory.

localized information that has been compiled to arch-specific formats, belongs in here.
A symbolic link back to the lib directory.
Points to 64-bit versions of shared libraries found in lib directory, if available
For libraries optimized for 32 ultrasparc cpus that have the "v8+" SPARC instruction set
For libraries optimized for 32 ultrasparc cpus that have the "v8+" SPARC instruction set AND the VIS extensions.
Typically where lib/64 will point to, on sparc systems.
The equivalent of /usr/openwin/lib/X11, or /usr/X11R6/lib/X11. Note that "app-defaults" files go under lib/X11/app-defaults
[Definition under construction]

Tentative definition: Location for executables that are run only by other programs, not by a person at a command line prompt.

Executables for sysadmins to run (includes demons)
Data that is shared by multiple programs. Or, common areas that hold certain types of data. Or, a datafile storage area for programs (eg: share/progname/datafiles.txt). Things in here should be architecture-neutral (non-endian-dependant, pure data type stuff, usually textfiles, documentation, etc.)

manpages go under here
Non man-page and non "info" documentation goes here. For example, /opt/csw/share/doc/yourprog/README. A README file here is a good place to put additional user instructions on configuration of complex packages
"pure java" jarfile packages should be kept here.
Data that varies with the running of a program. Typically, programs will have their own subdirectory of var.

Sometimes, when a program has an extreme amount of subprograms, utilities, and libraries associated with it, it may warrant its own subtree under /opt/csw. Generally, programs that expect to install themselves under their own /usr/local/[programname]/ tree, would be installed in /opt/csw/[programname]/

Perl module locations

Please make a note that we take advantage of perl's "vendor" options, to maintain our own "csw" directories, as a vendor of perl packages.
      Good locations for perl modules:
      Bad locations for perl modules:
The easy way to trigger install to these locations, depends on whether the software in question provides Makefile.PL or Build.PL. Choose the appropriate line from either of the following:
      perl Makefile.PL INSTALLDIRS=vendor  #DESTDIR=xxx
      # or
      perl Build.PL installdirs=vendor  #destdir=xxx


Note that the CSWcommon package currently provides certain links for directories:
 man  -> share/man
doc -> share/doc
info -> share/info
This is to make it easier to do a "make install ; find /opt/csw |pkgproto" cycle and have the results come out "correct", even if the software normally installs things into $prefix/man, and so on. Do not put /opt/csw/{man|info|doc} into your pkg prototype files

[Content of this page maintained by Phil Brown]