]> git.ipfire.org Git - thirdparty/pdns.git/blob - builder-support/specs/pdns-recursor.spec
We need libcurl dev lib for the zone-to-cache function.
[thirdparty/pdns.git] / builder-support / specs / pdns-recursor.spec
1 Name: pdns-recursor
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
6 License: GPLv2
7 URL: https://powerdns.com
8 Source0: %{name}-%{getenv:BUILDER_VERSION}.tar.bz2
9
10 Provides: powerdns-recursor = %{version}-%{release}
11
12 BuildRequires: boost-devel
13 BuildRequires: libcap-devel
14 BuildRequires: systemd
15 BuildRequires: systemd-devel
16 BuildRequires: openssl-devel
17 BuildRequires: net-snmp-devel
18 BuildRequires: libsodium-devel
19 BuildRequires: fstrm-devel
20 BuildRequires: libcurl-devel
21
22 %ifarch aarch64
23 BuildRequires: lua-devel
24 %define lua_implementation lua
25 %else
26 BuildRequires: luajit-devel
27 %define lua_implementation luajit
28 %endif
29
30 %ifarch ppc64 ppc64le
31 BuildRequires: libatomic
32 %endif
33
34 Requires(pre): shadow-utils
35 %systemd_requires
36
37 %description
38 PowerDNS Recursor is a non authoritative/recursing DNS server. Use this
39 package if you need a dns cache for your network.
40
41
42 %prep
43 %autosetup -p1 -n %{name}-%{getenv:BUILDER_VERSION}
44
45 %build
46 %configure \
47 --enable-option-checking=fatal \
48 --sysconfdir=%{_sysconfdir}/%{name} \
49 --with-libsodium \
50 --with-net-snmp \
51 --disable-silent-rules \
52 --disable-static \
53 --enable-unit-tests \
54 --enable-dns-over-tls \
55 --enable-dnstap \
56 --with-libcap \
57 --with-lua=%{lua_implementation} \
58 --enable-systemd --with-systemd=%{_unitdir}
59
60 make %{?_smp_mflags}
61
62 %check
63 make %{?_smp_mflags} check || (cat test-suite.log && false)
64
65 %install
66 make install DESTDIR=%{buildroot}
67
68 %{__mv} %{buildroot}%{_sysconfdir}/%{name}/recursor.conf{-dist,}
69
70 # change user and group to pdns-recursor
71 sed -i \
72 -e 's/# setuid=/setuid=pdns-recursor/' \
73 -e 's/# setgid=/setgid=pdns-recursor/' \
74 %{buildroot}%{_sysconfdir}/%{name}/recursor.conf
75
76 %pre
77 getent group pdns-recursor > /dev/null || groupadd -r pdns-recursor
78 getent passwd pdns-recursor > /dev/null || \
79 useradd -r -g pdns-recursor -d / -s /sbin/nologin \
80 -c "PowerDNS Recursor user" pdns-recursor
81 exit 0
82
83 %post
84 systemctl daemon-reload ||:
85 %systemd_post %{name}.service
86
87 %preun
88 %systemd_preun %{name}.service
89
90 %postun
91 %systemd_postun_with_restart pdns-recursor.service
92
93 %files
94 %{_bindir}/rec_control
95 %{_sbindir}/pdns_recursor
96 %{_mandir}/man1/pdns_recursor.1.gz
97 %{_mandir}/man1/rec_control.1.gz
98 %{_unitdir}/pdns-recursor.service
99 %{_unitdir}/pdns-recursor@.service
100 %dir %{_sysconfdir}/%{name}
101 %config(noreplace) %{_sysconfdir}/%{name}/recursor.conf
102 %doc README