]> git.ipfire.org Git - thirdparty/pdns.git/blame - builder-support/specs/pdns-recursor.spec
Remove left-over protobuf from build files, CI, documentation
[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%if 0%{?rhel} == 6
10Source1: pdns-recursor.init
11%endif
12
13Provides: powerdns-recursor = %{version}-%{release}
14%if 0%{?rhel} == 6
15BuildRequires: boost148-devel
16BuildRequires: lua-devel
17%else
18BuildRequires: boost-devel
88301a04 19BuildRequires: libcap-devel
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
PL
27BuildRequires: systemd
28BuildRequires: systemd-devel
29%endif
30
9d52f503
PL
31%ifarch ppc64 ppc64le
32BuildRequires: libatomic
33%endif
34
f3e49553 35%if 0%{?rhel} >= 7
e593a398 36BuildRequires: fstrm-devel
f3e49553
PD
37%endif
38
39BuildRequires: openssl-devel
40BuildRequires: net-snmp-devel
9d52f503
PL
41BuildRequires: libsodium-devel
42
43Requires(pre): shadow-utils
44%if 0%{?rhel} == 6
45Requires(post): /sbin/chkconfig
46Requires(preun): /sbin/service, /sbin/chkconfig
47Requires(postun): /sbin/service
48%else
49%systemd_requires
50%endif
51
52%description
53PowerDNS Recursor is a non authoritative/recursing DNS server. Use this
54package if you need a dns cache for your network.
55
56
57%prep
58%if 0%{?rhel} == 6
8ceb365e 59%setup -n %{name}-%{getenv:BUILDER_VERSION}
9d52f503 60%else
8ceb365e 61%autosetup -p1 -n %{name}-%{getenv:BUILDER_VERSION}
9d52f503
PL
62%endif
63
64%build
65%configure \
e5d38a0f 66 --enable-option-checking=fatal \
9d52f503 67 --sysconfdir=%{_sysconfdir}/%{name} \
cb264691 68 --with-libsodium \
bdbd3e3c 69 --with-net-snmp \
9d52f503
PL
70 --disable-silent-rules \
71 --disable-static \
72 --enable-unit-tests \
73%if 0%{?rhel} == 6
7c2ed3ce
PD
74 --with-boost=/usr/include/boost148 LIBRARY_PATH=/usr/lib64/boost148 \
75 CPPFLAGS=-D__STDC_FORMAT_MACROS
9d52f503
PL
76
77make %{?_smp_mflags} LIBRARY_PATH=/usr/lib64/boost148
23e7e4b3 78%else
d9707e17 79 --enable-dnstap \
88301a04 80 --with-libcap \
7838d044 81 --with-lua=%{lua_implementation} \
9d52f503
PL
82 --enable-systemd --with-systemd=%{_unitdir}
83
84make %{?_smp_mflags}
85%endif
86
87%check
88make %{?_smp_mflags} check || (cat test-suite.log && false)
89
90%install
91make install DESTDIR=%{buildroot}
92
93%{__mv} %{buildroot}%{_sysconfdir}/%{name}/recursor.conf{-dist,}
94
95%if 0%{?rhel} == 6
96%{__install} -D -p %{SOURCE1} %{buildroot}%{_initrddir}/pdns-recursor
97%endif
98
99# change user and group to pdns-recursor
100sed -i \
101 -e 's/# setuid=/setuid=pdns-recursor/' \
102 -e 's/# setgid=/setgid=pdns-recursor/' \
103 %{buildroot}%{_sysconfdir}/%{name}/recursor.conf
104
105%pre
106getent group pdns-recursor > /dev/null || groupadd -r pdns-recursor
107getent passwd pdns-recursor > /dev/null || \
108 useradd -r -g pdns-recursor -d / -s /sbin/nologin \
109 -c "PowerDNS Recursor user" pdns-recursor
110exit 0
111
112%post
113%if 0%{?rhel} == 6
114chkconfig --add %{name}
115%else
b5179dca 116systemctl daemon-reload ||:
9d52f503
PL
117%systemd_post %{name}.service
118%endif
119
120%preun
121%if 0%{?rhel} == 6
122if [ $1 -eq 0 ]; then
123 service %{name} stop >/dev/null 2>&1 || :
124 chkconfig --del %{name}
125fi
126%else
127%systemd_preun %{name}.service
128%endif
129
130%if 0%{?rhel} == 6
131%postun
132if [ $1 -ge 1 ]; then
133 service %{name} condrestart >/dev/null 2>&1 || :
134fi
135%else
136%postun
137%systemd_postun_with_restart pdns-recursor.service
138%endif
139
140%files
141%{_bindir}/rec_control
142%{_sbindir}/pdns_recursor
143%{_mandir}/man1/pdns_recursor.1.gz
144%{_mandir}/man1/rec_control.1.gz
145%if 0%{?rhel} == 6
146%{_initrddir}/pdns-recursor
147%else
148%{_unitdir}/pdns-recursor.service
149%{_unitdir}/pdns-recursor@.service
150%endif
151%dir %{_sysconfdir}/%{name}
152%config(noreplace) %{_sysconfdir}/%{name}/recursor.conf
153%doc README