Skip to content

Instantly share code, notes, and snippets.

@larsbutler
Created July 20, 2012 16:51
Show Gist options
  • Save larsbutler/3151848 to your computer and use it in GitHub Desktop.
Save larsbutler/3151848 to your computer and use it in GitHub Desktop.
oq-engine deb packaging
oq-engine debian packaging
#######
Preface
#######
The purpose of this document is to share a different approach to debian/ubuntu
packaging of oq-engine.
####################
General requirements
####################
NOTE: All the steps described in this chapter must be performed just one time.
- user with sudo access to an ubuntu (virtual) machine
- a launchpad account
- a valid PGP key uploaded on launchpad and associated with the launchpad
account
- a test repository for your personal launchpad account (see below)
- a pbuilder setup (see below)
- configure dput properly (see below)
- Create a test repository on Launchpad
For testing purpose is a good practice to create a personal ppa on launchpad.
Doing this means go to your your personal overview page
https://launchpad.net/~<your_account_name> and click the “Create a new PPA”
into the “Personal package archives” section.
####################
Install dependencies
####################
$ sudo apt-get install pbuilder debhelper quilt
##############
pbuilder setup
##############
Create $HOME/.pbuilderrc with the following contents:
https://gist.github.com/3151630
Create a chroot for the target distribution:
Oneiric:
$ sudo DIST=oneiric pbuilder create
$ sudo DIST=oneiric pbuilder update
Precise:
$ sudo DIST=precise pbuilder create
$ sudo DIST=precise pbuilder update
#######################
Dput configuration file
#######################
Create $HOME/.dput.cf with the following contents:
[<your_ppa_name>]
login = <your_lp_account>
fqdn = ppa.launchpad.net
method = ftp
incoming = ~<your_lp_account>/<your_ppa_name>/ubuntu/
login = anonymous
allow_unsigned_uploads = 0
where:
<your_ppa_name> is the name of your Personal Package Archive
<your_lp_account> is the login that you use to access to launchpad
Deploy procedure
######################
Prepare debian sources
######################
Go into your oq-engine git clone directory and run:
$ ./packager.sh
###############################
Building binaries with pbuilder
###############################
Oneiric:
From your oq-engine git clone directory,run:
$ sudo DIST=oneiric pbuilder build ./python-oq_<version>.dsc
If all goes well, you will find your package in
/var/cache/pbuilder/oneiric-<your_arch>/result/
$ ls -lrt /var/cache/pbuilder/oneiric-amd64/result/
Precise:
From your oq-engine git clone directory,run:
$ sudo DIST=precise pbuilder build python-oq_<version>.dsc
If all goes well, you will find your package in
/var/cache/pbuilder/precise-<your_arch>/result/
$ ls -lrt /var/cache/pbuilder/precise-<your_arch>/result/
##############################
Testing binaries with pbuilder
##############################
TODO
##############################
Uploading sources on Launchpad
##############################
Launchpad does not allow compilation for multiple series from a single upload;
the debian changelog allows the specification of multiple series but ubuntu
does not honor this and also the repository system doesn't allow multiple
packages with the same version.
If we will want to compile for multiple ubuntu releases at the same time we
will need to produces different sources with different series suffix. For
single releases, it's enough to upload sources to launchpad using lput.
$ cd <your-git-repo-dir>/build-deb
$ dput <your_ppa_name> python-oq_<version>_source.changes
NOTES: On a repository you cannot upload a package version lesser then previous
uploaded. It is possible to delete previous uploaded files.
##########
References
##########
Python packaging:
- http://guide.python-distribute.org/
- http://packages.python.org/distribute/setuptools.html
Debian/Ubuntu packaging:
- https://wiki.ubuntu.com/PackagingGuide/Complete
- http://developer.ubuntu.com/packaging/html/
- http://www.debian.org/doc/manuals/maint-guide/
PBuilder:
- http://pbuilder.alioth.debian.org/
- http://wiki.debian.org/PbuilderTricks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment