]>
Commit | Line | Data |
---|---|---|
23304159 ER |
1 | # TODO |
2 | # - warning: Installed (but unpackaged) file(s) found: | |
3 | # /etc/pdns/pdns.conf-dist | |
3a181db1 | 4 | # - do not use 'djbdns' group! |
482f17d2 JB |
5 | Summary: PowerDNS - a Versatile Database Driven Nameserver |
6 | Summary(pl.UTF-8): PowerDNS - wielofunkcyjny serwer nazw korzystający z relacyjnych baz danych | |
3cfcf782 | 7 | Name: pdns |
547c593f | 8 | Version: 4.0.9 |
482f17d2 | 9 | Release: 1 |
5558125e | 10 | License: GPL v2 |
d5cc2b05 | 11 | Group: Networking/Daemons |
547c593f JB |
12 | Source0: https://downloads.powerdns.com/releases/%{name}-%{version}.tar.bz2 |
13 | # Source0-md5: 906aa90e95b194dcd773627b298787be | |
14 | Source1: https://downloads.powerdns.com/documentation/%{name}.pdf | |
de9dbb26 | 15 | # Source1-md5: c7f3884185358e59d208e166eddb246c |
547c593f | 16 | Source2: https://downloads.powerdns.com/documentation/%{name}.txt |
33ccb468 | 17 | Source3: %{name}.init |
18 | Source4: %{name}.conf | |
19 | Source5: %{name}.sysconfig | |
f6c8362c | 20 | Patch1: %{name}-openldap-2.3.patch |
547c593f | 21 | URL: https://www.powerdns.com/ |
f6c8362c | 22 | BuildRequires: autoconf >= 2.61 |
5558125e | 23 | BuildRequires: automake >= 1:1.11 |
d5cc2b05 | 24 | BuildRequires: bison |
11adc590 | 25 | BuildRequires: boost-devel >= 1.35.0 |
d5cc2b05 | 26 | BuildRequires: flex |
4cf6fc85 | 27 | BuildRequires: libpq++-devel |
5558125e JB |
28 | BuildRequires: libstdc++-devel >= 6:4.7 |
29 | BuildRequires: libtool >= 2:2.2.2 | |
f6c8362c | 30 | BuildRequires: lua-devel >= 5.1 |
1c943d86 | 31 | BuildRequires: mysql-devel |
89d18ff9 | 32 | BuildRequires: openldap-devel >= 2.4.6 |
5558125e JB |
33 | BuildRequires: openssl-devel |
34 | BuildRequires: pkgconfig | |
f6c8362c | 35 | BuildRequires: polarssl-devel >= 1.1 |
5558125e JB |
36 | BuildRequires: postgresql-devel |
37 | BuildRequires: protobuf-devel | |
de9dbb26 | 38 | BuildRequires: rpmbuild(macros) >= 1.647 |
10ff87d8 | 39 | BuildRequires: sed >= 4.0 |
5558125e | 40 | BuildRequires: sqlite3-devel >= 3 |
9f5c3bed | 41 | BuildRequires: zlib-devel |
de9dbb26 | 42 | Requires(post,preun,postun): systemd-units >= 38 |
9dfdb7d5 ER |
43 | Requires(post): sed >= 4.0 |
44 | Requires(post,preun): /sbin/chkconfig | |
45 | Requires(postun): /usr/sbin/groupdel | |
46 | Requires(postun): /usr/sbin/userdel | |
d5cc2b05 | 47 | Requires(pre): /bin/id |
9f5c3bed | 48 | Requires(pre): /usr/bin/getgid |
d5cc2b05 | 49 | Requires(pre): /usr/sbin/groupadd |
9f5c3bed | 50 | Requires(pre): /usr/sbin/useradd |
9dfdb7d5 | 51 | Requires: rc-scripts |
de9dbb26 | 52 | Requires: systemd-units >= 0.38 |
9f5c3bed | 53 | Provides: group(djbdns) |
1c943d86 | 54 | Provides: nameserver |
9f5c3bed | 55 | Provides: user(pdns) |
1c943d86 | 56 | Obsoletes: powerdns |
9dfdb7d5 | 57 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
d5cc2b05 | 58 | |
59 | %description | |
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. | |
63 | ||
debd363c JR |
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. | |
d5cc2b05 | 69 | |
37897a72 | 70 | %package backend-pipe |
71 | Summary: PowerDNS support for custom pipe backend | |
48a18303 | 72 | Summary(pl.UTF-8): Obsługa własnego mechanizmu przechowywania stref dla PowerDNS-a |
d5cc2b05 | 73 | Group: Development/Libraries |
86e39795 | 74 | Requires: %{name} = %{version}-%{release} |
d5cc2b05 | 75 | |
37897a72 | 76 | %description backend-pipe |
77 | This package allows creation of own backend using simple STDIN/STDOUT | |
0ce130a4 | 78 | API. Example backend script in Perl is provided in package |
83be7e7a | 79 | documentation. |
d5cc2b05 | 80 | |
debd363c JR |
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. | |
37897a72 | 85 | |
69c8ac47 | 86 | %package backend-gpgsql |
37897a72 | 87 | Summary: PowerDNS support for PostgreSQL |
48a18303 | 88 | Summary(pl.UTF-8): Obsługa baz PostgreSQL dla PowerDNS-a |
37897a72 | 89 | Group: Development/Libraries |
86e39795 | 90 | Requires: %{name} = %{version}-%{release} |
37897a72 | 91 | |
69c8ac47 | 92 | %description backend-gpgsql |
37897a72 | 93 | This package allows zone storage in PostgreSQL relational db tables. |
94 | ||
debd363c | 95 | %description backend-gpgsql -l pl.UTF-8 |
91965bb5 | 96 | Ten pakiet pozwala na przechowywanie danych o strefach w tabelach |
37897a72 | 97 | relacyjnej bazy danych PostgreSQL. |
98 | ||
69c8ac47 | 99 | %package backend-gmysql |
37897a72 | 100 | Summary: PowerDNS support for MySQL |
48a18303 | 101 | Summary(pl.UTF-8): Obsługa baz MySQL dla PowerDNS-a |
37897a72 | 102 | Group: Development/Libraries |
86e39795 | 103 | Requires: %{name} = %{version}-%{release} |
37897a72 | 104 | |
69c8ac47 | 105 | %description backend-gmysql |
37897a72 | 106 | This package allows zone storage in MySQL relational db tables. |
107 | ||
debd363c | 108 | %description backend-gmysql -l pl.UTF-8 |
91965bb5 | 109 | Ten pakiet pozwala na przechowywanie danych o strefach w tabelach |
37897a72 | 110 | relacyjnej bazy danych MySQL. |
d5cc2b05 | 111 | |
78b0f5c7 | 112 | %package backend-gsqlite3 |
48a18303 JB |
113 | Summary: PowerDNS support for SQLite 3 |
114 | Summary(pl.UTF-8): Obsługa baz SQLite 3 dla PowerDNS-a | |
78b0f5c7 | 115 | Group: Development/Libraries |
116 | Requires: %{name} = %{version}-%{release} | |
117 | ||
118 | %description backend-gsqlite3 | |
48a18303 | 119 | This package allows zone storage in SQLite 3 relational db tables. |
78b0f5c7 | 120 | |
121 | %description backend-gsqlite3 -l pl.UTF-8 | |
122 | Ten pakiet pozwala na przechowywanie danych o strefach w tabelach | |
48a18303 | 123 | relacyjnej bazy danych SQLite 3. |
78b0f5c7 | 124 | |
69c8ac47 | 125 | %package backend-ldap |
165f995e | 126 | Summary: PowerDNS support for LDAP |
48a18303 | 127 | Summary(pl.UTF-8): Obsługa LDAP dla PowerDNS-a |
165f995e | 128 | Group: Development/Libraries |
86e39795 | 129 | Requires: %{name} = %{version}-%{release} |
69c8ac47 | 130 | |
131 | %description backend-ldap | |
132 | This package allows zone storage in LDAP directory. | |
133 | ||
debd363c | 134 | %description backend-ldap -l pl.UTF-8 |
d944d5e2 | 135 | Ten pakiet pozwala na przechowywanie danych o strefach w katalogu |
136 | LDAP. | |
69c8ac47 | 137 | |
d5cc2b05 | 138 | %prep |
33ccb468 | 139 | %setup -q |
962c96ad | 140 | %patch1 -p1 |
482f17d2 JB |
141 | cp -p %{SOURCE1} . |
142 | cp -p %{SOURCE2} . | |
143 | cp -p %{SOURCE4} . | |
91e921c8 | 144 | |
48a18303 JB |
145 | %if "%{_lib}" != "lib" |
146 | %{__sed} -i -e 's/module-dir=\/usr\/lib\/pdns/module-dir=\/usr\/%{_lib}\/pdns/' pdns.conf | |
91e921c8 | 147 | %endif |
d5cc2b05 | 148 | |
149 | %build | |
83be7e7a | 150 | CPPFLAGS="-DHAVE_NAMESPACE_STD -DHAVE_CXX_STRING_HEADER -DDLLIMPORT=\"\"" |
3259f60d ŁK |
151 | %{__libtoolize} |
152 | %{__aclocal} -I . | |
153 | %{__autoconf} | |
154 | %{__automake} | |
d5cc2b05 | 155 | %configure \ |
1c943d86 | 156 | --sysconfdir=%{_sysconfdir}/%{name} \ |
5558125e | 157 | --disable-silent-rules \ |
48a18303 | 158 | --disable-static \ |
5558125e | 159 | --with-dynmodules="gsqlite3 gmysql gpgsql pipe ldap" \ |
3259f60d | 160 | --with-lua \ |
5558125e | 161 | --with-modules="" \ |
6fee4fd0 | 162 | --with-mysql-includes=%{_includedir} \ |
48a18303 | 163 | --with-mysql-lib=%{_libdir} \ |
5558125e JB |
164 | --with-pgsql-includes=%{_includedir} \ |
165 | --with-pgsql-lib=%{_libdir} \ | |
de9dbb26 | 166 | --with-socketdir=/var/run \ |
5558125e | 167 | --with-system-polarssl \ |
de9dbb26 | 168 | --with-systemd=%{systemdunitdir} |
d5cc2b05 | 169 | |
de9dbb26 | 170 | %{__make} |
d5cc2b05 | 171 | |
172 | %install | |
173 | rm -rf $RPM_BUILD_ROOT | |
f8845daa | 174 | install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sysconfdir}/%{name},/etc/sysconfig} |
d5cc2b05 | 175 | |
176 | %{__make} install \ | |
1c943d86 JB |
177 | DESTDIR=$RPM_BUILD_ROOT |
178 | ||
f6c8362c ŁK |
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 | |
1c943d86 JB |
182 | |
183 | # useless - modules are dlopened by *.so | |
eaff2c55 JR |
184 | %{__rm} -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.la |
185 | ||
186 | # we put that in using %doc | |
187 | %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name} | |
d5cc2b05 | 188 | |
1c943d86 JB |
189 | %clean |
190 | rm -rf $RPM_BUILD_ROOT | |
d5cc2b05 | 191 | |
192 | %pre | |
3a30c7f7 ER |
193 | %groupadd -g 32 djbdns |
194 | %useradd -u 30 -d /var/lib/pdns -s /bin/false -c "pdns User" -g djbdns pdns | |
d5cc2b05 | 195 | |
196 | %post | |
de9dbb26 | 197 | %systemd_post %{name}.service |
e72cbcd1 | 198 | # dirty hack so the config file is processed correctly, and server does not respawn |
9dfdb7d5 | 199 | sed -i -e 's/^ *//' /etc/pdns/pdns.conf |
e72cbcd1 | 200 | |
d5cc2b05 | 201 | /sbin/chkconfig --add pdns |
9dfdb7d5 | 202 | %service pdns restart |
d5cc2b05 | 203 | |
204 | %preun | |
33ccb468 | 205 | if [ "$1" = "0" ]; then |
9dfdb7d5 | 206 | %service pdns stop |
33ccb468 | 207 | /sbin/chkconfig --del pdns |
208 | fi | |
de9dbb26 | 209 | %systemd_preun %{name}.service |
d5cc2b05 | 210 | |
211 | %postun | |
212 | if [ "$1" = "0" ]; then | |
9f5c3bed | 213 | %userremove pdns |
214 | %groupremove djbdns | |
d5cc2b05 | 215 | fi |
de9dbb26 | 216 | %systemd_reload |
d5cc2b05 | 217 | |
d5cc2b05 | 218 | %files |
219 | %defattr(644,root,root,755) | |
f6c8362c | 220 | %doc INSTALL README pdns.pdf pdns.txt |
547c593f | 221 | %attr(754,root,root) /etc/rc.d/init.d/pdns |
37897a72 | 222 | %dir %{_sysconfdir}/%{name} |
d944d5e2 | 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 | |
de9dbb26 JR |
225 | %{systemdunitdir}/pdns.service |
226 | %{systemdunitdir}/pdns@.service | |
e96a5cfd | 227 | %attr(755,root,root) %{_sbindir}/pdns_server |
de9dbb26 | 228 | %attr(755,root,root) %{_bindir}/dnspcap2protobuf |
e96a5cfd | 229 | %attr(755,root,root) %{_bindir}/pdns_control |
de9dbb26 | 230 | %attr(755,root,root) %{_bindir}/pdnsutil |
e96a5cfd ŁK |
231 | %attr(755,root,root) %{_bindir}/zone2json |
232 | %attr(755,root,root) %{_bindir}/zone2ldap | |
233 | %attr(755,root,root) %{_bindir}/zone2sql | |
f8845daa | 234 | %dir %{_libdir}/%{name} |
de9dbb26 JR |
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* | |
e96a5cfd | 248 | %{_mandir}/man1/pdns_control.1* |
de9dbb26 | 249 | %{_mandir}/man1/pdns_notify.1* |
e96a5cfd | 250 | %{_mandir}/man1/pdns_server.1* |
de9dbb26 JR |
251 | %{_mandir}/man1/pdnsutil.1* |
252 | %{_mandir}/man1/saxfr.1* | |
253 | %{_mandir}/man1/sdig.1* | |
254 | %{_mandir}/man1/zone2json.1* | |
e96a5cfd ŁK |
255 | %{_mandir}/man1/zone2ldap.1* |
256 | %{_mandir}/man1/zone2sql.1* | |
d5cc2b05 | 257 | |
69c8ac47 | 258 | %files backend-gmysql |
1c943d86 | 259 | %defattr(644,root,root,755) |
eaff2c55 | 260 | %doc modules/gmysqlbackend/*schema.mysql.sql |
33ccb468 | 261 | %attr(755,root,root) %{_libdir}/%{name}/*mysql*.so* |
37897a72 | 262 | |
69c8ac47 | 263 | %files backend-gpgsql |
1c943d86 | 264 | %defattr(644,root,root,755) |
eaff2c55 | 265 | %doc modules/gpgsqlbackend/*schema.pgsql.sql |
33ccb468 | 266 | %attr(755,root,root) %{_libdir}/%{name}/*pgsql*.so* |
37897a72 | 267 | |
78b0f5c7 | 268 | %files backend-gsqlite3 |
269 | %defattr(644,root,root,755) | |
eaff2c55 | 270 | %doc modules/gsqlite3backend/*schema.sqlite3.sql |
78b0f5c7 | 271 | %attr(755,root,root) %{_libdir}/%{name}/*sqlite3*.so* |
272 | ||
37897a72 | 273 | %files backend-pipe |
1c943d86 | 274 | %defattr(644,root,root,755) |
33ccb468 | 275 | %attr(755,root,root) %{_libdir}/%{name}/*pipe*.so* |
69c8ac47 | 276 | |
277 | %files backend-ldap | |
278 | %defattr(644,root,root,755) | |
279 | %attr(755,root,root) %{_libdir}/%{name}/*ldap*.so* |