-
Notifications
You must be signed in to change notification settings - Fork 19
Making Debian packages
So, how do we go about making .deb packages? Good question. This is where we capture those notes, which are eventually going to be used to make a build script that automates the process for us.
These are the pages we referenced the most when figuring out how to do this.
- http://wiki.debian.org/Packaging
- http://askubuntu.com/questions/27715/create-a-deb-package-from-scripts-or-binaries
This is the process we used to set up the first Debian package build:
git clone https://github.com/Byzantium/ByzPi.git
cd ByzPi
mkdir ourpackage-v0.1
cd ourpackage-v0.1
cp ~/Byzantium/ourcode.py .
dh_make -s --indep --createorig
- This creates a Debian package skeleton.
echo "ourcode.py /usr/sbin" >> debian/install
- Do this one for every file and new directory that has to be installed from the package.
echo "1.0" > debian/source/format
- This sets the package format for dpkg.
echo "8" > debian/compat
- This is the version of the debian/ directory layout we're using.
rm debian/*.ex debian/*.EX
vi debian/changelog
- Fill out the changelog using the Debian format. This is to keep track of what we did as well as play nice with the Debian community.
- Be careful! This file is easy to mess up.
vi debian/control
- This file describes the contents of the package to the user, and specifies the package's dependencies to dpkg.
git add debian/*
git commit
debuild -us -uc
- When asked if you want to proceed because a source code tarball wasn't found, hit 'y'. None of our source code comes in a tarball.
We've already gone through the process once and debugged the configuration files. They're checked into the Git repo, so this means that you can copy the debian/ directory tree of an existing Debian package build (because we know it works) into your new package directory, edit the files appropriately, and git add
them after you get a package built. This'll simplify things in the long run.
After careful analysis, we determined that we don't actually have to cross-compile anything. We do, however, have to package up the code that we wrote as well as the custom system configuration files and a few shell scripts. There are two packages that can't be gotten from the Debian repositories (etherpad, qwebirc and olsrd-viz) which we should be able to construct .deb packages for so long as we have the correct environment:
- Debian package manifest files
- ar
- tar
- A shell script to automate the process
- A PGP key for signing the packages.