X-Git-Url: http://git.pld-linux.org/?p=packages%2Fpdns.git;a=blobdiff_plain;f=pdns.spec;h=ac775ac4d5f158ae431a85ac3a01d2fd29ee2869;hp=f4277c7803e04d58c591fad3246e5fc57987d418;hb=ea9e1ef4598dd03606350d9866b69aa9f0802923;hpb=9f5c3bed0ee1a79905686659f37f203b54aae1fe diff --git a/pdns.spec b/pdns.spec index f4277c7..ac775ac 100644 --- a/pdns.spec +++ b/pdns.spec @@ -1,213 +1,296 @@ -Summary: PowerDNS is a Versatile Database Driven Nameserver -Summary(pl): PowerDNS to wielofunkcyjny serwer nazw korzystaj±cy z relacyjnych baz danych +# TODO +# - warning: Installed (but unpackaged) file(s) found: +# /etc/pdns/pdns.conf-dist +# - do not use 'djbdns' group! +Summary: PowerDNS - a Versatile Database Driven Nameserver +Summary(pl.UTF-8): PowerDNS - wielofunkcyjny serwer nazw korzystający z relacyjnych baz danych Name: pdns -Version: 2.9.16 +Version: 4.3.1 Release: 2 -License: GPL +License: GPL v2 Group: Networking/Daemons -Source0: http://downloads.powerdns.com/releases/%{name}-%{version}.tar.gz -# Source0-md5: 7e9a859a5a21996dbf7b31cd61731dbc -Source1: http://downloads.powerdns.com/documentation/%{name}.pdf -# Source1-md5: 72cce8fb180c3a70437187ff0912c2a3 -Source2: http://downloads.powerdns.com/documentation/%{name}.txt +Source0: https://downloads.powerdns.com/releases/%{name}-%{version}.tar.bz2 +# Source0-md5: 59011d4337dc02d9b114918781f96bee +Source1: https://downloads.powerdns.com/documentation/%{name}.pdf +# Source1-md5: 15bdde9d84af6ef1485dc2f5fa3f81df +Source2: https://downloads.powerdns.com/documentation/%{name}.txt Source3: %{name}.init Source4: %{name}.conf Source5: %{name}.sysconfig -Patch0: %{name}-configure.patch -URL: http://www.powerdns.com/ +Patch0: %{name}-boost.patch +Patch1: %{name}-openldap-2.3.patch +URL: https://www.powerdns.com/ +BuildRequires: autoconf >= 2.61 +BuildRequires: automake >= 1:1.11 BuildRequires: bison +BuildRequires: boost-devel >= 1.35.0 BuildRequires: flex -BuildRequires: libstdc++-devel BuildRequires: libpq++-devel +BuildRequires: libstdc++-devel >= 6:4.7 +BuildRequires: libtool >= 2:2.2.2 +BuildRequires: lua-devel >= 5.1 BuildRequires: mysql-devel -BuildRequires: openldap-devel -BuildRequires: rpmbuild(macros) >= 1.159 +BuildRequires: openldap-devel >= 2.4.6 +BuildRequires: openssl-devel +BuildRequires: pkgconfig +BuildRequires: polarssl-devel >= 1.1 +BuildRequires: postgresql-devel +BuildRequires: protobuf-devel +BuildRequires: rpmbuild(macros) >= 1.647 +BuildRequires: sed >= 4.0 +BuildRequires: sqlite3-devel >= 3 BuildRequires: zlib-devel -PreReq: rc-scripts +Requires(post,preun,postun): systemd-units >= 38 +Requires(post): sed >= 4.0 +Requires(post,preun): /sbin/chkconfig +Requires(postun): /usr/sbin/groupdel +Requires(postun): /usr/sbin/userdel Requires(pre): /bin/id Requires(pre): /usr/bin/getgid Requires(pre): /usr/sbin/groupadd Requires(pre): /usr/sbin/useradd -Requires(post,preun): /sbin/chkconfig -Requires(postun): /usr/sbin/groupdel -Requires(postun): /usr/sbin/userdel -BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) +Requires: rc-scripts +Requires: systemd-units >= 0.38 Provides: group(djbdns) Provides: nameserver Provides: user(pdns) Obsoletes: powerdns +BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description PowerDNS is a versatile nameserver which supports a large number of different backends ranging from simple zonefiles to relational databases and load balancing/failover algorithms. -%description -l pl -PowerDNS to wielofunkcyjny serwer nazw posiadaj±cy du¿± liczbê wtyczek -od prostych stref (a'la BIND) pocz±wszy, a na relacyjnych bazach -danych skoñczywszy oraz zawieraj±cy algorytmy zrównowa¿enia obci±¿enia -i prze³±czania w wypadku awarii. +%description -l pl.UTF-8 +PowerDNS to wielofunkcyjny serwer nazw posiadający dużą liczbę wtyczek +od prostych stref (a'la BIND) począwszy, a na relacyjnych bazach +danych skończywszy oraz zawierający algorytmy zrównoważenia obciążenia +i przełączania w wypadku awarii. %package backend-pipe Summary: PowerDNS support for custom pipe backend -Summary(pl): Wsparcie PowerDNS dla w³asnego mechanizmu przechowywania stref +Summary(pl.UTF-8): Obsługa własnego mechanizmu przechowywania stref dla PowerDNS-a Group: Development/Libraries +Requires: %{name} = %{version}-%{release} %description backend-pipe This package allows creation of own backend using simple STDIN/STDOUT -API. Example backend script in perl is provided in package +API. Example backend script in Perl is provided in package documentation. -%description backend-pipe -l pl -Ten pakiet pozwala na utworzenie w³asnego mechanizmu przechowywania -stref za pomoc¹ prostego interfejsu STDIN/STDOUT. Przyk³adowy skrypt w -perlu zosta³ do³±czony do dokumentacji pakietu. +%description backend-pipe -l pl.UTF-8 +Ten pakiet pozwala na utworzenie własnego mechanizmu przechowywania +stref za pomocą prostego interfejsu STDIN/STDOUT. Przykładowy skrypt w +Perlu został dołączony do dokumentacji pakietu. %package backend-gpgsql Summary: PowerDNS support for PostgreSQL -Summary(pl): Wsparcie PowerDNS dla baz PostgresQL +Summary(pl.UTF-8): Obsługa baz PostgreSQL dla PowerDNS-a Group: Development/Libraries -Requires: postgresql +Requires: %{name} = %{version}-%{release} %description backend-gpgsql This package allows zone storage in PostgreSQL relational db tables. -%description backend-gpgsql -l pl +%description backend-gpgsql -l pl.UTF-8 Ten pakiet pozwala na przechowywanie danych o strefach w tabelach relacyjnej bazy danych PostgreSQL. %package backend-gmysql Summary: PowerDNS support for MySQL -Summary(pl): Wsparcie PowerDNS dla baz MySQL +Summary(pl.UTF-8): Obsługa baz MySQL dla PowerDNS-a Group: Development/Libraries -Requires: mysql +Requires: %{name} = %{version}-%{release} %description backend-gmysql This package allows zone storage in MySQL relational db tables. -%description backend-gmysql -l pl +%description backend-gmysql -l pl.UTF-8 Ten pakiet pozwala na przechowywanie danych o strefach w tabelach relacyjnej bazy danych MySQL. +%package backend-gsqlite3 +Summary: PowerDNS support for SQLite 3 +Summary(pl.UTF-8): Obsługa baz SQLite 3 dla PowerDNS-a +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description backend-gsqlite3 +This package allows zone storage in SQLite 3 relational db tables. + +%description backend-gsqlite3 -l pl.UTF-8 +Ten pakiet pozwala na przechowywanie danych o strefach w tabelach +relacyjnej bazy danych SQLite 3. + %package backend-ldap Summary: PowerDNS support for LDAP -Summary(pl): Wsparcie PowerDNS dla baz LDAP +Summary(pl.UTF-8): Obsługa LDAP dla PowerDNS-a Group: Development/Libraries -Requires: openldap +Requires: %{name} = %{version}-%{release} %description backend-ldap This package allows zone storage in LDAP directory. -%description backend-ldap -l pl -Ten pakiet pozwala na przechowywanie danych o strefach w katalogu LDAP. +%description backend-ldap -l pl.UTF-8 +Ten pakiet pozwala na przechowywanie danych o strefach w katalogu +LDAP. %prep %setup -q %patch0 -p1 -cp %{SOURCE1} . -cp %{SOURCE2} . +%patch1 -p1 +cp -p %{SOURCE1} . +cp -p %{SOURCE2} . +cp -p %{SOURCE4} . + +%if "%{_lib}" != "lib" +%{__sed} -i -e 's/module-dir=\/usr\/lib\/pdns/module-dir=\/usr\/%{_lib}\/pdns/' pdns.conf +%endif %build CPPFLAGS="-DHAVE_NAMESPACE_STD -DHAVE_CXX_STRING_HEADER -DDLLIMPORT=\"\"" +%{__libtoolize} +%{__aclocal} -I . +%{__autoconf} +%{__automake} %configure \ - --libdir=%{_libdir}/%{name} \ --sysconfdir=%{_sysconfdir}/%{name} \ - --with-socketdir=/var/run \ - --with-dynmodules="gmysql gpgsql pipe ldap" \ + --disable-silent-rules \ + --disable-static \ + --enable-tools \ + --with-dynmodules="gsqlite3 gmysql gpgsql pipe ldap" \ + --with-lua \ --with-modules="" \ - --enable-mysql \ - --enable-pgsql \ - --with-pgsql-lib=%{_libdir} \ - --with-pgsql-includes=%{_includedir} \ - --with-mysql-lib=%{_libdir} \ --with-mysql-includes=%{_includedir} \ - --enable-ldap \ - --disable-static + --with-mysql-lib=%{_libdir} \ + --with-pgsql-includes=%{_includedir} \ + --with-pgsql-lib=%{_libdir} \ + --with-socketdir=/var/run \ + --with-system-polarssl \ + --with-systemd=%{systemdunitdir} %{__make} %install rm -rf $RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT{%{_initrddir},%{_sysconfdir}/%{name},/etc/sysconfig} +install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sysconfdir}/%{name},/etc/sysconfig} %{__make} install \ DESTDIR=$RPM_BUILD_ROOT -install %{SOURCE3} $RPM_BUILD_ROOT%{_initrddir}/%{name} -install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.conf -install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/pdns +cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} +cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.conf +cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/pdns # useless - modules are dlopened by *.so -rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.la +%{__rm} -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.la + +# we put that in using %doc +%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name} %clean rm -rf $RPM_BUILD_ROOT %pre -if [ -n "`/usr/bin/getgid djbdns`" ]; then - if [ "`/usr/bin/getgid djbdns`" != "32" ]; then - echo "Error: group djbdns doesn't have gid=32. Correct this before installing pdns." 1>&2 - exit 1 - fi -else - /usr/sbin/groupadd -g 32 djbdns -fi -if [ -n "`/bin/id -u pdns 2>/dev/null`" ]; then - if [ "`/bin/id -u pdns`" != "30" ]; then - echo "Error: user pdns doesn't have uid=30. Correct this before installing pdns." 1>&2 - exit 1 - fi -else - /usr/sbin/useradd -u 30 -d /var/lib/pdns -s /bin/false -c "pdns User" -g djbdns pdns 1>&2 -fi +%groupadd -g 32 djbdns +%useradd -u 30 -d /var/lib/pdns -s /bin/false -c "pdns User" -g djbdns pdns %post +%systemd_post %{name}.service # dirty hack so the config file is processed correctly, and server does not respawn -TMP=`mktemp /tmp/pdns.install-tmp.XXXXXX` -sed 's/^ *//g' /etc/pdns/pdns.conf > $TMP -cp /etc/pdns/pdns.conf /etc/pdns/pdns.conf.rpmsave -mv $TMP /etc/pdns/pdns.conf +sed -i -e 's/^ *//' /etc/pdns/pdns.conf /sbin/chkconfig --add pdns -if [ -f /var/lock/subsys/pdns ]; then - /etc/rc.d/init.d/pdns restart >&2 -else - echo "Run \"/etc/rc.d/init.d/pdns start\" to start pdns." >&2 -fi +%service pdns restart %preun if [ "$1" = "0" ]; then - if [ -f /var/lock/subsys/pdns ]; then - /etc/rc.d/init.d/pdns stop - fi + %service pdns stop /sbin/chkconfig --del pdns fi +%systemd_preun %{name}.service %postun if [ "$1" = "0" ]; then %userremove pdns %groupremove djbdns fi +%systemd_reload %files %defattr(644,root,root,755) -%doc ChangeLog HACKING INSTALL README TODO WARNING pdns.pdf pdns.txt -%config(noreplace) %attr(0600,root,root) %{_sysconfdir}/%{name}/%{name}.conf -%config(noreplace) %attr(0754,root,root) %{_initrddir}/%{name} -%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/pdns +%doc INSTALL README pdns.pdf pdns.txt +%attr(754,root,root) /etc/rc.d/init.d/pdns %dir %{_sysconfdir}/%{name} -%attr(755,root,root) %{_sbindir}/* -%attr(755,root,root) %{_bindir}/* -%{_mandir}/man8/* +%attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/%{name}.conf +%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/pdns +%{systemdunitdir}/pdns.service +%{systemdunitdir}/pdns@.service +%attr(755,root,root) %{_sbindir}/pdns_server +%attr(755,root,root) %{_bindir}/calidns +%attr(755,root,root) %{_bindir}/dnsbulktest +%attr(755,root,root) %{_bindir}/dnsgram +%attr(755,root,root) %{_bindir}/dnspcap2calidns +%attr(755,root,root) %{_bindir}/dnspcap2protobuf +%attr(755,root,root) %{_bindir}/dnsreplay +%attr(755,root,root) %{_bindir}/dnsscan +%attr(755,root,root) %{_bindir}/dnsscope +%attr(755,root,root) %{_bindir}/dnstcpbench +%attr(755,root,root) %{_bindir}/dnswasher +%attr(755,root,root) %{_bindir}/dumresp +%attr(755,root,root) %{_bindir}/ixplore +%attr(755,root,root) %{_bindir}/nproxy +%attr(755,root,root) %{_bindir}/nsec3dig +%attr(755,root,root) %{_bindir}/pdns_control +%attr(755,root,root) %{_bindir}/pdns_notify +%attr(755,root,root) %{_bindir}/pdnsutil +%attr(755,root,root) %{_bindir}/saxfr +%attr(755,root,root) %{_bindir}/sdig +%attr(755,root,root) %{_bindir}/stubquery +%attr(755,root,root) %{_bindir}/zone2json +%attr(755,root,root) %{_bindir}/zone2ldap +%attr(755,root,root) %{_bindir}/zone2sql +%dir %{_libdir}/%{name} +%{_mandir}/man1/calidns.1* +%{_mandir}/man1/dnsbulktest.1* +%{_mandir}/man1/dnsgram.1* +%{_mandir}/man1/dnspcap2calidns.1* +%{_mandir}/man1/dnspcap2protobuf.1* +%{_mandir}/man1/dnsreplay.1* +%{_mandir}/man1/dnsscan.1* +%{_mandir}/man1/dnsscope.1* +%{_mandir}/man1/dnstcpbench.1* +%{_mandir}/man1/dnswasher.1* +%{_mandir}/man1/dumresp.1* +%{_mandir}/man1/ixplore.1* +%{_mandir}/man1/nproxy.1* +%{_mandir}/man1/nsec3dig.1* +%{_mandir}/man1/pdns_control.1* +%{_mandir}/man1/pdns_notify.1* +%{_mandir}/man1/pdns_server.1* +%{_mandir}/man1/pdnsutil.1* +%{_mandir}/man1/saxfr.1* +%{_mandir}/man1/sdig.1* +%{_mandir}/man1/zone2json.1* +%{_mandir}/man1/zone2ldap.1* +%{_mandir}/man1/zone2sql.1* %files backend-gmysql %defattr(644,root,root,755) +%doc modules/gmysqlbackend/*schema.mysql.sql %attr(755,root,root) %{_libdir}/%{name}/*mysql*.so* %files backend-gpgsql %defattr(644,root,root,755) +%doc modules/gpgsqlbackend/*schema.pgsql.sql %attr(755,root,root) %{_libdir}/%{name}/*pgsql*.so* +%files backend-gsqlite3 +%defattr(644,root,root,755) +%doc modules/gsqlite3backend/*schema.sqlite3.sql +%attr(755,root,root) %{_libdir}/%{name}/*sqlite3*.so* + %files backend-pipe %defattr(644,root,root,755) %attr(755,root,root) %{_libdir}/%{name}/*pipe*.so*