]> granicus.if.org Git - pdns/commitdiff
Build dnsdist packages for Ubuntu Trusty
authorPieter Lexis <pieter.lexis@powerdns.com>
Wed, 14 Oct 2015 10:40:51 +0000 (12:40 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Wed, 14 Oct 2015 14:37:00 +0000 (16:37 +0200)
* Don't link against libsodium in ubuntu 14.04
* Add upstart file for Ubuntu

build-scripts/build-dnsdist-debian
build-scripts/debian-dnsdist/control.in [moved from build-scripts/debian-dnsdist/control with 92% similarity]
build-scripts/debian-dnsdist/dnsdist.upstart [new file with mode: 0644]
build-scripts/debian-dnsdist/rules

index bb325af348ea29ee1a65c57b780b4b33d933fc8a..ce1593b4ea7b7e1cae079337463a3abebfdf3587 100755 (executable)
@@ -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
similarity index 92%
rename from build-scripts/debian-dnsdist/control
rename to build-scripts/debian-dnsdist/control.in
index d33506f32811e561f9b722bc0ab31c994d93007a..60631796142c45bfb70af9c84d403d27810b8eaa 100644 (file)
@@ -3,7 +3,7 @@ Section: net
 Priority: optional
 Maintainer: PowerDNS Autobuilder <powerdns.support@powerdns.com>
 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 (file)
index 0000000..191dab2
--- /dev/null
@@ -0,0 +1,9 @@
+description "dnsdist - A powerful DNS loadbalancer"
+
+start on runlevel [2345]
+stop on runlevel [!2345]
+
+author "Pieter Lexis <pieter.lexis@powerdns.com>"
+
+# Keep the --supervised option when modifying this
+exec /usr/bin/dnsdist --supervised -l 127.0.0.1
index c30d9c154272fd96ff08982a18625d1b78068363..7aedb0e1b8c9aa4c1e3d672578759d6dcbcdfd7e 100755 (executable)
@@ -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