]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - builder-support/specs/pdns-recursor.spec
Introduce structured YAML settings for Recursor.
[thirdparty/pdns.git] / builder-support / specs / pdns-recursor.spec
index 812cb5329db5d2dc58246f2ccc540c6c7c8492d8..8408500e98a8c4ef8ed4a6134e4331be20a5b85e 100644 (file)
@@ -9,14 +9,22 @@ Source0: %{name}-%{getenv:BUILDER_VERSION}.tar.bz2
 
 Provides: powerdns-recursor = %{version}-%{release}
 
+%if 0%{?rhel} < 8 && 0%{?amzn} != 2023
+BuildRequires: boost169-devel
+%else
 BuildRequires: boost-devel
+%endif
 BuildRequires: libcap-devel
 BuildRequires: systemd
 BuildRequires: systemd-devel
 BuildRequires: openssl-devel
+BuildRequires: fstrm-devel
+BuildRequires: libcurl-devel
+
+%if 0%{?amzn} != 2023
 BuildRequires: net-snmp-devel
 BuildRequires: libsodium-devel
-BuildRequires: fstrm-devel
+%endif
 
 %ifarch aarch64
 BuildRequires: lua-devel
@@ -39,14 +47,17 @@ package if you need a dns cache for your network.
 
 
 %prep
-%autosetup -p1 -n %{name}-%{getenv:BUILDER_VERSION} 
+%autosetup -p1 -n %{name}-%{getenv:BUILDER_VERSION}
 
 %build
+%if 0%{?rhel} < 8
+export CPPFLAGS=-I/usr/include/boost169
+export LDFLAGS=-L/usr/lib64/boost169
+%endif
+
 %configure \
     --enable-option-checking=fatal \
     --sysconfdir=%{_sysconfdir}/%{name} \
-    --with-libsodium \
-    --with-net-snmp \
     --disable-silent-rules \
     --disable-static \
     --enable-unit-tests \
@@ -54,7 +65,12 @@ package if you need a dns cache for your network.
     --enable-dnstap \
     --with-libcap \
     --with-lua=%{lua_implementation} \
-    --enable-systemd --with-systemd=%{_unitdir}
+%if 0%{?amzn} != 2023
+    --with-libsodium \
+    --with-net-snmp \
+%endif
+    --enable-systemd --with-systemd=%{_unitdir} \
+    --enable-nod
 
 make %{?_smp_mflags}
 
@@ -65,13 +81,23 @@ make %{?_smp_mflags} check || (cat test-suite.log && false)
 make install DESTDIR=%{buildroot}
 
 %{__mv} %{buildroot}%{_sysconfdir}/%{name}/recursor.conf{-dist,}
+%{__mkdir} %{buildroot}%{_sysconfdir}/%{name}/recursor.d
 
-# change user and group to pdns-recursor
+# change user and group to pdns-recursor and add default include-dir
 sed -i \
     -e 's/# setuid=/setuid=pdns-recursor/' \
     -e 's/# setgid=/setgid=pdns-recursor/' \
+    -e 's!# include-dir=.*!&\ninclude-dir=%{_sysconfdir}/%{name}/recursor.d!' \
     %{buildroot}%{_sysconfdir}/%{name}/recursor.conf
 
+# 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
+%if 0%{?rhel} < 9
+sed -e 's!/pdns_recursor!& --socket-dir=%t/pdns-recursor!' -i %{buildroot}/%{_unitdir}/pdns-recursor.service
+%if 0%{?rhel} < 8
+sed -e 's!/pdns_recursor!& --socket-dir=%t/pdns-recursor-%i!' -e 's!RuntimeDirectory=pdns-recursor!&-%i!' -i %{buildroot}/%{_unitdir}/pdns-recursor@.service
+%endif
+%endif
+
 %pre
 getent group pdns-recursor > /dev/null || groupadd -r pdns-recursor
 getent passwd pdns-recursor > /dev/null || \
@@ -97,5 +123,7 @@ systemctl daemon-reload ||:
 %{_unitdir}/pdns-recursor.service
 %{_unitdir}/pdns-recursor@.service
 %dir %{_sysconfdir}/%{name}
+%dir %{_sysconfdir}/%{name}/recursor.d
 %config(noreplace) %{_sysconfdir}/%{name}/recursor.conf
+%config %{_sysconfdir}/%{name}/recursor.yml-dist
 %doc README