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