Библиотека сайта rus-linux.net
In the previous chapter, we looked at RPM's build process from a conceptual level. In this chapter, we will be performing an actual build using RPM. In order to keep things understandable for this first pass, the build will be very simple. Once we've covered the basics, we'll present more real-world examples in later chapters.
RPM requires a set of directories in which to perform the build. While the directories' locations and names can be changed, unless there's a reason to do so, it's best to use the default layout. Note that if you've installed RPM, the build directories are most likely in place already.
The normal directory layout consists of a single top-level directory
(The default name is
/usr/src/redhat), with five
subdirectories. The five subdirectories and their functions are:
/usr/src/redhat/SOURCES— Contains the original sources, patches, and icon files.
/usr/src/redhat/SPECS— Contains the spec files used to control the build process.
/usr/src/redhat/BUILD— The directory in which the sources are unpacked, and the software is built.
/usr/src/redhat/RPMS— Contains the binary package files created by the build process.
/usr/src/redhat/SRPMS— Contains the source package files created by the build process.
BUILDdirectory be part of a filesystem with sufficient free space to build the largest package expected. Here is a directory listing showing a typical build directory tree:
Now that we have the directories ready to go, it's time to prepare for
the build. For the remainder of this chapter, we'll be building a
fictional piece of software known as
In reality, this software is a mercilessly hacked version of