Filesystem Layout
drks — Thu, 2007-01-18 07:33
In general terms (using RedHat Enterprise Linux as my reference) the following are the main areas on the filesystem to be familiar with:
- /usr/src/redhat
- /usr/src/redhat/SOURCES
- /usr/src/redhat/SPECS
- /usr/src/redhat/BUILD
- /usr/src/redhat/RPMS
- /usr/src/redhat/SRPMS
- /usr/lib/rpm
Most of what your time building RPMs will be spent in the default location of /usr/src/redhat. The following explains each directory in a bit of detail:
- /usr/src/redhat/SOURCES - The SOURCES directory holds any files used to build the RPM (except the spec file). This will include the source .tar.gz, any patches that need to be applied, any configuration files or other files not included in the source tarball. Please note that it is not proper to modify the source tarball package in anyway. You want to ensure that the source tarball is as it is when it ships from the Vendor/Maintainer. Any changes necessary should be done during the rpmbuild process either by commands themselves or by creating software patches (More on that later).
- /usr/src/redhat/SPECS - The SPECS directory contains the spec files used to generate the RPM packages. The spec file is in a way it's own language: you have custom set variables, pre-defined variables, condition statements, etc. Within the SPEC we tell rpmbuild the who, what, where and how. Who maintains the source code, Who maintains the RPM Packages, What we are building, Where to find the Source code and other patches/files needed to successfully build the RPMs, and finally How do we build the software.
- /usr/src/redhat/BUILD - The BUILD directory is where rpmbuild actually unpacks the software, patches it, compiles it, and prepares it for installation.
- /usr/src/redhat/RPMS - The RPMs directory simply contains the final product. If all is well and we successfully 'exit 0' at the end of the rpmbuild process, then we will find ourselves with the packages in this directory.
- /usr/src/redhat/SRPMS - If you build the packages with the '-ba' (build all) flags rpmbuild will not only build the RPMs we so desire, it will also provide us with the Source RPM as well. The SRPM contains the source code, spec, and all other patches/files that were used to build the packages. This allows us to distribute just the Source (and build the package elseware such as on a 64bit machine).
RSS Feed