Source: pdns-recursor
Version: 4.0.1-1
Severity: important
Tags: patch

Hi,

pdns-recursor fails to compile on kFreeBSD[1][2] and Hurd [3].

The reason is that systemd does not exist on non-Linux OSes, so the
systemd detection fails.
Easy fix is to explicitly enable systemd on Linux, and explicitly
disable it elsewhere; patch attached for it.

[1] 
https://buildd.debian.org/status/fetch.php?pkg=pdns-recursor&arch=kfreebsd-amd64&ver=4.0.1-1&stamp=1469919095
[2] 
https://buildd.debian.org/status/fetch.php?pkg=pdns-recursor&arch=kfreebsd-i386&ver=4.0.1-1&stamp=1469919742
[3] 
https://buildd.debian.org/status/fetch.php?pkg=pdns-recursor&arch=hurd-i386&ver=4.0.1-1&stamp=1469923683

Thanks,
-- 
Pino
--- a/debian/control
+++ b/debian/control
@@ -16,7 +16,7 @@ Build-Depends: autoconf,
                liblua5.2-dev,
                libprotobuf-dev,
                libssl-dev,
-               libsystemd-dev,
+               libsystemd-dev [linux-any],
                pkg-config,
                protobuf-compiler
 Vcs-Git: https://anonscm.debian.org/git/pkg-dns/pdns-recursor.git
--- a/debian/rules
+++ b/debian/rules
@@ -14,6 +14,14 @@ CXXFLAGS += -DPACKAGEVERSION='"$(version
 # for atomic support on mips(el)
 LDFLAGS += -latomic
 
+DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
+
+ifeq ($(DEB_HOST_ARCH_OS),linux)
+CONFIGURE_ARGS += --enable-systemd --with-systemd=/lib/systemd/system
+else
+CONFIGURE_ARGS += --disable-systemd
+endif
+
 # Use new build system
 %:
 	dh $@ \
@@ -27,7 +35,7 @@ override_dh_auto_configure:
 		--enable-reproducible \
 		--with-lua \
 		--with-protobuf=yes \
-		--enable-systemd --with-systemd=/lib/systemd/system
+		$(CONFIGURE_ARGS)
 
 override_dh_auto_install:
 	dh_auto_install

Reply via email to