From: Pieter Lexis Date: Tue, 16 Aug 2016 12:57:01 +0000 (+0200) Subject: dnsdist: build pkgs with dnscrypt and re2 support X-Git-Tag: rec-4.0.2~16^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F4325%2Fhead;p=thirdparty%2Fpdns.git dnsdist: build pkgs with dnscrypt and re2 support Only for distros where libsodium and libre2 are recent enough. --- diff --git a/build-scripts/build-dnsdist-rpm b/build-scripts/build-dnsdist-rpm index cf73f9bea7..ef7fb850cb 100755 --- a/build-scripts/build-dnsdist-rpm +++ b/build-scripts/build-dnsdist-rpm @@ -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 diff --git a/build-scripts/debian-dnsdist/control.in b/build-scripts/debian-dnsdist/control.in index e4e727a52a..9b015f0dbd 100644 --- a/build-scripts/debian-dnsdist/control.in +++ 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-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 diff --git a/build-scripts/debian-dnsdist/rules b/build-scripts/debian-dnsdist/rules index bc245f8435..07bfd180c0 100755 --- a/build-scripts/debian-dnsdist/rules +++ b/build-scripts/debian-dnsdist/rules @@ -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: