How to package for Devuan
This document describes how to contribute to Devuan packaging.
Devuan uses the same format for packaging as Debian, so this is very similar to Debian packaging except that we only use gitlab for hosting and building packages. Specifically we will cover how to remove the systemd dependency from packages to make them suitable for use in Devuan.
Relevant release codenames
- suites/jessie (stable branch)
- suites/ascii (testing branch)
- suites/ceres (unstable branch)
In order to package for Devuan you will need to sign up for a gitlab account. Once you've signed up you should then login and set up your SSH keys in order to have remote access to your projects.
You will then need to find the VCS for the Debian package on the Debian tracker.
Once you've found your package use the gitlab web interface to to start a new project named after the Debian package and import the package by URL from the Debian VCS.
Setting up a local repository
Copy the SSH link from the project page of your new package and use it to clone the repository locally.
$ git clone email@example.com:your-name/package-name.git
Change to the directory created from your cloned repository.
$ cd <package-name>
Check the Debian tracker to find the correct release using the format
debian-<tagged-version>, then find it in your local git repository.
$ git tag | grep ^debian
Switch to the Debian release.
$ git checkout debian-<tagged-version>
Create the Devuan branch name you will be working on. Before packages can be included in Devuan, they must first be tested with the branch name
$ git checkout -b suites/<release-codenames>-proposed
Remove systemd as a dependency
We need to modify the control file to take over maintainership of the package, and remove the systemd dependency.
$ sensible-editor debian/control
Replace the Debian maintainers' information with your own.
Maintainer: Your Name <firstname.lastname@example.org>
We need to change the
Build-Depends section so that the package will not build with systemd support enabled. Here we would remove the last two lines as they are systemd dependencies.
Depends sections so as not to depend on systemd, specifically we want to remove
libsystemd0 as a dependency.
Depends: openssl, perl, libsystemd0
Exclude systemd from the build
rules file so that we can remove systemd from the build process.
$ sensible-editor debian/rules
Find the line that invokes the debhelper build and remove the
--with systemd argument. Here we can just remove
systemd from the end of the line.
dh $@ --parallel --with autoreconf systemd
In some cases configure options will be set for where to store systemd unit files. We can disable this by commenting it out.
Update the copyright information
Since we have made changes to the files in the
debian/ directory we need to update the copyright file.
$ sensible-editor debian/copyright
Append your information to the
Files: debian/* section that is commonly used by maintainers.
Copyright: 2015 Debian maintainer <email@example.com>
2016 Your Name <firstname.lastname@example.org>
When we build the package,
gbp will build an original source tarball for us provided we have an upstream branch that corresponds to our branch. But we need to configure gbp first.
gbp.conf configuration file.
$ sensible-editor debian/gbp.conf
Make sure git-buildpackage knows what Devuan branch to build from. Add any further options you need here.
# Example gbp.conf
debian-branch = suites/jessie-proposed
Building the package
Before we push our changes, we want to make sure the package is in a usable state by building it locally.
Install the required dependencies to build your package, but be sure to remove systemd afterwards.
$ sudo apt-get build-dep <package-name> && sudo apt-get purge libsystemd0 dh-systemd
Add your changes to the index and commit them so we can get back to this point easily. Be sure to include a description of your changes in the commit.
$ git add --all
$ git commit
Now we can build the package. The lintian utility helps us check for adherence to the Debian policy during the build, so be sure to keep an eye on the output.
$ gbp buildpackage
Reset the repository back to our last commit and clean the working directory.
$ git reset --hard
$ git clean -d -f -f
Uploading the package
If you are finished making changes you should now update the change log.
$ gbp dch -a -R -N <version>+devuan1
We need to update the index again and make a final commit before pushing our changes back to your project files.
$ git add --all
$ git commit
If you are done making changes to the package you can tag it as a release. Append the string
devuan1 to denote that this is the first Devuan release.
$ git tag <package-name>-<version>+devuan1
Finally, push the changes to gitlab.
$ git push --set-upstream origin suites/<release-codename>-proposed
Applying to be a maintainer
Packages forked from Debian are kept in the devuan-packages group. Log in to your gitlab account and open an issue in the group named after the package. If your application is accepted you will be given master permission to the package.
Build the package on gitlab
First talk to the Devuan packaging masters in #devuan-dev on irc.freenode.net about getting your package added to the build system. Once your packaging skills and trustworthiness have been verified they will help you add your package to the build system.
When you are ready to build your package, create an issue with the title "build" and setting the label to
Watch the output of the build in the #devuan-dev channel. Once you have solved any problems with the build, you can move your branch to the appropriate release codename for inclusion in the main distribution.
$ git branch -b suites/<release-codename>
You can now build your package again to have it included in the main distribution.
Contributing to packages
If you are not applying to be a maintainer, you can still contribute to Devuan packaging. To do this you can fork the package on gitlab and make a merge request to the original package. The maintainer will inspect your merge request and if accepted you will have successfully contributed to Devuan packaging.