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