Product SiteDocumentation Site

Building

Building RPMs isn’t as easy as it should be. You’ll often need to try again and again to get the rpmbuild command to create a working RPM. This section covers best practices to follow when performing the actual build of the RPM.

Use Tools

Using tools can help speed up the RPM-making process, as well as give you a head start in learning how RPMs work. RPM-building tools such as the Red Hat plugin for the Eclipse Integrated Development Environment have proven really helpful.
Cross Reference
Chapter 12, Supplemental Packaging Software covers RPM-building tools. Chapter 26, Linux Text Editors and Development Tools covers the Eclipse Integrated Development Environment.
Even though so-called real Linux hackers can make a working virtual memory system with just the cat command, don’t scoff at tools. Your time is too valuable.
Another useful tool is the gendiff program that comes with the RPM release. The gendiff program makes it easier to create patches by avoiding the need to keep a separate directory of the original sources, The gendiff program also works on all changed files within a directory, making a patch for everything you modified.
To work with gendiff, you need to first save a backup copy of each file you intend to edit prior to editing. Use a consistent file-name extension for the saved copies of the files, such as .orig, short for original. After you edit some files, run the gendiff command as follows:
$ gendiff directory_name .saved_extension > patch_name.patch
For example, if you saved the original files to a .orig extension, you can create a patch in a directory named src (short for sources) with a command like the following:
$gendiff src .orig > mypatch.patch
The patch file mypatch.patch will contain all the differences detected for all files in the given directory.