]> git.ipfire.org Git - thirdparty/pdns.git/blame - builder-support/specs/pdns.spec
auth: Remove trailing tab in builder-support/specs/pdns.spec
[thirdparty/pdns.git] / builder-support / specs / pdns.spec
CommitLineData
968e651b
PL
1%global _hardened_build 1
2%global backends %{nil}
3
4Name: pdns
8ceb365e
PL
5Version: %{getenv:BUILDER_RPM_VERSION}
6Release: %{getenv:BUILDER_RPM_RELEASE}%{dist}
968e651b
PL
7Summary: A modern, advanced and high performance authoritative-only nameserver
8Group: System Environment/Daemons
9License: GPLv2
10URL: https://powerdns.com
8ceb365e 11Source0: %{name}-%{getenv:BUILDER_VERSION}.tar.bz2
968e651b 12
4a3fe2fc
GP
13Requires(post): systemd
14Requires(preun): systemd
15Requires(postun): systemd
b4d8324b 16BuildRequires: systemd
968e651b
PL
17BuildRequires: systemd-units
18BuildRequires: systemd-devel
19
4728ab89 20BuildRequires: krb5-devel
968e651b 21BuildRequires: p11-kit-devel
17477d10 22BuildRequires: libcurl-devel
6dac9c74 23%if 0%{?rhel} < 8 && 0%{?amzn} != 2023
6f7f89d9
PD
24BuildRequires: boost169-devel
25%else
38affa7f 26BuildRequires: boost-devel
6f7f89d9 27%endif
bce81446
PL
28BuildRequires: bison
29BuildRequires: openssl-devel
968e651b 30
6dac9c74
PD
31%if 0%{?amzn} != 2023
32BuildRequires: libsodium-devel
33%endif
34
968e651b 35Requires(pre): shadow-utils
bce81446 36
60ebc45e
PD
37%ifarch aarch64
38BuildRequires: lua-devel
92aa72d1 39%define lua_implementation lua
60ebc45e 40%else
968e651b 41BuildRequires: luajit-devel
92aa72d1 42%define lua_implementation luajit
60ebc45e 43%endif
968e651b
PL
44
45Provides: powerdns = %{version}-%{release}
46%global backends %{backends} bind
47
48%description
49The PowerDNS Nameserver is a modern, advanced and high performance
50authoritative-only nameserver. It is written from scratch and conforms
51to all relevant DNS standards documents.
52Furthermore, PowerDNS interfaces with almost any database.
53
54%package tools
55Summary: Extra tools for %{name}
56Group: System Environment/Daemons
57
58%description tools
59This package contains the extra tools for %{name}
60
61%package backend-mysql
62Summary: MySQL backend for %{name}
63Group: System Environment/Daemons
64Requires: %{name}%{?_isa} = %{version}-%{release}
6dac9c74 65%if 0%{?rhel} < 8 && 0%{?amzn} != 2023
968e651b 66BuildRequires: mysql-devel
fd0a94e9
PL
67%else
68BuildRequires: mariadb-connector-c-devel
69%endif
968e651b
PL
70%global backends %{backends} gmysql
71
72%description backend-mysql
73This package contains the gmysql backend for %{name}
74
75%package backend-postgresql
76Summary: PostgreSQL backend for %{name}
77Group: System Environment/Daemons
78Requires: %{name}%{?_isa} = %{version}-%{release}
79BuildRequires: postgresql-devel
80%global backends %{backends} gpgsql
81
82%description backend-postgresql
83This package contains the gpgsql backend for %{name}
84
85%package backend-pipe
86Summary: Pipe backend for %{name}
87Group: System Environment/Daemons
88Requires: %{name}%{?_isa} = %{version}-%{release}
89%global backends %{backends} pipe
90
91%description backend-pipe
92This package contains the pipe backend for %{name}
93
94%package backend-remote
95Summary: Remote backend for %{name}
96Group: System Environment/Daemons
97Requires: %{name}%{?_isa} = %{version}-%{release}
98%global backends %{backends} remote
99
100%description backend-remote
101This package contains the remote backend for %{name}
102
103%package backend-ldap
104Summary: LDAP backend for %{name}
105Group: System Environment/Daemons
106Requires: %{name}%{?_isa} = %{version}-%{release}
107BuildRequires: openldap-devel
108%global backends %{backends} ldap
109
110%description backend-ldap
111This package contains the LDAP backend for %{name}
112
578ed45d
PL
113%package backend-lua2
114Summary: Lua backend for %{name}
115Group: System Environment/Daemons
116Requires: %{name}%{?_isa} = %{version}-%{release}
117%global backends %{backends} lua2
118
119%description backend-lua2
120This package contains the lua2 backend for %{name}
121
968e651b
PL
122%package backend-sqlite
123Summary: SQLite backend for %{name}
124Group: System Environment/Daemons
125Requires: %{name}%{?_isa} = %{version}-%{release}
126BuildRequires: sqlite-devel
127%global backends %{backends} gsqlite3
128
129%description backend-sqlite
130This package contains the SQLite backend for %{name}
131
968e651b
PL
132%package backend-odbc
133Summary: UnixODBC backend for %{name}
134Group: System Environment/Daemons
135Requires: %{name}%{?_isa} = %{version}-%{release}
136BuildRequires: unixODBC-devel
137%global backends %{backends} godbc
138
139%description backend-odbc
140This package contains the godbc backend for %{name}
141
142%package backend-geoip
143Summary: Geo backend for %{name}
144Group: System Environment/Daemons
145Requires: %{name}%{?_isa} = %{version}-%{release}
146BuildRequires: yaml-cpp-devel
6dac9c74 147%if 0%{?rhel} < 9 && 0%{?amzn} != 2023
968e651b 148BuildRequires: geoip-devel
4728ab89 149%endif
c7e6c74d 150BuildRequires: libmaxminddb-devel
968e651b
PL
151%global backends %{backends} geoip
152
153%description backend-geoip
154This package contains the geoip backend for %{name}
155It allows different answers to DNS queries coming from different
156IP address ranges or based on the geoipgraphic location
157
d0d9195b
PL
158%package backend-lmdb
159Summary: LMDB backend for %{name}
160Group: System Environment/Daemons
161Requires: %{name}%{?_isa} = %{version}-%{release}
162BuildRequires: lmdb-devel
163%global backends %{backends} lmdb
164
165%description backend-lmdb
166This package contains the lmdb backend for %{name}
167
968e651b
PL
168%package backend-tinydns
169Summary: TinyDNS backend for %{name}
170Group: System Environment/Daemons
171Requires: %{name}%{?_isa} = %{version}-%{release}
172BuildRequires: tinycdb-devel
173%global backends %{backends} tinydns
174
175%description backend-tinydns
176This package contains the TinyDNS backend for %{name}
17477d10 177
d72871c6 178%if 0%{?amzn} != 2
17477d10
PL
179%package ixfrdist
180BuildRequires: yaml-cpp-devel
a71347a9 181Summary: A program to redistribute zones over AXFR and IXFR
17477d10
PL
182Group: System Environment/Daemons
183
184%description ixfrdist
185This package contains the ixfrdist program.
d72871c6 186%endif
968e651b
PL
187
188%prep
c7e6c74d 189%autosetup -p1 -n %{name}-%{getenv:BUILDER_VERSION}
968e651b
PL
190
191%build
192export CPPFLAGS="-DLDAP_DEPRECATED"
193
6f7f89d9
PD
194%if 0%{?rhel} < 8
195export CPPFLAGS=-I/usr/include/boost169
196export LDFLAGS=-L/usr/lib64/boost169
197%endif
198
968e651b 199%configure \
e5d38a0f 200 --enable-option-checking=fatal \
968e651b
PL
201 --sysconfdir=%{_sysconfdir}/%{name} \
202 --disable-static \
203 --disable-dependency-tracking \
204 --disable-silent-rules \
205 --with-modules='' \
92aa72d1 206 --with-lua=%{lua_implementation} \
9a205757 207 --with-dynmodules='%{backends}' \
968e651b 208 --enable-tools \
6dac9c74 209%if 0%{?amzn} != 2023
cb264691 210 --with-libsodium \
6dac9c74 211%endif
d72871c6
PD
212%if 0%{?amzn} != 2
213 --enable-ixfrdist \
214%endif
968e651b 215 --enable-unit-tests \
17477d10 216 --enable-lua-records \
968e651b 217 --enable-experimental-pkcs11 \
c70977c9 218 --enable-dns-over-tls \
d72871c6 219 --enable-systemd
968e651b 220
968e651b
PL
221make %{?_smp_mflags}
222
223%install
224make install DESTDIR=%{buildroot}
225
226%{__rm} -f %{buildroot}%{_libdir}/%{name}/*.la
227%{__rm} -rf %{buildroot}%{_docdir}
228
c3892519 229%{buildroot}/usr/sbin/pdns_server --config=default | sed \
968e651b
PL
230 -e 's!# daemon=.*!daemon=no!' \
231 -e 's!# guardian=.*!guardian=no!' \
232 -e 's!# launch=.*!&\\nlaunch=!' \
233 -e 's!# setgid=.*!setgid=pdns!' \
234 -e 's!# setuid=.*!setuid=pdns!' \
235 > %{buildroot}%{_sysconfdir}/%{name}/pdns.conf
236%{__rm} %{buildroot}%{_sysconfdir}/%{name}/pdns.conf-dist
237%{__rm} %{buildroot}/usr/bin/stubquery
238
239chmod 600 %{buildroot}%{_sysconfdir}/%{name}/pdns.conf
240
968e651b
PL
241# rename zone2ldap to pdns-zone2ldap (#1193116)
242%{__mv} %{buildroot}/%{_bindir}/zone2ldap %{buildroot}/%{_bindir}/pdns-zone2ldap
243%{__mv} %{buildroot}/%{_mandir}/man1/zone2ldap.1 %{buildroot}/%{_mandir}/man1/pdns-zone2ldap.1
968e651b 244
fac31e76
MS
245%{__install } -d %{buildroot}/%{_sharedstatedir}/%{name}
246
42bc9fae
O
247# The EL7 and 8 systemd actually supports %t, but its version number is older than that, so we do use seperate runtime dirs, but don't rely on RUNTIME_DIRECTORY
248%if 0%{?rhel} < 9
249sed -e 's!/pdns_server!& --socket-dir=%t/pdns!' -i %{buildroot}/%{_unitdir}/pdns.service
250%if 0%{?rhel} < 8
251sed -e 's!/pdns_server!& --socket-dir=%t/pdns-%i!' -e 's!RuntimeDirectory=pdns!&-%i!' -i %{buildroot}/%{_unitdir}/pdns@.service
252%endif
253%endif
254
968e651b
PL
255%check
256PDNS_TEST_NO_IPV6=1 make %{?_smp_mflags} -C pdns check || (cat pdns/test-suite.log && false)
64229532 257
968e651b
PL
258%pre
259getent group pdns >/dev/null || groupadd -r pdns
260getent passwd pdns >/dev/null || \
fac31e76
MS
261 useradd -r -g pdns -d /var/lib/pdns -s /sbin/nologin \
262 -c "PowerDNS Authoritative Server" pdns
263# Change home directory to /var/lib/pdns
264if [[ $(getent passwd pdns | cut -d: -f6) == "/" ]]; then
265 usermod -d /var/lib/pdns pdns
266fi
968e651b
PL
267exit 0
268
593eb1e6
PL
269%if 0%{?rhel} >= 7
270if [ "`stat -c '%U:%G' %{_sysconfdir}/%{name}`" = "root:root" ]; then
271 chown -R root:pdns /etc/powerdns
272 # Make sure that pdns can read it; the default used to be 0600
273 chmod g+r /etc/powerdns/pdns.conf
274fi
275chown -R pdns:pdns /var/lib/powerdns || :
276%endif
277
968e651b 278%post
b5179dca 279systemctl daemon-reload ||:
968e651b 280%systemd_post pdns.service
968e651b
PL
281
282%preun
968e651b 283%systemd_preun pdns.service
968e651b
PL
284
285%postun
968e651b 286%systemd_postun_with_restart pdns.service
968e651b
PL
287
288%files
bce81446 289%doc COPYING README
41d10782 290%doc pdns/bind-dnssec.4.2.0_to_4.3.0_schema.sqlite3.sql pdns/bind-dnssec.schema.sqlite3.sql
bce81446
PL
291%config(noreplace) %{_sysconfdir}/%{name}/pdns.conf
292%dir %{_libdir}/%{name}/
fac31e76 293%dir %attr(-,pdns,pdns) %{_sharedstatedir}/%{name}
bce81446 294%{_bindir}/pdns-zone2ldap
968e651b
PL
295%{_bindir}/pdns_control
296%{_bindir}/pdnsutil
968e651b 297%{_bindir}/zone2json
bce81446 298%{_bindir}/zone2sql
968e651b 299%{_libdir}/%{name}/libbindbackend.so
bce81446 300%{_mandir}/man1/pdns-zone2ldap.1.gz
968e651b
PL
301%{_mandir}/man1/pdns_control.1.gz
302%{_mandir}/man1/pdns_server.1.gz
968e651b 303%{_mandir}/man1/pdnsutil.1.gz
bce81446
PL
304%{_mandir}/man1/zone2json.1.gz
305%{_mandir}/man1/zone2sql.1.gz
306%{_sbindir}/pdns_server
968e651b
PL
307%{_unitdir}/pdns.service
308%{_unitdir}/pdns@.service
968e651b
PL
309
310%files tools
311%{_bindir}/calidns
bce81446 312%{_bindir}/dnsbulktest
968e651b 313%{_bindir}/dnsgram
bce81446
PL
314%{_bindir}/dnspcap2calidns
315%{_bindir}/dnspcap2protobuf
968e651b
PL
316%{_bindir}/dnsreplay
317%{_bindir}/dnsscan
318%{_bindir}/dnsscope
bce81446 319%{_bindir}/dnstcpbench
968e651b
PL
320%{_bindir}/dnswasher
321%{_bindir}/dumresp
322%{_bindir}/ixplore
968e651b
PL
323%{_bindir}/nproxy
324%{_bindir}/nsec3dig
bce81446 325%{_bindir}/pdns_notify
968e651b
PL
326%{_bindir}/saxfr
327%{_bindir}/sdig
328%{_mandir}/man1/calidns.1.gz
bce81446 329%{_mandir}/man1/dnsbulktest.1.gz
968e651b 330%{_mandir}/man1/dnsgram.1.gz
bce81446
PL
331%{_mandir}/man1/dnspcap2calidns.1.gz
332%{_mandir}/man1/dnspcap2protobuf.1.gz
968e651b
PL
333%{_mandir}/man1/dnsreplay.1.gz
334%{_mandir}/man1/dnsscan.1.gz
335%{_mandir}/man1/dnsscope.1.gz
bce81446 336%{_mandir}/man1/dnstcpbench.1.gz
968e651b
PL
337%{_mandir}/man1/dnswasher.1.gz
338%{_mandir}/man1/dumresp.1.gz
339%{_mandir}/man1/ixplore.1.gz
968e651b
PL
340%{_mandir}/man1/nproxy.1.gz
341%{_mandir}/man1/nsec3dig.1.gz
bce81446 342%{_mandir}/man1/pdns_notify.1.gz
968e651b
PL
343%{_mandir}/man1/saxfr.1.gz
344%{_mandir}/man1/sdig.1.gz
3e862940 345
968e651b
PL
346%files backend-mysql
347%doc modules/gmysqlbackend/schema.mysql.sql
348%doc modules/gmysqlbackend/dnssec-3.x_to_3.4.0_schema.mysql.sql
349%doc modules/gmysqlbackend/nodnssec-3.x_to_3.4.0_schema.mysql.sql
ce5b05d9
MN
350%doc modules/gmysqlbackend/3.4.0_to_4.1.0_schema.mysql.sql
351%doc modules/gmysqlbackend/4.1.0_to_4.2.0_schema.mysql.sql
352%doc modules/gmysqlbackend/4.2.0_to_4.3.0_schema.mysql.sql
20ad6428 353%doc modules/gmysqlbackend/4.3.0_to_4.7.0_schema.mysql.sql
96d5d109 354%doc modules/gmysqlbackend/enable-foreign-keys.mysql.sql
968e651b
PL
355%{_libdir}/%{name}/libgmysqlbackend.so
356
357%files backend-postgresql
358%doc modules/gpgsqlbackend/schema.pgsql.sql
359%doc modules/gpgsqlbackend/dnssec-3.x_to_3.4.0_schema.pgsql.sql
360%doc modules/gpgsqlbackend/nodnssec-3.x_to_3.4.0_schema.pgsql.sql
ce5b05d9
MN
361%doc modules/gpgsqlbackend/3.4.0_to_4.1.0_schema.pgsql.sql
362%doc modules/gpgsqlbackend/4.1.0_to_4.2.0_schema.pgsql.sql
363%doc modules/gpgsqlbackend/4.2.0_to_4.3.0_schema.pgsql.sql
20ad6428 364%doc modules/gpgsqlbackend/4.3.0_to_4.7.0_schema.pgsql.sql
968e651b
PL
365%{_libdir}/%{name}/libgpgsqlbackend.so
366
367%files backend-pipe
368%{_libdir}/%{name}/libpipebackend.so
369
370%files backend-remote
371%{_libdir}/%{name}/libremotebackend.so
372
373%files backend-ldap
374%{_libdir}/%{name}/libldapbackend.so
375
376%doc modules/ldapbackend/dnsdomain2.schema
377%doc modules/ldapbackend/pdns-domaininfo.schema
378
578ed45d
PL
379%files backend-lua2
380%{_libdir}/%{name}/liblua2backend.so
381
968e651b
PL
382%files backend-sqlite
383%doc modules/gsqlite3backend/schema.sqlite3.sql
384%doc modules/gsqlite3backend/dnssec-3.x_to_3.4.0_schema.sqlite3.sql
385%doc modules/gsqlite3backend/nodnssec-3.x_to_3.4.0_schema.sqlite3.sql
ce5b05d9
MN
386%doc modules/gsqlite3backend/3.4.0_to_4.0.0_schema.sqlite3.sql
387%doc modules/gsqlite3backend/4.0.0_to_4.2.0_schema.sqlite3.sql
388%doc modules/gsqlite3backend/4.2.0_to_4.3.0_schema.sqlite3.sql
7c9d0206 389%doc modules/gsqlite3backend/4.3.0_to_4.3.1_schema.sqlite3.sql
20ad6428 390%doc modules/gsqlite3backend/4.3.1_to_4.7.0_schema.sqlite3.sql
968e651b
PL
391%{_libdir}/%{name}/libgsqlite3backend.so
392
968e651b
PL
393%files backend-odbc
394%doc modules/godbcbackend/schema.mssql.sql
ce5b05d9
MN
395%doc modules/godbcbackend/4.0.0_to_4.2.0_schema.mssql.sql
396%doc modules/godbcbackend/4.2.0_to_4.3.0_schema.mssql.sql
20ad6428 397%doc modules/godbcbackend/4.3.0_to_4.7.0_schema.mssql.sql
968e651b
PL
398%{_libdir}/%{name}/libgodbcbackend.so
399
400%files backend-geoip
401%{_libdir}/%{name}/libgeoipbackend.so
402
d0d9195b
PL
403%files backend-lmdb
404%{_libdir}/%{name}/liblmdbbackend.so
405
968e651b
PL
406%files backend-tinydns
407%{_libdir}/%{name}/libtinydnsbackend.so
17477d10 408
d72871c6 409%if 0%{?amzn} != 2
17477d10
PL
410%files ixfrdist
411%{_bindir}/ixfrdist
412%{_mandir}/man1/ixfrdist.1.gz
413%{_mandir}/man5/ixfrdist.yml.5.gz
414%{_sysconfdir}/%{name}/ixfrdist.example.yml
415%{_unitdir}/ixfrdist.service
416%{_unitdir}/ixfrdist@.service
42bc9fae 417%endif