2 # - warning: Installed (but unpackaged) file(s) found:
3 # /etc/pdns/pdns.conf-dist
4 # - do not use 'djbdns' group!
5 Summary: PowerDNS - a Versatile Database Driven Nameserver
6 Summary(pl.UTF-8): PowerDNS - wielofunkcyjny serwer nazw korzystający z relacyjnych baz danych
11 Group: Networking/Daemons
12 Source0: https://downloads.powerdns.com/releases/%{name}-%{version}.tar.bz2
13 # Source0-md5: 59011d4337dc02d9b114918781f96bee
14 Source1: https://downloads.powerdns.com/documentation/%{name}.pdf
15 # Source1-md5: 15bdde9d84af6ef1485dc2f5fa3f81df
16 Source2: https://downloads.powerdns.com/documentation/%{name}.txt
19 Source5: %{name}.sysconfig
20 Patch0: %{name}-boost.patch
21 Patch1: %{name}-openldap-2.3.patch
23 URL: https://www.powerdns.com/
24 BuildRequires: autoconf >= 2.61
25 BuildRequires: automake >= 1:1.11
27 BuildRequires: boost-devel >= 1.35.0
29 BuildRequires: libpq++-devel
30 BuildRequires: libstdc++-devel >= 6:4.7
31 BuildRequires: libtool >= 2:2.2.2
32 BuildRequires: lua-devel >= 5.1
33 BuildRequires: mysql-devel
34 BuildRequires: openldap-devel >= 2.4.6
35 BuildRequires: openssl-devel
36 BuildRequires: pkgconfig
37 BuildRequires: polarssl-devel >= 1.1
38 BuildRequires: postgresql-devel
39 BuildRequires: protobuf-devel
40 BuildRequires: rpmbuild(macros) >= 1.647
41 BuildRequires: sed >= 4.0
42 BuildRequires: sqlite3-devel >= 3
43 BuildRequires: zlib-devel
44 Requires(post,preun,postun): systemd-units >= 38
45 Requires(post): sed >= 4.0
46 Requires(post,preun): /sbin/chkconfig
47 Requires(postun): /usr/sbin/groupdel
48 Requires(postun): /usr/sbin/userdel
49 Requires(pre): /bin/id
50 Requires(pre): /usr/bin/getgid
51 Requires(pre): /usr/sbin/groupadd
52 Requires(pre): /usr/sbin/useradd
54 Requires: systemd-units >= 0.38
55 Provides: group(djbdns)
59 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62 PowerDNS is a versatile nameserver which supports a large number of
63 different backends ranging from simple zonefiles to relational
64 databases and load balancing/failover algorithms.
66 %description -l pl.UTF-8
67 PowerDNS to wielofunkcyjny serwer nazw posiadający dużą liczbę wtyczek
68 od prostych stref (a'la BIND) począwszy, a na relacyjnych bazach
69 danych skończywszy oraz zawierający algorytmy zrównoważenia obciążenia
70 i przełączania w wypadku awarii.
73 Summary: PowerDNS support for custom pipe backend
74 Summary(pl.UTF-8): Obsługa własnego mechanizmu przechowywania stref dla PowerDNS-a
75 Group: Development/Libraries
76 Requires: %{name} = %{version}-%{release}
78 %description backend-pipe
79 This package allows creation of own backend using simple STDIN/STDOUT
80 API. Example backend script in Perl is provided in package
83 %description backend-pipe -l pl.UTF-8
84 Ten pakiet pozwala na utworzenie własnego mechanizmu przechowywania
85 stref za pomocą prostego interfejsu STDIN/STDOUT. Przykładowy skrypt w
86 Perlu został dołączony do dokumentacji pakietu.
88 %package backend-gpgsql
89 Summary: PowerDNS support for PostgreSQL
90 Summary(pl.UTF-8): Obsługa baz PostgreSQL dla PowerDNS-a
91 Group: Development/Libraries
92 Requires: %{name} = %{version}-%{release}
94 %description backend-gpgsql
95 This package allows zone storage in PostgreSQL relational db tables.
97 %description backend-gpgsql -l pl.UTF-8
98 Ten pakiet pozwala na przechowywanie danych o strefach w tabelach
99 relacyjnej bazy danych PostgreSQL.
101 %package backend-gmysql
102 Summary: PowerDNS support for MySQL
103 Summary(pl.UTF-8): Obsługa baz MySQL dla PowerDNS-a
104 Group: Development/Libraries
105 Requires: %{name} = %{version}-%{release}
107 %description backend-gmysql
108 This package allows zone storage in MySQL relational db tables.
110 %description backend-gmysql -l pl.UTF-8
111 Ten pakiet pozwala na przechowywanie danych o strefach w tabelach
112 relacyjnej bazy danych MySQL.
114 %package backend-gsqlite3
115 Summary: PowerDNS support for SQLite 3
116 Summary(pl.UTF-8): Obsługa baz SQLite 3 dla PowerDNS-a
117 Group: Development/Libraries
118 Requires: %{name} = %{version}-%{release}
120 %description backend-gsqlite3
121 This package allows zone storage in SQLite 3 relational db tables.
123 %description backend-gsqlite3 -l pl.UTF-8
124 Ten pakiet pozwala na przechowywanie danych o strefach w tabelach
125 relacyjnej bazy danych SQLite 3.
127 %package backend-ldap
128 Summary: PowerDNS support for LDAP
129 Summary(pl.UTF-8): Obsługa LDAP dla PowerDNS-a
130 Group: Development/Libraries
131 Requires: %{name} = %{version}-%{release}
133 %description backend-ldap
134 This package allows zone storage in LDAP directory.
136 %description backend-ldap -l pl.UTF-8
137 Ten pakiet pozwala na przechowywanie danych o strefach w katalogu
149 %if "%{_lib}" != "lib"
150 %{__sed} -i -e 's/module-dir=\/usr\/lib\/pdns/module-dir=\/usr\/%{_lib}\/pdns/' pdns.conf
154 CPPFLAGS="-DHAVE_NAMESPACE_STD -DHAVE_CXX_STRING_HEADER -DDLLIMPORT=\"\""
160 --sysconfdir=%{_sysconfdir}/%{name} \
161 --disable-silent-rules \
164 --with-dynmodules="gsqlite3 gmysql gpgsql pipe ldap" \
167 --with-mysql-includes=%{_includedir} \
168 --with-mysql-lib=%{_libdir} \
169 --with-pgsql-includes=%{_includedir} \
170 --with-pgsql-lib=%{_libdir} \
171 --with-socketdir=/var/run \
172 --with-system-polarssl \
173 --with-systemd=%{systemdunitdir}
178 rm -rf $RPM_BUILD_ROOT
179 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sysconfdir}/%{name},/etc/sysconfig}
182 DESTDIR=$RPM_BUILD_ROOT
184 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
185 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.conf
186 cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/pdns
188 # useless - modules are dlopened by *.so
189 %{__rm} -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.la
191 # we put that in using %doc
192 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
195 rm -rf $RPM_BUILD_ROOT
198 %groupadd -g 32 djbdns
199 %useradd -u 30 -d /var/lib/pdns -s /bin/false -c "pdns User" -g djbdns pdns
202 %systemd_post %{name}.service
203 # dirty hack so the config file is processed correctly, and server does not respawn
204 sed -i -e 's/^ *//' /etc/pdns/pdns.conf
206 /sbin/chkconfig --add pdns
207 %service pdns restart
210 if [ "$1" = "0" ]; then
212 /sbin/chkconfig --del pdns
214 %systemd_preun %{name}.service
217 if [ "$1" = "0" ]; then
224 %defattr(644,root,root,755)
225 %doc INSTALL README pdns.pdf pdns.txt
226 %attr(754,root,root) /etc/rc.d/init.d/pdns
227 %dir %{_sysconfdir}/%{name}
228 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.conf
229 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/pdns
230 %{systemdunitdir}/pdns.service
231 %{systemdunitdir}/pdns@.service
232 %attr(755,root,root) %{_sbindir}/pdns_server
233 %attr(755,root,root) %{_bindir}/calidns
234 %attr(755,root,root) %{_bindir}/dnsbulktest
235 %attr(755,root,root) %{_bindir}/dnsgram
236 %attr(755,root,root) %{_bindir}/dnspcap2calidns
237 %attr(755,root,root) %{_bindir}/dnspcap2protobuf
238 %attr(755,root,root) %{_bindir}/dnsreplay
239 %attr(755,root,root) %{_bindir}/dnsscan
240 %attr(755,root,root) %{_bindir}/dnsscope
241 %attr(755,root,root) %{_bindir}/dnstcpbench
242 %attr(755,root,root) %{_bindir}/dnswasher
243 %attr(755,root,root) %{_bindir}/dumresp
244 %attr(755,root,root) %{_bindir}/ixplore
245 %attr(755,root,root) %{_bindir}/nproxy
246 %attr(755,root,root) %{_bindir}/nsec3dig
247 %attr(755,root,root) %{_bindir}/pdns_control
248 %attr(755,root,root) %{_bindir}/pdns_notify
249 %attr(755,root,root) %{_bindir}/pdnsutil
250 %attr(755,root,root) %{_bindir}/saxfr
251 %attr(755,root,root) %{_bindir}/sdig
252 %attr(755,root,root) %{_bindir}/stubquery
253 %attr(755,root,root) %{_bindir}/zone2json
254 %attr(755,root,root) %{_bindir}/zone2ldap
255 %attr(755,root,root) %{_bindir}/zone2sql
256 %dir %{_libdir}/%{name}
257 %{_mandir}/man1/calidns.1*
258 %{_mandir}/man1/dnsbulktest.1*
259 %{_mandir}/man1/dnsgram.1*
260 %{_mandir}/man1/dnspcap2calidns.1*
261 %{_mandir}/man1/dnspcap2protobuf.1*
262 %{_mandir}/man1/dnsreplay.1*
263 %{_mandir}/man1/dnsscan.1*
264 %{_mandir}/man1/dnsscope.1*
265 %{_mandir}/man1/dnstcpbench.1*
266 %{_mandir}/man1/dnswasher.1*
267 %{_mandir}/man1/dumresp.1*
268 %{_mandir}/man1/ixplore.1*
269 %{_mandir}/man1/nproxy.1*
270 %{_mandir}/man1/nsec3dig.1*
271 %{_mandir}/man1/pdns_control.1*
272 %{_mandir}/man1/pdns_notify.1*
273 %{_mandir}/man1/pdns_server.1*
274 %{_mandir}/man1/pdnsutil.1*
275 %{_mandir}/man1/saxfr.1*
276 %{_mandir}/man1/sdig.1*
277 %{_mandir}/man1/zone2json.1*
278 %{_mandir}/man1/zone2ldap.1*
279 %{_mandir}/man1/zone2sql.1*
281 %files backend-gmysql
282 %defattr(644,root,root,755)
283 %doc modules/gmysqlbackend/*schema.mysql.sql
284 %attr(755,root,root) %{_libdir}/%{name}/*mysql*.so*
286 %files backend-gpgsql
287 %defattr(644,root,root,755)
288 %doc modules/gpgsqlbackend/*schema.pgsql.sql
289 %attr(755,root,root) %{_libdir}/%{name}/*pgsql*.so*
291 %files backend-gsqlite3
292 %defattr(644,root,root,755)
293 %doc modules/gsqlite3backend/*schema.sqlite3.sql
294 %attr(755,root,root) %{_libdir}/%{name}/*sqlite3*.so*
297 %defattr(644,root,root,755)
298 %attr(755,root,root) %{_libdir}/%{name}/*pipe*.so*
301 %defattr(644,root,root,755)
302 %attr(755,root,root) %{_libdir}/%{name}/*ldap*.so*