]> git.ipfire.org Git - thirdparty/pdns.git/blame - builder-support/specs/pdns.spec
Add missing specfiles (thanks global gitignore!)
[thirdparty/pdns.git] / builder-support / specs / pdns.spec
CommitLineData
968e651b
PL
1%if 0%{?rhel} < 6
2exit 1
3%endif
4
5# Only works on EL7
6%global _hardened_build 1
7%global backends %{nil}
8
9Name: pdns
10Version: %{getenv:BUILDER_VERSION}
11Release: %{getenv:BUILDER_RELEASE}%{dist}
12Summary: A modern, advanced and high performance authoritative-only nameserver
13Group: System Environment/Daemons
14License: GPLv2
15URL: https://powerdns.com
16Source0: %{name}-%{version}.tar.bz2
17%if 0%{?rhel} < 7
18Source1: pdns.init
19%endif
20
21%if 0%{?rhel} >= 7
22Requires(post): systemd-sysv
23Requires(post): systemd-units
24Requires(preun): systemd-units
25Requires(postun): systemd-units
26BuildRequires: systemd-units
27BuildRequires: systemd-devel
28
29BuildRequires: protobuf-devel
30BuildRequires: protobuf-compiler
31BuildRequires: p11-kit-devel
32%endif
33
34Requires(pre): shadow-utils
35BuildRequires: luajit-devel
36BuildRequires: boost-devel
37BuildRequires: libsodium-devel
38BuildRequires: bison
39BuildRequires: openssl-devel
40
41Provides: powerdns = %{version}-%{release}
42%global backends %{backends} bind
43
44%description
45The PowerDNS Nameserver is a modern, advanced and high performance
46authoritative-only nameserver. It is written from scratch and conforms
47to all relevant DNS standards documents.
48Furthermore, PowerDNS interfaces with almost any database.
49
50%package tools
51Summary: Extra tools for %{name}
52Group: System Environment/Daemons
53
54%description tools
55This package contains the extra tools for %{name}
56
57%package backend-mysql
58Summary: MySQL backend for %{name}
59Group: System Environment/Daemons
60Requires: %{name}%{?_isa} = %{version}-%{release}
61BuildRequires: mysql-devel
62%global backends %{backends} gmysql
63
64%description backend-mysql
65This package contains the gmysql backend for %{name}
66
67%package backend-postgresql
68Summary: PostgreSQL backend for %{name}
69Group: System Environment/Daemons
70Requires: %{name}%{?_isa} = %{version}-%{release}
71BuildRequires: postgresql-devel
72%global backends %{backends} gpgsql
73
74%description backend-postgresql
75This package contains the gpgsql backend for %{name}
76
77%package backend-pipe
78Summary: Pipe backend for %{name}
79Group: System Environment/Daemons
80Requires: %{name}%{?_isa} = %{version}-%{release}
81%global backends %{backends} pipe
82
83%description backend-pipe
84This package contains the pipe backend for %{name}
85
86%package backend-remote
87Summary: Remote backend for %{name}
88Group: System Environment/Daemons
89Requires: %{name}%{?_isa} = %{version}-%{release}
90%global backends %{backends} remote
91
92%description backend-remote
93This package contains the remote backend for %{name}
94
95%package backend-ldap
96Summary: LDAP backend for %{name}
97Group: System Environment/Daemons
98Requires: %{name}%{?_isa} = %{version}-%{release}
99BuildRequires: openldap-devel
100%global backends %{backends} ldap
101
102%description backend-ldap
103This package contains the LDAP backend for %{name}
104
105%package backend-lua
106Summary: Lua backend for %{name}
107Group: System Environment/Daemons
108Requires: %{name}%{?_isa} = %{version}-%{release}
109%global backends %{backends} lua
110
111%description backend-lua
112This package contains the lua backend for %{name}
113
114%package backend-sqlite
115Summary: SQLite backend for %{name}
116Group: System Environment/Daemons
117Requires: %{name}%{?_isa} = %{version}-%{release}
118BuildRequires: sqlite-devel
119%global backends %{backends} gsqlite3
120
121%description backend-sqlite
122This package contains the SQLite backend for %{name}
123
124%package backend-mydns
125Summary: MyDNS backend for %{name}
126Group: System Environment/Daemons
127Requires: %{name}%{?_isa} = %{version}-%{release}
128%global backends %{backends} mydns
129
130%description backend-mydns
131This package contains the MyDNS backend for %{name}
132
133%if 0%{?rhel} >= 7
134%package backend-odbc
135Summary: UnixODBC backend for %{name}
136Group: System Environment/Daemons
137Requires: %{name}%{?_isa} = %{version}-%{release}
138BuildRequires: unixODBC-devel
139%global backends %{backends} godbc
140
141%description backend-odbc
142This package contains the godbc backend for %{name}
143
144%package backend-geoip
145Summary: Geo backend for %{name}
146Group: System Environment/Daemons
147Requires: %{name}%{?_isa} = %{version}-%{release}
148BuildRequires: yaml-cpp-devel
149BuildRequires: geoip-devel
150%global backends %{backends} geoip
151
152%description backend-geoip
153This package contains the geoip backend for %{name}
154It allows different answers to DNS queries coming from different
155IP address ranges or based on the geoipgraphic location
156
157%package backend-tinydns
158Summary: TinyDNS backend for %{name}
159Group: System Environment/Daemons
160Requires: %{name}%{?_isa} = %{version}-%{release}
161BuildRequires: tinycdb-devel
162%global backends %{backends} tinydns
163
164%description backend-tinydns
165This package contains the TinyDNS backend for %{name}
166%endif
167
168%prep
169%setup -q -n %{name}-%{version}
170
171%build
172export CPPFLAGS="-DLDAP_DEPRECATED"
173
174%configure \
175 --sysconfdir=%{_sysconfdir}/%{name} \
176 --disable-static \
177 --disable-dependency-tracking \
178 --disable-silent-rules \
179 --with-modules='' \
180 --with-luajit \
181 --with-dynmodules='%{backends} random' \
182 --enable-tools \
183 --enable-libsodium \
184 --enable-unit-tests \
185%if 0%{?rhel} >= 7
186 --enable-experimental-pkcs11 \
187 --enable-systemd
188%else
189 --without-protobuf
190%endif
191
192
193make %{?_smp_mflags}
194
195%install
196make install DESTDIR=%{buildroot}
197
198%{__rm} -f %{buildroot}%{_libdir}/%{name}/*.la
199%{__rm} -rf %{buildroot}%{_docdir}
200
201%if 0%{?rhel} == 6
202%{__install} -D -p %{SOURCE1} %{buildroot}%{_initrddir}/pdns
203%endif
204
205%{buildroot}/usr/sbin/pdns_server --no-config --config | sed \
206 -e 's!# daemon=.*!daemon=no!' \
207 -e 's!# guardian=.*!guardian=no!' \
208 -e 's!# launch=.*!&\\nlaunch=!' \
209 -e 's!# setgid=.*!setgid=pdns!' \
210 -e 's!# setuid=.*!setuid=pdns!' \
211 > %{buildroot}%{_sysconfdir}/%{name}/pdns.conf
212%{__rm} %{buildroot}%{_sysconfdir}/%{name}/pdns.conf-dist
213%{__rm} %{buildroot}/usr/bin/stubquery
214
215chmod 600 %{buildroot}%{_sysconfdir}/%{name}/pdns.conf
216
217%if 0%{?rhel} >= 7
218# rename zone2ldap to pdns-zone2ldap (#1193116)
219%{__mv} %{buildroot}/%{_bindir}/zone2ldap %{buildroot}/%{_bindir}/pdns-zone2ldap
220%{__mv} %{buildroot}/%{_mandir}/man1/zone2ldap.1 %{buildroot}/%{_mandir}/man1/pdns-zone2ldap.1
221%endif
222
223%check
224PDNS_TEST_NO_IPV6=1 make %{?_smp_mflags} -C pdns check || (cat pdns/test-suite.log && false)
225
226%pre
227getent group pdns >/dev/null || groupadd -r pdns
228getent passwd pdns >/dev/null || \
229 useradd -r -g pdns -d / -s /sbin/nologin \
230 -c "PowerDNS user" pdns
231exit 0
232
233%post
234%if 0%{?rhel} >= 7
235%systemd_post pdns.service
236%else
237/sbin/chkconfig --add pdns
238%endif
239
240%preun
241%if 0%{?rhel} >= 7
242%systemd_preun pdns.service
243%else
244if [ \$1 -eq 0 ]; then
245 /sbin/service pdns stop >/dev/null 2>&1 || :
246 /sbin/chkconfig --del pdns
247fi
248%endif
249
250%postun
251%if 0%{?rhel} >= 7
252%systemd_postun_with_restart pdns.service
253%else
254if [ \$1 -ge 1 ]; then
255 /sbin/service pdns condrestart >/dev/null 2>&1 || :
256fi
257%endif
258
259%files
260%doc COPYING README
261%{_bindir}/pdns_control
262%{_bindir}/pdnsutil
263%{_bindir}/zone2sql
264%{_bindir}/zone2json
265%{_sbindir}/pdns_server
266%{_libdir}/%{name}/libbindbackend.so
267%{_mandir}/man1/pdns_control.1.gz
268%{_mandir}/man1/pdns_server.1.gz
269%{_mandir}/man1/zone2sql.1.gz
270%{_mandir}/man1/zone2json.1.gz
271%{_mandir}/man1/pdnsutil.1.gz
272%dir %{_libdir}/%{name}/
273%{_libdir}/%{name}/librandombackend.so
274%dir %{_sysconfdir}/%{name}/
275%config(noreplace) %{_sysconfdir}/%{name}/pdns.conf
276
277%if 0%{?rhel} >= 7
278%{_bindir}/pdns-zone2ldap
279%{_mandir}/man1/pdns-zone2ldap.1.gz
280%{_unitdir}/pdns.service
281%{_unitdir}/pdns@.service
282%else
283%{_bindir}/zone2ldap
284%{_mandir}/man1/zone2ldap.1.gz
285%{_initrddir}/pdns
286%endif
287
288%files tools
289%{_bindir}/calidns
290%{_bindir}/dnsgram
291%{_bindir}/dnsreplay
292%{_bindir}/dnsscan
293%{_bindir}/dnsscope
294%{_bindir}/dnswasher
295%{_bindir}/dumresp
296%{_bindir}/ixplore
297%{_bindir}/pdns_notify
298%{_bindir}/nproxy
299%{_bindir}/nsec3dig
300%{_bindir}/saxfr
301%{_bindir}/sdig
302%{_mandir}/man1/calidns.1.gz
303%{_mandir}/man1/dnsgram.1.gz
304%{_mandir}/man1/dnsreplay.1.gz
305%{_mandir}/man1/dnsscan.1.gz
306%{_mandir}/man1/dnsscope.1.gz
307%{_mandir}/man1/dnswasher.1.gz
308%{_mandir}/man1/dumresp.1.gz
309%{_mandir}/man1/ixplore.1.gz
310%{_mandir}/man1/pdns_notify.1.gz
311%{_mandir}/man1/nproxy.1.gz
312%{_mandir}/man1/nsec3dig.1.gz
313%{_mandir}/man1/saxfr.1.gz
314%{_mandir}/man1/sdig.1.gz
315%if 0%{?rhel} >= 7
316%{_bindir}/dnsbulktest
317%{_bindir}/dnspcap2protobuf
318%{_bindir}/dnstcpbench
319%{_mandir}/man1/dnsbulktest.1.gz
320%{_mandir}/man1/dnspcap2protobuf.1.gz
321%{_mandir}/man1/dnstcpbench.1.gz
322%endif
323
324%files backend-mysql
325%doc modules/gmysqlbackend/schema.mysql.sql
326%doc modules/gmysqlbackend/dnssec-3.x_to_3.4.0_schema.mysql.sql
327%doc modules/gmysqlbackend/nodnssec-3.x_to_3.4.0_schema.mysql.sql
328%{_libdir}/%{name}/libgmysqlbackend.so
329
330%files backend-postgresql
331%doc modules/gpgsqlbackend/schema.pgsql.sql
332%doc modules/gpgsqlbackend/dnssec-3.x_to_3.4.0_schema.pgsql.sql
333%doc modules/gpgsqlbackend/nodnssec-3.x_to_3.4.0_schema.pgsql.sql
334%{_libdir}/%{name}/libgpgsqlbackend.so
335
336%files backend-pipe
337%{_libdir}/%{name}/libpipebackend.so
338
339%files backend-remote
340%{_libdir}/%{name}/libremotebackend.so
341
342%files backend-ldap
343%{_libdir}/%{name}/libldapbackend.so
344
345%doc modules/ldapbackend/dnsdomain2.schema
346%doc modules/ldapbackend/pdns-domaininfo.schema
347
348%files backend-lua
349%{_libdir}/%{name}/libluabackend.so
350
351%files backend-sqlite
352%doc modules/gsqlite3backend/schema.sqlite3.sql
353%doc modules/gsqlite3backend/dnssec-3.x_to_3.4.0_schema.sqlite3.sql
354%doc modules/gsqlite3backend/nodnssec-3.x_to_3.4.0_schema.sqlite3.sql
355%{_libdir}/%{name}/libgsqlite3backend.so
356
357%files backend-mydns
358%doc modules/mydnsbackend/schema.mydns.sql
359%{_libdir}/%{name}/libmydnsbackend.so
360
361%if 0%{?rhel} >= 7
362%files backend-odbc
363%doc modules/godbcbackend/schema.mssql.sql
364%{_libdir}/%{name}/libgodbcbackend.so
365
366%files backend-geoip
367%{_libdir}/%{name}/libgeoipbackend.so
368
369%files backend-tinydns
370%{_libdir}/%{name}/libtinydnsbackend.so
371%endif