Packaging/SUSE Package Conventions/Filesystem Structure

From openSUSE

4. File System Structure

Prev

Next



4. File System Structure


SUSE Linux is LSB compliant and follows FHS (Filesystem Hierarchy Standard) version 2.3 as defined at http://www.pathname.com/fhs/. This section just defines some rules more precisely and highlights some important information. See the standard for the more details.

/opt is reserved for the installation of add-on application software packages. Many packages distributed within SUSE Linux used this directory in the past but are now moved below /usr. Even GNOME and KDE will be moved below /usr in the near future. No new packages are allowed to be installed there.

/srv is reserved for the data files used by particular services, such as ftp or www. Variable data is allowed. The config files should still be in /etc and real variable data, like the ftp database, which tells you how many users are connected, should stay in /var. SUSE Linux defines the structure by protocols and creates the following directories by default:


  • /srv/ftp — For data accessible via the FTP protocol.
  • /srv/www — For web services. There are special subdirectories for CGI scripts and HTML documentation (see below). Packages can create a subdirectory /srv/www/{name} for data. {name} is usually the package name.
  • /srv/www/cgi-bin — For CGI scripts. Any package can put single scripts directly in this directory or create a subdirecory /srv/www/cgi-bin/{name} for them. {name} is typically the package name.
  • /srv/www/htdocs — For static HTML documents.


/etc/X11 and /usr/X11R6 are reserved for the X Window System and related files, like fonts. All other applications and libraries should be installed below /etc or /usr.


4.1. Biarch Systems


The directories like /usr/lib64 and /usr/X11R6/lib64 are used next to the usual /usr/lib and /usr/X11R6/lib directories on biarch systems. This is because two variants of the same libraries must coexist on such systems to allow running both 32-bit and 64-bit applications in parallel. The 64-bit libraries are installed in lib64 directories and 32-bit libraries in the lib directories. The macros [[SUSE_Package_Conventions/RPM_Macros#spc_rm_lib %_lib] and [spc_rpm_macros.html#spc_rm_libdir %_libdir] do this.

Special packages are created for the biarch systems that include only the 32-bit libraries. Any other files are not needed because these libraries can use architecture independent files from the 64-bit packages. They are even able to execute 64-bit helper binaries. Therefore, these are shared as well and are installed into lib on all architectures instead (and not %_lib). See the part about --libexecdir in the following section.


4.2. GNU Default Paths


GNU configuration tools use default paths that do not follow FHS. If they are used in the package, they must be redefined using the following configure options:


  • --infodir defines the directory where the info pages will be stored. The default path {prefix}/info is not allowed by FHS. {prefix}/share/info is used instead. Example: --infodir=%_infodir
  • --libdir defines the directory for libraries. It must be used on biarch systems (see above). The macros %_libdir and %_lib define the right path also on such systems. Example: --libdir=%_libdir
  • --libexecdir defines the directory for binary helpers that are called from other binaries or libraries but not by users. The default path {exec_prefix}/libexec is not allowed by FHS. The recommended path is {prefix}/lib/{name} where {prefix} is package prefix and {name} is the package name. lib is used for all architectures (and not %_lib). See [[SUSE_Package_Conventions/Filesystem_Structure#spc_fs_biarch_systems Section�4.1, “Biarch Systems”] for more details. Example: --libexecdir=%_prefix/lib/%name

Some packages already create a subdirectory below libexecdir. In this case, it is enough to use --libexecdir=%_prefix/lib. There are special dedicated directories for various types of binaries. They can be used if a package installs only one such binary. For example, GNOME applets can be installed to /opt/gnome/lib/gnome-applets.

  • --localstatedir defines the directory where the variable data will be stored. The default path {prefix}/var is not allowed by FHS. /var or its subdirectory is used instead. The particular subdirectory depends on the type of data and on the prefix where the application is installed. Applications generally must not create subdirectories below the top level of /var. They can use, for example, /var/lib instead. See FHS for more details. Example: --localstatedir=%_localstatedir or –localstatedir=%_localstatedir/lib
  • --mandir defines the directory where the man pages will be stored. The default path {prefix}/man is not allowed by FHS. {prefix}/share/man is used instead. Example: --mandir=%_mandir
  • --prefix defines the prefix where the package will be installed. The default path /usr/local is used by local system administrators. The packages distributed within SUSE Linux must not install any files below this directory. The prefix /usr is usually used instead. Example: --prefix=%_prefix
  • --sharestatedir defines the directory where the variable architecture-independent data will be stored. The default path {prefix}/com is not allowed by FHS. /var or its subdirectory is used instead. There are the same rules as for --localstatedir (see above). This is because FHS does not differentiate between architecture dependent and independent data below /var. Example: --sharestatedir=%_localstatedir or --sharestatedir=%_localstatedir/lib
  • --sysconfigdir defines the directory where the configuration will be stored. The default path {prefix}/etc is not allowed by FHS. /etc is used instead. Example: --sysconfdir=%_sysconfdir


Other paths are usually set correctly already by --prefix.



Prev

Next

3. RPM Macros

Home

5. Sysconfig