Creating packages for other distributions
Related articles
Arch is the best. But you may still want to package for other distributions.
Contents
General
- Virtualization is an obvious way, but requires maintaining additional system(s).
- Use distribution-specific packaging tools. Examples: dh-make, dpkg (Debian), rpm-org (Fedora). Shortcuts such as dpkg-deb or checkinstall may be suited for less complex tasks.
- Chroot to create a base system inside (yet separate from) Arch. Examples: debootstrap (Debian), febootstrap (Fedora). This has the added benefit of building in a minimal, clean environment.
- Use chroot with packaging tools in an an automated fashion. Examples: pbuilder-ubuntu (Debian), mock-git (Fedora).
- A different way to handle (possibly incompatible) depends is static linking. Please note that most distributions frown on this practice.
- Common practice applies regardless of distribution used. For example, do not build packages as root.
Debian
The Debian Packaging Tutorial explains the groundwork. It describes use of the following tools (most available in the AUR):
cowdancer — Copy-on-write wrapper for pbuilder
debootstrap — A tool used to create a Debian base system from scratch, without requiring the availability of dpkg or apt.
devscripts — Scripts to make the life of a Debian Package maintainer easier
dh-autoreconf — Debhelper add-on to call autoreconf and clean up after the build
dh-make — Tool that converts source archives into Debian package source
dpkg — The Debian Package Manager
dput — Debian package upload tool
git-buildpackage — Tools from Debian to integrate the package build system with Git
pbuilder-ubuntu — Chroot environment for building Debian packages
quilt — Manage a series of patches by keeping track of the changes each patch makes
Tips and Tricks
Override dependency handling
dpkg does not recognize dependencies installed by pacman. This means dpkg-buildpackage
will generally fail with errors such as:
dpkg-checkbuilddeps: Unmet build dependencies: build-essential:native debhelper (>= 8.0.0) dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
To override this, use the -d flag:
$ dpkg-buildpackage -d -us -uc
You may also need to override dh_shlibdeps
by adding the following lines to debian/rules
:
override_dh_shlibdeps: dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
Set up a chroot
See the Pbuilder How-To for an introduction to pbuilder-ubuntu. Using cowdancer in addition is recommended as copy-on-write offers a significant performance benefit.
- debian-archive-keyring, ubuntu-keyring and gnupg1 from the AUR are required.
- eatmydata is available as libeatmydata and lib32-libeatmydata in the AUR. To prevent
LD_PRELOAD
errors, it must be installed both inside and outside the chroot. As the paths are different in Arch and Debian, create the following symbolic links:
# ln -s /usr/lib/libeatmydata.so.1.1.1 /usr/lib/libeatmydata/libeatmydata.so # ln -s /usr/lib/libeatmydata.so.1.1.1 /usr/lib/libeatmydata/libeatmydata.so.1
- Sample pbuilderrc
- To create a source package for pbuilder to handle:
$ dpkg-buildpackage -d -us -uc -S
See also
Fedora
rpm-org — RPM.org fork, used in major RPM distros
mock — Takes Source RPMs and builds RPMs from them in a chroot
See also
openSUSE
- openSUSE Portal:Packaging
- Open Build Service - a generic system to build and distribute packages from sources in an automatic, consistent and reproducible way.
- openSUSE packaging guidelines