+++ /dev/null
-#!/bin/bash
-#
-# pdns-recursor This shell script controls the PowerDNS Recursor
-#
-# Author: Ruben Kerkhof <ruben@rubenkerkhof.com>
-#
-# chkconfig: - 49 51
-#
-# description: PowerDNS Recursor is a non authoritative/recursing DNS server
-# processname: pdns-recursor
-# config: /etc/pdns-recursor/recursor.conf
-# pidfile: /var/run/pdns-recursor/pdns_recursor.pid
-#
-
-# . function library
-. /etc/rc.d/init.d/functions
-
-RETVAL=0
-
-PIDDIR=$(awk -F= '/^socket-dir=/ {print $2}' /etc/pdns-recursor/recursor.conf)
-if [ -z "$PIDDIR" ]; then PIDDIR=/var/run/pdns-recursor; mkdir -p $PIDDIR; fi
-
-start() {
- echo -n $"Starting pdns-recursor: "
- daemon /usr/sbin/pdns_recursor --daemon 2>/dev/null
- RETVAL=$?
- echo
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pdns-recursor
-}
-
-stop() {
- echo -n $"Stopping pdns-recursor: "
- killproc pdns_recursor
- echo
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/pdns-recursor && rm -f $PIDDIR/pdns_recursor.controlsocket
-}
-
-restart() {
- stop
- start
-}
-
-case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- restart|force-reload|reload)
- restart
- ;;
- condrestart)
- [ -f /var/lock/subsys/pdns-recursor ] && restart
- ;;
- status)
- status pdns_recursor
- RETVAL=$?
- ;;
- *)
- echo "Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
- exit 1
-esac
-
-exit $RETVAL
License: GPLv2
URL: https://powerdns.com
Source0: %{name}-%{getenv:BUILDER_VERSION}.tar.bz2
-%if 0%{?rhel} == 6
-Source1: pdns-recursor.init
-%endif
Provides: powerdns-recursor = %{version}-%{release}
-%if 0%{?rhel} == 6
-BuildRequires: boost148-devel
-BuildRequires: lua-devel
-%else
+
BuildRequires: boost-devel
BuildRequires: libcap-devel
+BuildRequires: systemd
+BuildRequires: systemd-devel
+BuildRequires: protobuf-compiler
+BuildRequires: protobuf-devel
+BuildRequires: openssl-devel
+BuildRequires: net-snmp-devel
+BuildRequires: libsodium-devel
+
%ifarch aarch64
BuildRequires: lua-devel
%define lua_implementation lua
BuildRequires: luajit-devel
%define lua_implementation luajit
%endif
-BuildRequires: systemd
-BuildRequires: systemd-devel
-%endif
%ifarch ppc64 ppc64le
BuildRequires: libatomic
BuildRequires: fstrm-devel
%endif
-BuildRequires: openssl-devel
-BuildRequires: net-snmp-devel
-BuildRequires: libsodium-devel
-
Requires(pre): shadow-utils
-%if 0%{?rhel} == 6
-Requires(post): /sbin/chkconfig
-Requires(preun): /sbin/service, /sbin/chkconfig
-Requires(postun): /sbin/service
-%else
%systemd_requires
-%endif
%description
PowerDNS Recursor is a non authoritative/recursing DNS server. Use this
%prep
-%if 0%{?rhel} == 6
-%setup -n %{name}-%{getenv:BUILDER_VERSION}
-%else
%autosetup -p1 -n %{name}-%{getenv:BUILDER_VERSION}
-%endif
%build
%configure \
--disable-silent-rules \
--disable-static \
--enable-unit-tests \
-%if 0%{?rhel} == 6
- --with-boost=/usr/include/boost148 LIBRARY_PATH=/usr/lib64/boost148 \
- CPPFLAGS=-D__STDC_FORMAT_MACROS
-
-make %{?_smp_mflags} LIBRARY_PATH=/usr/lib64/boost148
-%else
--enable-dnstap \
--with-libcap \
--with-lua=%{lua_implementation} \
--enable-systemd --with-systemd=%{_unitdir}
make %{?_smp_mflags}
-%endif
%check
make %{?_smp_mflags} check || (cat test-suite.log && false)
%{__mv} %{buildroot}%{_sysconfdir}/%{name}/recursor.conf{-dist,}
-%if 0%{?rhel} == 6
-%{__install} -D -p %{SOURCE1} %{buildroot}%{_initrddir}/pdns-recursor
-%endif
-
# change user and group to pdns-recursor
sed -i \
-e 's/# setuid=/setuid=pdns-recursor/' \
exit 0
%post
-%if 0%{?rhel} == 6
-chkconfig --add %{name}
-%else
systemctl daemon-reload ||:
%systemd_post %{name}.service
-%endif
%preun
-%if 0%{?rhel} == 6
-if [ $1 -eq 0 ]; then
- service %{name} stop >/dev/null 2>&1 || :
- chkconfig --del %{name}
-fi
-%else
%systemd_preun %{name}.service
-%endif
-%if 0%{?rhel} == 6
-%postun
-if [ $1 -ge 1 ]; then
- service %{name} condrestart >/dev/null 2>&1 || :
-fi
-%else
%postun
%systemd_postun_with_restart pdns-recursor.service
-%endif
%files
%{_bindir}/rec_control
%{_sbindir}/pdns_recursor
%{_mandir}/man1/pdns_recursor.1.gz
%{_mandir}/man1/rec_control.1.gz
-%if 0%{?rhel} == 6
-%{_initrddir}/pdns-recursor
-%else
%{_unitdir}/pdns-recursor.service
%{_unitdir}/pdns-recursor@.service
-%endif
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/recursor.conf
%doc README