nethserver-mock package provides some scripts to ease the process of
building and releasing RPMs.
Configuring the environment¶
On NethServer, install
nethserver-mock package, by typing:
yum install nethserver-mock
On Fedora, and other RPM-based distros run the command:
yum install <URL>
dnf install <URL>
where <URL> is http://packages.nethserver.org/nethserver/7.3.1611/base/x86_64/Packages/nethserver-mock-1.3.2-1.ns7.noarch.rpm at the time of writing.
The build process uses Mock and must be run as a non privileged user,
member of the
mock system group. Add your user to the
usermod -a -G mock <username>
Running the scripts¶
make-rpms command eases building of the NethServer RPMs by
hiding the complexity of other commands. It is designed to work
inside the git repository directory of NethServer packages, but should
fit other environments, too.
Start by cloning the git repository and move inside it. For instance
git clone https://github.com/nethesis/nethserver-mail-server.git cd nethserver-mail-server
To build the RPM just type
The command writes the results into the current directory, assuming every change to the source code has been commited. If everything goes well they consist of:
- source RPM
- binary/noarch RPMs
- mock log files
To clean up the git repository directory,
git clean may help:
git clean -x -n
-f to actually remove the files!
make-rpms command is sensible to
environment variables. If they are missing the default values are
shown by invoking it without arguments.
dist=ns7 mockcfg=nethserver-7-x86_64 make-rpms *.spec
make-rpms command in turn relies on other scripts
- Builds the
- Extracts and/or fetches the source tarballs.
Source tag in the
.spec file is assumed refer to
the local git repository. If an absolute URL is specified, only the
last part is considered. Other
SourceN tags must conform to the
Fedora RPM guidelines . The external sources are actually
fetched by the
If the file
SHA1SUM exists in the same directory of the
.spec file the tarballs are checked against it.
Development and Release builds¶
During the development, a package can be rebuilt frequently: increasing build numbers and unique release identifiers are useful during this stage to help the whole process.
make-rpms is invoked, it checks the git log history and tags
to decide what kind of build is required: development or release.
Release builds produce a traditional RPM file name, i.e.:
Development builds produces a marked RPM, i.e:
Other differences in development from release are
.specis replaced by the git log history since the last tag
- the number of commits since the last tag, and the latest git commit
hash are extracted from
git describeand prepended to the
sign-rpms is a wrapper around
command. Its advantage is it can read a password for the GPG
signature from the filesystem. Sample invocation:
sign-rpms -f ~/.secret -k ABCDABCD
The signature is added automatically by
|||Referencing Source http://fedoraproject.org/wiki/Packaging:SourceURL|