Creating packages for other distributions
Arch is the best. But you may still want to package for other distributions.
- 1 General
- 2 Debian
- 3 Fedora
- 4 openSUSE
- 5 See also
- Virtualization is an obvious way, but requires maintaining additional system(s).
- Use distribution-specific packaging tools. Examples: dpkg-deb or AUR[broken link: archived in aur-mirror] may be suited for less complex tasks. AUR, AUR (Debian), AUR (Fedora). Shortcuts such as
- Chroot to create a base system inside (yet separate from) Arch. Examples: (Debian), AUR (Fedora). This has the added benefit of building in a minimal, clean environment.
- Use chroot with packaging tools in an an automated fashion. Examples: broken link: archived in aur-mirror] (Fedora). AUR (Debian), AUR[
- 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.
The Debian Packaging Tutorial explains the groundwork. It describes use of the following tools:
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
override_dh_shlibdeps: dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
Set up a chroot
- AUR are required. AUR, AUR and AUR from the
- eatmydata is available as broken link: archived in aur-mirror] in the AUR. To prevent
LD_PRELOADerrors, it must be installed both inside and outside the chroot. As the paths are different in Arch and Debian, create the following symbolic links: AUR and AUR[
# 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
rpm-org — RPM.org fork, used in major RPM distros
- http://www.rpm.org/ || AUR
mock — Takes Source RPMs and builds RPMs from them in a chroot
The Open Build Service (OBS) is a generic system to build and distribute packages from sources in an automatic, consistent and reproducible way. It supports at least .deb, .rpm and Arch packages.
Creating Arch Packages in OBS with OSC
Creating a Package
- Create an account in 
- Install the AUR package. Upstream documentation is available here.
- Create an example
- Create an example
home:foo:barsubproject (optional, but recommended).
- Create a new
hamexample package with
osc meta pkg -e home:foo:bar ham. Save the created XML then exit.
- Switch to a clean working directory then checkout the project you've just created:
osc co home:foo:bar/ham.
- Now cd into it:
Managing a Package
Now it is time to decide how we will manage our project. There are two practical ways to do this:
- Maintain a PKGBUILD plus its helper files (such as *.install scripts) in a version control system (such as git, hg) then just make OBS track it;
- Maintain a package entirely in OBS itself.
The first version is more flexible and dynamic. To proceed:
- From your project directory, create a
_servicefile with the following contents:
<services> <service name="tar_scm"> <param name="scm">git</param> <param name="url">git://<your_repo_here></param> <param name="versionformat">git%cd~%h</param> <param name="versionprefix"><your_version_here></param> <param name="filename"><name_of_your_package></param> </service> <service name="recompress"> <param name="file">*.tar</param> <param name="compression">xz</param> </service> <service name="set_version"/> </services>
Here is an example forAUR:
<services> <service name="tar_scm"> <param name="scm">git</param> <param name="url">git://git.gnome.org/gimp.git</param> <param name="versionformat">git%cd~%h</param> <param name="versionprefix">2.9.1</param> <param name="filename">gimp-git</param> </service> <service name="recompress"> <param name="file">*.tar</param> <param name="compression">xz</param> </service> <service name="set_version"/> </services>
- Make OBS track it:
osc add _service
- If you have any other files to include into the repo, just proceed as before: add the files in the project directory, then make OBS track them (OBS uses subversion as its underlying SCM, so this process might already be familiar for you)
- Check-in (=upload) your files into the repo
osc ci -m "commit message (e.g. bumped package xxx to version yyy".
Now, after a while, OBS will begin building your package.
Tips and tricks
- To see the build progress of your package, cd into its working directory, then:
- There are two repositories, Arch_Core and Arch_Extra. You'll probably want Arch_Extra, since it is more complete. [community] isn't currently available there as of this edit, so if your project has any dependencies in [community], you should include them (manually) in your (sub)project too.
- There is an unofficial arch-community repo here. You might clone a package from there with
osc branch home:roman-neuhauser:arch-community/<package-name> home:foo:bar/<package-name>.
ca-certificates-utils package problem
If OBS build fails because of the ca-certificates-utils package, you can add this line to your project config (from your project page, go to Advanced -> Project Config).
Prefer: ca-certificates-utils ca-certificates