]> git.ipfire.org Git - thirdparty/pdns.git/blame - builder-support/specs/pdns-recursor.spec
configure: with-libsodium
[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
23e7e4b3
PD
19%ifarch aarch64
20BuildRequires: lua-devel
7838d044 21%define lua_implementation lua
23e7e4b3 22%else
9d52f503 23BuildRequires: luajit-devel
7838d044 24%define lua_implementation luajit
23e7e4b3 25%endif
9d52f503
PL
26BuildRequires: systemd
27BuildRequires: systemd-devel
28%endif
29
9d52f503
PL
30%ifarch ppc64 ppc64le
31BuildRequires: libatomic
32%endif
33
f3e49553 34%if 0%{?rhel} >= 7
9d52f503
PL
35BuildRequires: protobuf-compiler
36BuildRequires: protobuf-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 \
66 --sysconfdir=%{_sysconfdir}/%{name} \
cb264691 67 --with-libsodium \
9d52f503
PL
68 --with-netsnmp \
69 --disable-silent-rules \
70 --disable-static \
71 --enable-unit-tests \
72%if 0%{?rhel} == 6
f3e49553 73 --without-protobuf \
9d52f503
PL
74 --with-boost=/usr/include/boost148 LIBRARY_PATH=/usr/lib64/boost148
75
76make %{?_smp_mflags} LIBRARY_PATH=/usr/lib64/boost148
23e7e4b3 77%else
f3e49553 78 --with-protobuf \
7838d044 79 --with-lua=%{lua_implementation} \
9d52f503
PL
80 --enable-systemd --with-systemd=%{_unitdir}
81
82make %{?_smp_mflags}
83%endif
84
85%check
86make %{?_smp_mflags} check || (cat test-suite.log && false)
87
88%install
89make install DESTDIR=%{buildroot}
90
91%{__mv} %{buildroot}%{_sysconfdir}/%{name}/recursor.conf{-dist,}
92
93%if 0%{?rhel} == 6
94%{__install} -D -p %{SOURCE1} %{buildroot}%{_initrddir}/pdns-recursor
95%endif
96
97# change user and group to pdns-recursor
98sed -i \
99 -e 's/# setuid=/setuid=pdns-recursor/' \
100 -e 's/# setgid=/setgid=pdns-recursor/' \
101 %{buildroot}%{_sysconfdir}/%{name}/recursor.conf
102
103%pre
104getent group pdns-recursor > /dev/null || groupadd -r pdns-recursor
105getent passwd pdns-recursor > /dev/null || \
106 useradd -r -g pdns-recursor -d / -s /sbin/nologin \
107 -c "PowerDNS Recursor user" pdns-recursor
108exit 0
109
110%post
111%if 0%{?rhel} == 6
112chkconfig --add %{name}
113%else
114%systemd_post %{name}.service
115%endif
116
117%preun
118%if 0%{?rhel} == 6
119if [ $1 -eq 0 ]; then
120 service %{name} stop >/dev/null 2>&1 || :
121 chkconfig --del %{name}
122fi
123%else
124%systemd_preun %{name}.service
125%endif
126
127%if 0%{?rhel} == 6
128%postun
129if [ $1 -ge 1 ]; then
130 service %{name} condrestart >/dev/null 2>&1 || :
131fi
132%else
133%postun
134%systemd_postun_with_restart pdns-recursor.service
135%endif
136
137%files
138%{_bindir}/rec_control
139%{_sbindir}/pdns_recursor
140%{_mandir}/man1/pdns_recursor.1.gz
141%{_mandir}/man1/rec_control.1.gz
142%if 0%{?rhel} == 6
143%{_initrddir}/pdns-recursor
144%else
145%{_unitdir}/pdns-recursor.service
146%{_unitdir}/pdns-recursor@.service
147%endif
148%dir %{_sysconfdir}/%{name}
149%config(noreplace) %{_sysconfdir}/%{name}/recursor.conf
150%doc README