]> granicus.if.org Git - pdns/commitdiff
dnsdist: build pkgs with dnscrypt and re2 support
authorPieter Lexis <pieter.lexis@powerdns.com>
Tue, 16 Aug 2016 12:57:01 +0000 (14:57 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Fri, 19 Aug 2016 07:47:11 +0000 (09:47 +0200)
Only for distros where libsodium and libre2 are recent enough.

build-scripts/build-dnsdist-rpm
build-scripts/debian-dnsdist/control.in
build-scripts/debian-dnsdist/rules

index cf73f9bea7e026c485e996f51a709dbed56aa3d8..ef7fb850cbf92b295f23af5b1285f6c68b0f87cf 100755 (executable)
@@ -34,10 +34,6 @@ else
 fi
 
 
-# libsodium is not available on all RPM platforms (like CentOS 7)
-SODIUM_BUILDREQUIRES=''
-SODIUM_CONFIGURE=''
-
 # Some RPM platforms use systemd, others sysv, we default to systemd here
 INIT_BUILDREQUIRES='BuildRequires: systemd-devel'
 INIT_INSTALL='sed -i "s,/^\(ExecStart.*\)dnsdist\(.*\)\$,\1dnsdist -u dnsdist -g dnsdist\2," %{buildroot}/lib/systemd/system/dnsdist.service'
@@ -47,6 +43,11 @@ INIT_CONFIGURE='--enable-systemd --with-systemd=/lib/systemd/system \'
 # CentOS 6 has protobuf, but not a modern enough boost. We defaul to with protobuf
 PROTOBUF_CONFIGURE='--with-protobuf \'
 
+# CentOS 6 has a libsodium, but we use more modern functions
+SODIUM_BUILDREQUIRES='BuildRequires: libsodium-devel'
+SODIUM_CONFIGURE='--enable-libsodium \'
+DNSCRYPT_CONFIGURE='--enable-dnscrypt \'
+
 # These two are the same for sysv and systemd (we don't install defaults files at the moment)
 DEFAULTS_INSTALL=''
 DEFAULTS_FILES=''
@@ -60,16 +61,15 @@ RPMBUILD_COMMAND='rpmbuild -bb dnsdist.spec'
 if [ -f /etc/redhat-release ]; then
   OS="$(cat /etc/redhat-release)"
   case "$OS" in
-    Fedora\ *\ 21*)
-      SODIUM_BUILDREQUIRES='BuildRequires: libsodium-devel'
-      SODIUM_CONFIGURE='--enable-libsodium'
-      ;;
     CentOS\ *\ 6*)
       INIT_BUILDREQUIRES=''
       INIT_INSTALL='install -d -m 755 %{buildroot}/%{_initrddir} && install -m 755 contrib/dnsdist.init.centos6 %{buildroot}/%{_initrddir}/dnsdist'
       INIT_FILES='%{_initrddir}/dnsdist'
       INIT_CONFIGURE='\'
       PROTOBUF_CONFIGURE='--without-protobuf \'
+      SODIUM_BUILDREQUIRES=''
+      SODIUM_CONFIGURE='--disable-libsodium \'
+      DNSCRYPT_CONFIGURE='--disable-dnscrypt \'
       SETUP="%setup -n %{name}-${TARBALLVERSION}"
       RPMBUILD_COMMAND="scl enable devtoolset-3 -- ${RPMBUILD_COMMAND}"
       ;;
@@ -93,11 +93,12 @@ Vendor: PowerDNS.COM BV
 Group: System/DNS
 Source: dnsdist-${TARBALLVERSION}.tar.bz2
 Requires(pre): shadow-utils
-BuildRequires: readline-devel
 BuildRequires: boost-devel
 BuildRequires: lua-devel
-BuildRequires: protobuf-devel
 BuildRequires: protobuf-compiler
+BuildRequires: protobuf-devel
+BuildRequires: re2-devel
+BuildRequires: readline-devel
 ${SODIUM_BUILDREQUIRES}
 ${INIT_BUILDREQUIRES}
 
@@ -110,9 +111,11 @@ ${SETUP}
 %build
 %configure \
   --sysconfdir=/etc/dnsdist \
+  --enable-re2 \
+  ${SODIUM_CONFIGURE}
+  ${DNSCRYPT_CONFIGURE}
   ${INIT_CONFIGURE}
   ${PROTOBUF_CONFIGURE}
-  ${SODIUM_CONFIGURE}
 
 make
 
index e4e727a52aa8540623eca490feaef24d58c1325a..9b015f0dbdcbbcb173ba6afd7b61fe2bf49ad4e9 100644 (file)
@@ -3,7 +3,7 @@ Section: net
 Priority: optional
 Maintainer: PowerDNS Autobuilder <powerdns.support@powerdns.com>
 Origin: PowerDNS
-Build-Depends: debhelper (>= 9), dh-autoreconf, dh-systemd (>= 1.5), libboost-dev, libedit-dev, liblua5.2-dev, protobuf-compiler, libprotobuf-def, pkg-config @LIBSODIUMDEV@ @LIBSYSTEMDDEV@
+Build-Depends: debhelper (>= 9), dh-autoreconf, dh-systemd (>= 1.5), libboost-dev, libedit-dev, liblua5.2-dev, protobuf-compiler, libprotobuf-def, pkg-config @LIBRE2DEV@ @LIBSODIUMDEV@ @LIBSYSTEMDDEV@
 Standards-Version: 3.9.7
 Homepage: http://dnsdist.org
 
index bc245f8435da2161e06a7232256bc1ab8bb9ce89..07bfd180c0cc4dac1393865aed3c837f901a685b 100755 (executable)
@@ -7,13 +7,16 @@
 DPKG_EXPORT_BUILDFLAGS = 1
 include /usr/share/dpkg/default.mk
 
-ENABLE_LIBSODIUM := --enable-libsodium
+ENABLE_LIBSODIUM := --enable-libsodium --enable-dnscrypt
 LIBSODIUM_DEV := , libsodium-dev
 
 ENABLE_SYSTEMD := --enable-systemd --with-systemd=/lib/systemd/system
 LIBSYSTEMD_DEV := , libsystemd-dev
 DEBHELPER_WITH_SYSTEMD := --with systemd
 
+ENABLE_RE2 := --enable-re2
+LIBRE2_DEV := , libre2-dev
+
 # $(ID) and $(VERSION_ID) come from the environment, source this from /etc/os-release
 ifeq ($(ID), ubuntu)
   ifeq ($(VERSION_ID), 14.04)
@@ -23,12 +26,15 @@ ifeq ($(ID), ubuntu)
     LIBSYSTEMD_DEV=
     LIBSODIUM_DEV=
     DEBHELPER_WITH_SYSTEMD=
+    ENABLE_RE2=
+    LIBRE2_DEV=
   endif
 endif
 
 debian/control: debian/control.in
        sed -e "s!@LIBSODIUMDEV@!$(LIBSODIUM_DEV)!" \
-           -e "s!@LIBSYSTEMDDEV@!$(LIBSYSTEMD_DEV)!" $< > $@
+           -e "s!@LIBSYSTEMDDEV@!$(LIBSYSTEMD_DEV)!" \
+           -e "s!@LIBRE2DEV@!$(LIBRE2_DEV)!" $< > $@
 
 %:
        dh $@ \
@@ -48,6 +54,7 @@ override_dh_auto_configure:
          --libexecdir='$${prefix}/lib' \
          --with-protobuf=yes \
          $(ENABLE_SYSTEMD) \
+         $(ENABLE_RE2) \
          $(ENABLE_LIBSODIUM)
 
 override_dh_auto_build-arch: