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