Thursday, December 20, 2018

ppa - Examples of multiple binary packages


I'm trying to include a preview of the new experimental Gtk+ 3 build of Inkscape in our PPA... I want to compile the upstream source using different compile-time options to generate two different binary packages: "inkscape-trunk" (the normal daily build) and "inkscape-trunk-gtk3" (the experimental Gtk+ 3 build).


Below, I've shown how I'd do this manually using the upstream source but I need to know how to do it using Debian packaging tools.


I already found the mpb and vim Ubuntu source packages, which both create multiple binaries using different compile-time configurations. However, both of these use old debhelper syntax, and the rules files both end up being rather complex.


My question: Can anyone suggest a suitable example package, in which multiple binary builds are performed using the new elegant "dh" debhelper syntax? Is this even possible, or do I have to resort to writing the rules file manually.


# Building two different configurations of the same package...
# Make subfolders for building the two different configurations
src_dir=`pwd`
build_default_dir=${src_dir}/build-default
build_gtk3_dir=${src_dir}/build-gtk3
mkdir -p $build_default_dir
mkdir -p $build_gtk3_dir
# Generate build files
./autogen.sh
# Configure and build the default version
cd $build_default_dir
../configure --prefix=/usr/
make
# Configure and build the gtk+ 3 version
cd $build_gtk3_dir
../configure --prefix=/usr/ --enable-gtk3-experimental
make


Take a look at the qbittorrent package, it builds two versions of the package from the same source using the new dh syntax. Here's what it might look like in your case (untested):


#!/usr/bin/make -f
%:
dh $@
override_dh_auto_configure:
mkdir -p build-nox && cd build-default && ../configure --prefix=/usr
mkdir -p build-gtk3 && cd build-gtk3 && ../configure --prefix=/usr --enable-gtk3-experimental
override_dh_auto_build:
dh_auto_build --builddirectory build-default
dh_auto_build --builddirectory build-gtk3
override_dh_auto_install:
dh_auto_install --builddirectory build-default --destdir debian/inkscape-trunk
dh_auto_install --builddirectory build-gtk3 --destdir debian/inkscape-trunk-gtk3
override_dh_auto_clean:
dh_auto_clean --builddirectory build-default
dh_auto_clean --builddirectory build-gtk3

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...