2 Version: %{getenv:BUILDER_RPM_VERSION}
3 Release: %{getenv:BUILDER_RPM_RELEASE}%{?dist}
4 Summary: Modern
, advanced and high performance recursing
/non authoritative name server
5 Group: System Environment
/Daemons
7 URL: https
://powerdns.com
8 Source0: %{name}-%{getenv:BUILDER_VERSION}.tar.bz2
10 Provides: powerdns
-recursor
= %{version}-%{release}
12 %if 0%{?rhel} < 8 && 0%{?amzn} != 2023
13 BuildRequires
: boost169
-devel
15 BuildRequires
: boost
-devel
17 BuildRequires
: libcap
-devel
18 BuildRequires
: systemd
19 BuildRequires
: systemd
-devel
20 BuildRequires
: openssl
-devel
21 BuildRequires
: fstrm
-devel
22 BuildRequires
: libcurl
-devel
25 BuildRequires
: net
-snmp
-devel
26 BuildRequires
: libsodium
-devel
30 BuildRequires
: lua
-devel
31 %define lua_implementation lua
33 BuildRequires
: luajit
-devel
34 %define lua_implementation luajit
38 BuildRequires
: libatomic
41 Requires(pre
): shadow
-utils
45 PowerDNS Recursor is a non authoritative
/recursing DNS server. Use this
46 package
if you need a dns cache
for your network.
50 %autosetup -p1
-n
%{name}-%{getenv:BUILDER_VERSION}
54 export CPPFLAGS
=-I
/usr
/include
/boost169
55 export LDFLAGS
=-L
/usr
/lib64
/boost169
59 --enable-option
-checking
=fatal \
60 --sysconfdir
=%{_sysconfdir}/%{name} \
61 --disable
-silent
-rules \
64 --enable-dns
-over
-tls \
67 --with
-lua
=%{lua_implementation} \
72 --enable-systemd
--with
-systemd
=%{_unitdir} \
78 make %{?_smp_mflags} check ||
(cat
test-suite.log
&& false
)
81 make install DESTDIR
=%{buildroot}
83 %{__mv} %{buildroot}%{_sysconfdir}/%{name}/recursor.conf{-dist,}
84 %{__mkdir} %{buildroot}%{_sysconfdir}/%{name}/recursor.d
86 # change user and group to pdns-recursor and add default include-dir
88 -e 's
/# setuid=/setuid=pdns-recursor/' \
89 -e 's
/# setgid=/setgid=pdns-recursor/' \
90 -e 's
!# include-dir=.*!&\ninclude-dir=%{_sysconfdir}/%{name}/recursor.d!' \
91 %{buildroot}%{_sysconfdir}/%{name}/recursor.conf
93 # The EL7 and 8 systemd actually supports %t, but its version number is older than that, so we do use seperate runtime dirs, but don't rely on RUNTIME_DIRECTORY
95 sed
-e 's
!/pdns_recursor
!& --socket
-dir
=%t/pdns
-recursor
!'
-i
%{buildroot}/%{_unitdir}/pdns
-recursor.service
97 sed
-e 's
!/pdns_recursor
!& --socket
-dir
=%t/pdns
-recursor
-%i!'
-e 's
!RuntimeDirectory
=pdns
-recursor
!&-%i!'
-i
%{buildroot}/%{_unitdir}/pdns
-recursor@.service
102 getent group pdns
-recursor
> /dev
/null || groupadd
-r pdns
-recursor
103 getent passwd pdns
-recursor
> /dev
/null || \
104 useradd
-r
-g pdns
-recursor
-d
/ -s
/sbin
/nologin \
105 -c "PowerDNS Recursor user" pdns
-recursor
109 systemctl daemon
-reload ||
:
110 %systemd_post %{name}.service
113 %systemd_preun %{name}.service
116 %systemd_postun_with_restart pdns
-recursor.service
119 %{_bindir}/rec_control
120 %{_sbindir}/pdns_recursor
121 %{_mandir}/man1
/pdns_recursor
.1.gz
122 %{_mandir}/man1
/rec_control
.1.gz
123 %{_unitdir}/pdns
-recursor.service
124 %{_unitdir}/pdns
-recursor@.service
125 %dir %{_sysconfdir}/%{name}
126 %dir %{_sysconfdir}/%{name}/recursor.d
127 %config(noreplace
) %{_sysconfdir}/%{name}/recursor.conf