From Mageia wiki
Jump to: navigation, search
Drakconf multiflag.png
Other languages

Deutsch ; English ; Français


In Mageia new packages or new versions of existing packages are already added to Cauldron first. In some cases they might be pushed to stable releases as updates (bug or security fixes) or as backports. The availability of a backports depends on the time and will of the packager, and it has to be tested by the QA before it is made available to all users.

From time to time, you might want to speed up the process and build your own backport yourself. This Howto will describe the easy steps required to create your own RPM using a Cauldron SRPM (source package, with the extension src.rpm). It is intended for leaf packages only, i.e. packages which have no influence on the rest of the distro (games, standalone multimedia software, etc.).

Please remember to fill in a backport request if you think many users could be interested in the backport; an official backport is the best way to ensure a smooth upgrade to the next stable release.

Download the Cauldron SRPM of the package

  • Choose a mirror on Mageia's mirrors database. In this tutorial we will use distrib-coffee.ipsl.jussieu.fr.
  • Click on one of the protocols (FTP or HTTP) to browse the mirror, and go to distrib/cauldron/SRPMS/core/release (you can also choose nonfree or tainted, if you want a SRPM from these repos).
  • When the page is loaded (it's quite big), search for your package, and download it. In this tutorial, we choose to backport Dust Racing 2D (dustrac).
$ cd ~/Downloads
$ wget -c http://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/cauldron/SRPMS/core/release/dustrac-1.7.1-2.mga5.src.rpm

Prepare the build environment

  • First of all you will need to install the build dependencies of the package. Those are listed in the SRPM, so you can install them all using with this command:
# urpmi --buildrequires package.src.rpm
  • You might also need to install build tools. Installing rpm-build should pull in all the needed dependencies.
  • When you build packages from the SRPM, they are put in the default path ~/rpmbuild/RPMS/
    You can find more information about setting up a complete build environment on the Packagers RPM tutorial, if you are interested in packaging.
$ su
# urpmi rpm-build
# urpmi --buildrequires dustrac-1.7.1-2.mga5.src.rpm
# exit

Build the binary RPM(s) from the SRPM

You are now ready to build your RPM(s) with rpmbuild --rebuild package.src.rpm. Remember to do this as normal user and not as root:

$ rpmbuild --rebuild dustrac-1.7.1-2.mga5.src.rpm

You should see the following warning:

warning: user iurt does not exist - using root
warning: group iurt does not exist - using root

You can simply ignore it.

If the package does not build easily, then it does not qualify for a quick and dirty backport, and you should ask its maintainer to do a proper backport, if she sees fit.

Install or remove your home-made backport

  • Unless otherwise configured, the package will be created in ~/rpmbuild/RPMS/$ARCH, $ARCH being the package's architecture (x86_64, i586 or noarch).
    The architecture should be either your distribution architecture, or noarch (or sometimes both when there are several RPMs).
$ cd ~/rpmbuild/RPMS/
$ su
# urpmi x86_64/dustrac-1.7.1-2.x86_64.rpm
# exit
  • In some cases, several packages are built out of one SRPM. If those packages depend on each other, you will have to write the relative path to each needed package in the urpmi command.
  • The newly installed package is included in your RPM database, so you can uninstall it as any regular package:
# urpme dustrac