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