[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

How to build flavored package if upstream doesn't grok OOT build



Hi,

I am trying to package the authoritative PowerDNS server in a way that
allows Upstream to use my packaging as well. Additional to the normal
dynamically linked builds, they would like to have a statically linked
binary package as well, which should not be in Debian but only in
their builds.

To ease my work load, I would like to be able to build both the Debian
and the Upstream .debs from the same packaging. The Debian packaging
uses dh, and the canonical way to do multi-flavored builds would be
this, as far as I know:

#!/usr/bin/make -f

PACKAGE = pdns
OOT = --builddirectory=build

backends_dyn := ldap pipe gmysql gpgsql gsqlite gsqlite3 geo lua
backends_sta := pipe gmysql gpgsql gsqlite gsqlite3 geo lua

DEB_HOST_MULTIARCH  ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

%:
        dh $@ --with autotools_dev,autoreconf --parallel

override_dh_auto_configure:
        dh_auto_configure $(OOT)-dyn -- \
                --host=$(DEB_HOST_GNU_TYPE) \
                --build=$(DEB_BUILD_GNU_TYPE) \
                --prefix=/usr \
                --sysconfdir=/etc/powerdns \
                --mandir=\$${prefix}/share/man \
                --infodir=\$${prefix}/share/info \
                --libdir='$${prefix}/lib/powerdns' \
                --libexecdir='$${prefix}/lib' \
                --with-dynmodules="$(backends)" \
                --with-modules="" \
                --with-pgsql-includes=`pg_config --includedir` \
                --with-mysql-lib=/usr/lib/$(DEB_HOST_MULTIARCH) \
                --with-boost=/usr \
                --enable-cryptopp \
                --disable-recursor
        dh_auto_configure $(OOT)-sta -- \
                --host=$(DEB_HOST_GNU_TYPE) \
                --build=$(DEB_BUILD_GNU_TYPE) \
                --prefix=/usr \
                --sysconfdir=/etc/powerdns \
                --mandir=\$${prefix}/share/man \
                --infodir=\$${prefix}/share/info \
                --libdir='$${prefix}/lib/powerdns' \
                --libexecdir='$${prefix}/lib' \
                --with-dynmodules="" \
                --with-modules="$(backends)" \
                --with-pgsql-includes=`pg_config --includedir` \
                --with-mysql-lib=/usr/lib/$(DEB_HOST_MULTIARCH) \
                --with-boost=/usr \
                --enable-cryptopp \
                --disable-recursor \
                --enable-static-binaries

override_dh_auto_build:
        $(MAKE) -C build-sta
        $(MAKE) -C build-dyn

override_dh_auto_install:
        $(MAKE) -C build-sta/ install DESTDIR=$(CURDIR)/debian/tmp-sta
        $(MAKE) -C build-dyn/ install DESTDIR=$(CURDIR)/debian/tmp-dyn

override_dh_install:
        dh_install -p$(PACKAGE)        --sourcedir=debian/tmp-dyn
        dh_install -p$(PACKAGE)-static --sourcedir=debian/tmp-sta

# pdns-server has a debug package
override_dh_strip:
        dh_strip --dbg-package=pdns-server-dbg

Unfortunately, this does not work, as Upstream's build mechanics do
not seem to handle out-of-tree building. I have already asked them to
fix their build mechanics, but in the mean time I would like to
continue as the freeze is approaching.

How can I build two flavors of a program with different configure
parameters if upstream does not properly handle out-of-tree building
and I do not want to ditch dh?

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things."    Winona Ryder | Fon: *49 621 31958061
Nordisch by Nature |  How to make an American Quilt | Fax: *49 621 31958062


Reply to: