RPM Packaging
From SystemImager
For now, SystemImager RPMs can only be built by the root user (or using a fakeroot environment). This is necessary because the build process will do things like MAKEDEV which a regular user cannot do.
First, you need to check the code out of SVN. After that, you will need to create the source tarball and from that, use rpmbuild to build the RPMs.
Contents |
Checking code out of SVN
# svn co svn://svn.systemimager.org/var/lib/svn/systemimager/trunk systemimager
Updating the version file
To distinguish RPMs built by different developers, it is advisable to tag your RPMs by modifying the top level VERSION file. I usually like to add the SVN revision number there as well, eg. my VERSION file may look like:
3.7.6r3892_bli
This "tag" will be added to the filename of the RPMs you built.
When you need to release also a tarball with the source code remember to change the version also in the configure. The correct steps are:
- edit the file autoconf/configure.ac and change the following line:
-AC_INIT(SystemImager, 3.7.6, sisuite-devel@lists.sf.net) +AC_INIT(SystemImager, 3.7.6r3892_bli, sisuite-devel@lists.sf.net)
- run from the autoconf/ directory the script bootstrap:
$ cd autoconf/ $ ./bootstrap
- clean temporary files if you want:
$ rm -rf autom4te.cache/
Creating the source tarball
# cd systemimager/ # make source_tarball
This will create a tarball in the tmp/ directory of your checkout.
The process will attempt to sign the tarball, if you do not have a secret key available, you will get the following error messages:
gpg: no default secret key: secret key not available gpg: signing failed: secret key not available make: *** [/tmp/systemimager.trunk/tmp/systemimager-3.7.6.tar.bz2.sign] Error 2
These error messages can be ignored.
Building the RPMs (as root)
# rpmbuild -ta <tarball>
During the build process, it will retrieve other source files from download.systemimager.org that are needed during the compilation. This includes the kernel tarball and other tools.
Sit back, relax, go get a coffee and come back, it will take a while! :-)
Building the RPMs (in a fakeroot environment)
- Open a fakeroot shell:
$ whoami arighi $ fakeroot # whoami root
- Initialize the
fakerootenvironment (we suppose that you have the source in$HOME/systemimager-develand that you are usingbash).
# mkdir -p $HOME/fakeroot # cd $HOME/fakeroot && mkdir -p var/lib/rpm tmp usr/src/rpm # cd $HOME/fakeroot/usr/src/rpm && mkdir -p BUILD RPMS SRPMS SOURCES SPECS
- Set the
PATHto run sbin binaries:
# export PATH=/sbin:/usr/sbin:$PATH
- Define the following RPM macros:
# cat << EOF > $HOME/.rpmmacros
%fakeroot %(echo $HOME/fakeroot)
%_dbpath %{fakeroot}/var/lib/rpm
%_tmppath %{fakeroot}/tmp
%_topdir %{fakeroot}/usr/src/rpm
EOF
- Initialize the RPM database:
# rpm --initdb
- Build the RPMS:
# cd $HOME/systemimager-devel # rpmbuild -ta <tarball>
Cleaning up
After the build process you can free some space running:
# make distclean
