OPM/opm-core — pull request #112 by akva2 (2013-01-14 16:33:31+00:00)
Title: Debian packaging

Hi,

I was tasked by @atgeirr to setup packaging for opm (deb and RPM, i start with the familiar terroritory).

DISCLAIMER: i'm not trying to be condescending - if you know all this, please take it as the friendly help it's intended as :)

Here follows the start for opm-core. Some highlights

1) there are a few commits that I would like to include. in particular, it contains a name change for the project - it's a library - and to correspond with distro expectations it should thus be named libfoo (i.e. libopmcore)

2) after discussing with @atgeirr, we decided to host the packaging in-tree. thus, i have set up a '1.0' format aka debian native setup.

before i move on to the other libs, i'd like your input on my approach.

there are two approaches for building;
1) the simple - build on your system - invoke 'sudo dpkg-buildpackage'. if done this way, you have to presupply all dependencies yourself and there is no guarantee that one does not slip.. this will churn, and generate the package in '../' (relative to the root of the source tree)

2) the pbuilder approach. pbuilder lets you build packages without super user access. since it builds in a (fake/ch)root, we get automatic dependency checking - since we have to explicitly list all packages we need.

now, to setup a pbuilder env takes a few mins, but nothing too bad.

1) create the fakeroot base tarball. this is done through

sudo pbuilder create --distribution precise --components "main universe multiverse" --othermirror "deb http://ppa.launchpad.net/opm/ppa/ubuntu precise main"

replace 'precise' with your distro.

the othermirror/ppa is needed to get at the libdune-xxx packages.

this will churn for a few mins, downloading a few 100 MBs (basically it sets up a ubuntu-minimal environment + the extra apt repo we requested).

you can generate buildenvs for any number of distro/arch combinations, see the --basetgz param to pbuilder

2) building is now simple, invoke
'pdebuild' in the root of the tree and let it churn. once finished, the packages will, by default, be generated in /var/cache/pbuilder/result

this also respects the --basetgz param.

------------

as the files depend on the renaming, packaging scheme chosen etc i await your comments before i do the rest of the libraries.

note that this is also compatible with launchpad provided builds, as launchpad relies on pbuilder.