3.8. Creating a new SPEC file with rpmdev-newspec
The following procedure shows how to create a SPEC file for each of the three aforementioned Hello World!
programs using the rpmdev-newspec
utility.
Procédure
Change to the
~/rpmbuild/SPECS
directory and use therpmdev-newspec
utility:$ cd ~/rpmbuild/SPECS $ rpmdev-newspec bello bello.spec created; type minimal, rpm version >= 4.11. $ rpmdev-newspec cello cello.spec created; type minimal, rpm version >= 4.11. $ rpmdev-newspec pello pello.spec created; type minimal, rpm version >= 4.11.
The
~/rpmbuild/SPECS/
directory now contains three SPEC files namedbello.spec
,cello.spec
, andpello.spec
.Examine the files:
The directives in the files represent those described in What is a SPEC file.
In the following sections, you will populate particular section in the output files of rpmdev-newspec
.
The rpmdev-newspec
utility does not use guidelines or conventions specific to any particular Linux distribution. However, this document targets Red Hat Enterprise Linux, so the %{buildroot}
notation is preferred over the $RPM_BUILD_ROOT
notation when referencing RPM’s Buildroot for consistency with all other defined or provided macros throughout the SPEC file.