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