Product SiteDocumentation Site

3.2.6. Installing source RPMs

Source RPMs contain the source code used to build an application or programming library and the scripts used to build the software into the application or library. These scripts are called the recipes for building the software.
Source RPMs usually contain program source code. They may also contain patches to program sources, scripts to build the program, special files used by desktop environments, icons, and other files considered to be part of the source code, such as programming guides.

Patch Files

A patch is a file that contains just the differences between one version of a file and another. The differences include the actual text that has changed and enough contextual information that a program can locate where the changes are to take place. Usually, a patch is created with the diff command, and the source code is patched with the patch command.
In most cases, each binary RPM will have a corresponding source RPM. This is not always true, however.
One source RPM may contain enough shared program code to build multiple application RPMs. Furthermore, the source code is not available for all packages. Commercial applications, for example, rarely come with source code. In this case, obviously, no source RPMs are available. Or, a source RPM for a commercial application may provide no source code, but still provide a way to build the resulting application. See Chapter 9, Working with Spec Files for more on the source files and options for not including the sources in a source RPM. Open-source Software

Linux, and thousands of applications that run on Linux, are called open-source software. That’s because the program source code for Linux and these applications are available.
Many users feel having access to the source code is vital, especially because:
  • Vendors may stop supporting a package. With the sources, you can conceivably maintain the packages yourself, or more likely, others can take up the task and maintain these crucial packages.
  • Having the source code makes it easier to track down and fix security vulnerabilities, although malicious users also have access to the same source code.
  • You can enhance and extend packages for which the program sources are available.
Linux applications are available under a variety of open-source licenses. (In fact, it may seem that there are as many licenses as packages.) See the site for details.