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
22 URL: https://www.powerdns.com/
23 BuildRequires: autoconf >= 2.61
24 BuildRequires: automake >= 1:1.11
26 BuildRequires: boost-devel >= 1.35.0
28 BuildRequires: libpq++-devel
29 BuildRequires: libstdc++-devel >= 6:4.7
30 BuildRequires: libtool >= 2:2.2.2
31 BuildRequires: lua-devel >= 5.1
32 BuildRequires: mysql-devel
33 BuildRequires: openldap-devel >= 2.4.6
34 BuildRequires: openssl-devel
35 BuildRequires: pkgconfig
36 BuildRequires: polarssl-devel >= 1.1
37 BuildRequires: postgresql-devel
38 BuildRequires: protobuf-devel
39 BuildRequires: rpmbuild(macros) >= 1.647
40 BuildRequires: sed >= 4.0
41 BuildRequires: sqlite3-devel >= 3
42 BuildRequires: zlib-devel
43 Requires(post,preun,postun): systemd-units >= 38
44 Requires(post): sed >= 4.0
45 Requires(post,preun): /sbin/chkconfig
46 Requires(postun): /usr/sbin/groupdel
47 Requires(postun): /usr/sbin/userdel
48 Requires(pre): /bin/id
49 Requires(pre): /usr/bin/getgid
50 Requires(pre): /usr/sbin/groupadd
51 Requires(pre): /usr/sbin/useradd
53 Requires: systemd-units >= 0.38
54 Provides: group(djbdns)
58 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
61 PowerDNS is a versatile nameserver which supports a large number of
62 different backends ranging from simple zonefiles to relational
63 databases and load balancing/failover algorithms.
65 %description -l pl.UTF-8
66 PowerDNS to wielofunkcyjny serwer nazw posiadający dużą liczbę wtyczek
67 od prostych stref (a'la BIND) począwszy, a na relacyjnych bazach
68 danych skończywszy oraz zawierający algorytmy zrównoważenia obciążenia
69 i przełączania w wypadku awarii.
72 Summary: PowerDNS support for custom pipe backend
73 Summary(pl.UTF-8): Obsługa własnego mechanizmu przechowywania stref dla PowerDNS-a
74 Group: Development/Libraries
75 Requires: %{name} = %{version}-%{release}
77 %description backend-pipe
78 This package allows creation of own backend using simple STDIN/STDOUT
79 API. Example backend script in Perl is provided in package
82 %description backend-pipe -l pl.UTF-8
83 Ten pakiet pozwala na utworzenie własnego mechanizmu przechowywania
84 stref za pomocą prostego interfejsu STDIN/STDOUT. Przykładowy skrypt w
85 Perlu został dołączony do dokumentacji pakietu.
87 %package backend-gpgsql
88 Summary: PowerDNS support for PostgreSQL
89 Summary(pl.UTF-8): Obsługa baz PostgreSQL dla PowerDNS-a
90 Group: Development/Libraries
91 Requires: %{name} = %{version}-%{release}
93 %description backend-gpgsql
94 This package allows zone storage in PostgreSQL relational db tables.
96 %description backend-gpgsql -l pl.UTF-8
97 Ten pakiet pozwala na przechowywanie danych o strefach w tabelach
98 relacyjnej bazy danych PostgreSQL.
100 %package backend-gmysql
101 Summary: PowerDNS support for MySQL
102 Summary(pl.UTF-8): Obsługa baz MySQL dla PowerDNS-a
103 Group: Development/Libraries
104 Requires: %{name} = %{version}-%{release}
106 %description backend-gmysql
107 This package allows zone storage in MySQL relational db tables.
109 %description backend-gmysql -l pl.UTF-8
110 Ten pakiet pozwala na przechowywanie danych o strefach w tabelach
111 relacyjnej bazy danych MySQL.
113 %package backend-gsqlite3
114 Summary: PowerDNS support for SQLite 3
115 Summary(pl.UTF-8): Obsługa baz SQLite 3 dla PowerDNS-a
116 Group: Development/Libraries
117 Requires: %{name} = %{version}-%{release}
119 %description backend-gsqlite3
120 This package allows zone storage in SQLite 3 relational db tables.
122 %description backend-gsqlite3 -l pl.UTF-8
123 Ten pakiet pozwala na przechowywanie danych o strefach w tabelach
124 relacyjnej bazy danych SQLite 3.
126 %package backend-ldap
127 Summary: PowerDNS support for LDAP
128 Summary(pl.UTF-8): Obsługa LDAP dla PowerDNS-a
129 Group: Development/Libraries
130 Requires: %{name} = %{version}-%{release}
132 %description backend-ldap
133 This package allows zone storage in LDAP directory.
135 %description backend-ldap -l pl.UTF-8
136 Ten pakiet pozwala na przechowywanie danych o strefach w katalogu
147 %if "%{_lib}" != "lib"
148 %{__sed} -i -e 's/module-dir=\/usr\/lib\/pdns/module-dir=\/usr\/%{_lib}\/pdns/' pdns.conf
152 CPPFLAGS="-DHAVE_NAMESPACE_STD -DHAVE_CXX_STRING_HEADER -DDLLIMPORT=\"\""
158 --sysconfdir=%{_sysconfdir}/%{name} \
159 --disable-silent-rules \
162 --with-dynmodules="gsqlite3 gmysql gpgsql pipe ldap" \
165 --with-mysql-includes=%{_includedir} \
166 --with-mysql-lib=%{_libdir} \
167 --with-pgsql-includes=%{_includedir} \
168 --with-pgsql-lib=%{_libdir} \
169 --with-socketdir=/var/run \
170 --with-system-polarssl \
171 --with-systemd=%{systemdunitdir}
176 rm -rf $RPM_BUILD_ROOT
177 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sysconfdir}/%{name},/etc/sysconfig}
180 DESTDIR=$RPM_BUILD_ROOT
182 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
183 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.conf
184 cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/pdns
186 # useless - modules are dlopened by *.so
187 %{__rm} -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.la
189 # we put that in using %doc
190 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
193 rm -rf $RPM_BUILD_ROOT
196 %groupadd -g 32 djbdns
197 %useradd -u 30 -d /var/lib/pdns -s /bin/false -c "pdns User" -g djbdns pdns
200 %systemd_post %{name}.service
201 # dirty hack so the config file is processed correctly, and server does not respawn
202 sed -i -e 's/^ *//' /etc/pdns/pdns.conf
204 /sbin/chkconfig --add pdns
205 %service pdns restart
208 if [ "$1" = "0" ]; then
210 /sbin/chkconfig --del pdns
212 %systemd_preun %{name}.service
215 if [ "$1" = "0" ]; then
222 %defattr(644,root,root,755)
223 %doc INSTALL README pdns.pdf pdns.txt
224 %attr(754,root,root) /etc/rc.d/init.d/pdns
225 %dir %{_sysconfdir}/%{name}
226 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.conf
227 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/pdns
228 %{systemdunitdir}/pdns.service
229 %{systemdunitdir}/pdns@.service
230 %attr(755,root,root) %{_sbindir}/pdns_server
231 %attr(755,root,root) %{_bindir}/calidns
232 %attr(755,root,root) %{_bindir}/dnsbulktest
233 %attr(755,root,root) %{_bindir}/dnsgram
234 %attr(755,root,root) %{_bindir}/dnspcap2calidns
235 %attr(755,root,root) %{_bindir}/dnspcap2protobuf
236 %attr(755,root,root) %{_bindir}/dnsreplay
237 %attr(755,root,root) %{_bindir}/dnsscan
238 %attr(755,root,root) %{_bindir}/dnsscope
239 %attr(755,root,root) %{_bindir}/dnstcpbench
240 %attr(755,root,root) %{_bindir}/dnswasher
241 %attr(755,root,root) %{_bindir}/dumresp
242 %attr(755,root,root) %{_bindir}/ixplore
243 %attr(755,root,root) %{_bindir}/nproxy
244 %attr(755,root,root) %{_bindir}/nsec3dig
245 %attr(755,root,root) %{_bindir}/pdns_control
246 %attr(755,root,root) %{_bindir}/pdns_notify
247 %attr(755,root,root) %{_bindir}/pdnsutil
248 %attr(755,root,root) %{_bindir}/saxfr
249 %attr(755,root,root) %{_bindir}/sdig
250 %attr(755,root,root) %{_bindir}/stubquery
251 %attr(755,root,root) %{_bindir}/zone2json
252 %attr(755,root,root) %{_bindir}/zone2ldap
253 %attr(755,root,root) %{_bindir}/zone2sql
254 %dir %{_libdir}/%{name}
255 %{_mandir}/man1/calidns.1*
256 %{_mandir}/man1/dnsbulktest.1*
257 %{_mandir}/man1/dnsgram.1*
258 %{_mandir}/man1/dnspcap2calidns.1*
259 %{_mandir}/man1/dnspcap2protobuf.1*
260 %{_mandir}/man1/dnsreplay.1*
261 %{_mandir}/man1/dnsscan.1*
262 %{_mandir}/man1/dnsscope.1*
263 %{_mandir}/man1/dnstcpbench.1*
264 %{_mandir}/man1/dnswasher.1*
265 %{_mandir}/man1/dumresp.1*
266 %{_mandir}/man1/ixplore.1*
267 %{_mandir}/man1/nproxy.1*
268 %{_mandir}/man1/nsec3dig.1*
269 %{_mandir}/man1/pdns_control.1*
270 %{_mandir}/man1/pdns_notify.1*
271 %{_mandir}/man1/pdns_server.1*
272 %{_mandir}/man1/pdnsutil.1*
273 %{_mandir}/man1/saxfr.1*
274 %{_mandir}/man1/sdig.1*
275 %{_mandir}/man1/zone2json.1*
276 %{_mandir}/man1/zone2ldap.1*
277 %{_mandir}/man1/zone2sql.1*
279 %files backend-gmysql
280 %defattr(644,root,root,755)
281 %doc modules/gmysqlbackend/*schema.mysql.sql
282 %attr(755,root,root) %{_libdir}/%{name}/*mysql*.so*
284 %files backend-gpgsql
285 %defattr(644,root,root,755)
286 %doc modules/gpgsqlbackend/*schema.pgsql.sql
287 %attr(755,root,root) %{_libdir}/%{name}/*pgsql*.so*
289 %files backend-gsqlite3
290 %defattr(644,root,root,755)
291 %doc modules/gsqlite3backend/*schema.sqlite3.sql
292 %attr(755,root,root) %{_libdir}/%{name}/*sqlite3*.so*
295 %defattr(644,root,root,755)
296 %attr(755,root,root) %{_libdir}/%{name}/*pipe*.so*
299 %defattr(644,root,root,755)
300 %attr(755,root,root) %{_libdir}/%{name}/*ldap*.so*