Installing Software from RPM Source Code Files: SRPMs

 < Day Day Up > 



Red Hat and several other distributors also make available source code versions of their binary RPM packaged software. The source code is packaged into RPM packages that will be automatically installed into designated directories where you can easily compile and install the software. Source code packages are called SRPMs. The names for these packages end in the extension .src.rpm. Source code versions for packages in the Red Hat distribution are located on Red Hat releases in the SRPMS directory. Many online sites like rpmfind.net also list SRPM packages. Source code versions have the advantage of letting you make your own modifications to the source code, allowing you to generate your own customized versions of RPM packaged software. You still use the rpm command with the -i option to install source code packages. In the following example, you install the source code for Freeciv:

# rpm -i freeciv-1.13.0-2.src.rpm

Source Code RPM Directories

On Red Hat, SRPM files are installed in various subdirectories in the /usr/src/redhat directory. When SRPMs are installed, a spec file is placed in the /usr/src/redhat/SPECS directory, and the compressed archive of the source code files is placed in the /usr/src/redhat/SOURCES directory. For Freeciv, a spec file called freeciv.spec is placed in /usr/src/redhat/SPECS, and a compressed archive called freeciv-1.13.0.tar.gz is placed in the /usr/src/redhat/SOURCES directory.

Building the Source Code

To build the source code files, you need to extract them and run any patches on them that may be included with the package. You do this by changing to the /usr/src/redhat/SPECS directory and using the rpm command, this time with the -bp option, to generate the source code files:

# cd /usr/src/redhat/SPECS # rpm -bp freeciv.spec

The resulting source code files are placed in their own subdirectory with the package's name in the /usr/src/redhat/BUILD directory. For Freeciv, the Freeciv source code is placed in /usr/src/redhat/BUILD/freeciv-1.13.0 directory. In this subdirectory, you can then modify the source code, as well as compile and install the application. Check the software's README and INSTALL files for details.



 < Day Day Up > 



Red Hat(c) The Complete Reference
Red Hat Enterprise Linux & Fedora Edition (DVD): The Complete Reference
ISBN: 0072230754
EAN: 2147483647
Year: 2004
Pages: 328

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net