% ############ Start of main section ###########
\font\bgsc=cmbx15 \font\bigsc=cmcsc15 \font\sc=cmcsc10 \font\def=cmbx10
{\bf {\bigsc Writing a simple RPM spec file}}
\smallskip {\bf {\sc From the FAQ:}} "RPM is the RPM Package Manager. It is an open packaging system available for anyone to use. It allows users to take source code for new software and package it into source and binary form such that binaries can be easily installed and tracked and source can be rebuilt easily. It also maintains a database of all packages and their files that can be used for verifying packages and querying for information about files and/or packages." \smallskip
\smallskip {{\bf {\sc The spec file:}} The spec file contains information required by RPM to build a package. The spec file is divided into eight sections: \smallskip
\item{1.} {\bf {\sc Preamble:}} The preamble contains the descriptive data about the package that is displayed when queried for information. Try: \smallskip \centerline{\tt \$rpm -qi \it package-name} \smallskip
\item{2.} {\bf {\sc Prep:}} This contains instructions for unpacking and patching the sources. Any other prep scripts are called in this section.
\item{3.} {\bf {\sc Build:}} This contains the commands required to build the software. This command may be the {\it make} command, or a more complex build script.
\item{4.} {\bf {\sc Install:}} This section contains the instructions required to install the software. This command may be the {\it make install} command, or a more complex installation script.
\item{5.} {\bf {\sc Install/Uninstall Scripts:}} These scripts can be run prior to, or after the installation, or erasure of a package.
\item{6.} {\bf {\sc Verify Scripts:}} These scripts can be used to extend RPM's package verification capabilities.
\item{7.} {\bf {\sc Clean Section:}} These scripts can be used to extend RPM's post build cleanup capabilities.
\item{8.} {\bf {\sc File List:}} {This section contains a list of files in the package. File attributes are set here. This section can also be used to classify files as configuration, or documentation.}
\item{} } \smallskip
The attached spec file was created for BioMail, a small perl program. The file was created as follows: \smallskip
{\bf {\sc Preamble:}} The preamble is the description lifted directly from the README. \smallskip {\bf {\sc Prep:}} The prep section calls the setup macro. This macro uncompresses and untars the source file. \smallskip {\bf {\sc Build:}} The program does not require compilation, therefore this section is empty. \smallskip {\bf {\sc Install:}} The install section copies the files and sets the file attributes. \smallskip {\bf {\sc Install/Uninstall Scripts:}} Not used. \smallskip {\bf {\sc Verify Scripts:}} Not used. \smallskip {\bf {\sc Clean Section:}} The build root directory is erased. \smallskip {\bf {\sc File List:}} The doc macro is called and the program files are listed here. \bigskip The rpms can be built from the spec file with the following options: \smallskip
{\hsize=3in \parindent=0pt \valign{#\strut&#\strut&#\strut&#\strut&#\strut&#\strut&#\strut&#strut\cr Execute the prep section:& Execute the build section:& Execute the install section:& Check file existence:& Build the source rpm:& Build the binaries:& Build all rpms:& Test the spec file syntax: \cr {\tt \$rpm -bp \it package-name}& {\tt \$rpm -bc \it package-name}& {\tt \$rpm -bi \it package-name}& {\tt \$rpm -bl \it package-name}& {\tt \$rpm -bs \it package-name}& {\tt \$rpm -bb \it package-name}& {\tt \$rpm -ba \it package-name}& {\tt \$rpm --test \it package-name} \cr }}
\bigskip Paul Hostetler
{\it phostetl@columbus.rr.com} \bigskip {\sevenrm This document written in} \TeX\ {\sevenrm using {\it emacs}.}
\end
This document was generated on 29 March 2000 using texi2html 1.56k.