From edc0fa99868398e1294acc964c23222034f7b203 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Wed, 14 Oct 2015 12:40:51 +0200 Subject: [PATCH] Build dnsdist packages for Ubuntu Trusty * Don't link against libsodium in ubuntu 14.04 * Add upstart file for Ubuntu --- build-scripts/build-dnsdist-debian | 5 +++++ .../debian-dnsdist/{control => control.in} | 2 +- build-scripts/debian-dnsdist/dnsdist.upstart | 9 ++++++++ build-scripts/debian-dnsdist/rules | 21 +++++++++++++++++-- 4 files changed, 34 insertions(+), 3 deletions(-) rename build-scripts/debian-dnsdist/{control => control.in} (92%) create mode 100644 build-scripts/debian-dnsdist/dnsdist.upstart diff --git a/build-scripts/build-dnsdist-debian b/build-scripts/build-dnsdist-debian index bb325af34..ce1593b4e 100755 --- a/build-scripts/build-dnsdist-debian +++ b/build-scripts/build-dnsdist-debian @@ -36,4 +36,9 @@ dnsdist (${VERSION}-${RELEASE}) unstable; urgency=medium EOF +. /etc/os-release +export ID="${ID}" +export VERSION_ID="${VERSION_ID}" + +fakeroot debian/rules debian/control fakeroot debian/rules binary diff --git a/build-scripts/debian-dnsdist/control b/build-scripts/debian-dnsdist/control.in similarity index 92% rename from build-scripts/debian-dnsdist/control rename to build-scripts/debian-dnsdist/control.in index d33506f32..606317961 100644 --- a/build-scripts/debian-dnsdist/control +++ b/build-scripts/debian-dnsdist/control.in @@ -3,7 +3,7 @@ Section: net Priority: optional Maintainer: PowerDNS Autobuilder Origin: PowerDNS -Build-Depends: debhelper (>= 9), dh-systemd (>= 1.5), autotools-dev, libboost-dev, liblua5.2-dev, libsodium-dev +Build-Depends: debhelper (>= 9), dh-systemd (>= 1.5), autotools-dev, libboost-dev, liblua5.2-dev @LIBSODIUMDEV@ Standards-Version: 3.9.5 Homepage: http://dnsdist.org diff --git a/build-scripts/debian-dnsdist/dnsdist.upstart b/build-scripts/debian-dnsdist/dnsdist.upstart new file mode 100644 index 000000000..191dab2d9 --- /dev/null +++ b/build-scripts/debian-dnsdist/dnsdist.upstart @@ -0,0 +1,9 @@ +description "dnsdist - A powerful DNS loadbalancer" + +start on runlevel [2345] +stop on runlevel [!2345] + +author "Pieter Lexis " + +# Keep the --supervised option when modifying this +exec /usr/bin/dnsdist --supervised -l 127.0.0.1 diff --git a/build-scripts/debian-dnsdist/rules b/build-scripts/debian-dnsdist/rules index c30d9c154..7aedb0e1b 100755 --- a/build-scripts/debian-dnsdist/rules +++ b/build-scripts/debian-dnsdist/rules @@ -7,11 +7,28 @@ DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/default.mk +ENABLE_LIBSODIUM := --enable-libsodium +LIBSODIUM_DEV := , libsodium-dev +DEBHELPER_WITH_SYSTEMD := --with systemd + +# $(ID) and $(VERSION_ID) come from the environment, source this from /etc/os-release +ifeq ($(ID), ubuntu) + ifeq ($(VERSION_ID), 14.04) + # Disable building and depending on libsodium on Ubuntu Trusty + ENABLE_LIBSODIUM= + LIBSODIUM_DEV= + DEBHELPER_WITH_SYSTEMD= + endif +endif + +debian/control: debian/control.in + sed -E "s!@LIBSODIUMDEV@!$(LIBSODIUM_DEV)!" $< > $@ + %: dh $@ \ --with autotools-dev \ --parallel \ - --with systemd + $(DEBHELPER_WITH_SYSTEMD) override_dh_auto_configure: ./configure \ @@ -23,7 +40,7 @@ override_dh_auto_configure: --infodir=\$${prefix}/share/info \ --libdir='$${prefix}/lib/$(DEB_HOST_MULTIARCH)' \ --libexecdir='$${prefix}/lib' \ - --enable-libsodium + $(ENABLE_LIBSODIUM) override_dh_strip: dh_strip --dbg-package=dnsdist-dbg -- 2.40.0