X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=pdns.spec;h=a6c4355620f6d50435e6382e5e976d93a6c47431;hb=5a3bba058dd5c921830798ff95e1433cd9542ebf;hp=ab387851e870d105928fc214d633cd00abe1cd03;hpb=d5cc2b05c0b17495ab8992a77efcc195676c4c33;p=packages%2Fpdns.git diff --git a/pdns.spec b/pdns.spec index ab38785..a6c4355 100644 --- a/pdns.spec +++ b/pdns.spec @@ -1,34 +1,46 @@ -%define name pdns -%define version 2.9.4 -%define release 0.1 - Summary: PowerDNS is a Versatile Database Driven Nameserver Summary(pl): PowerDNS to wielofunkcyjny serwer nazw korzystaj±cy z relacyjnych baz danych -Name: %{name} -Version: %{version} -Release: %{release} +Name: pdns +Version: 2.9.20 +Release: 3 License: GPL Group: Networking/Daemons -URL: http://www.powerdns.com/ Source0: http://downloads.powerdns.com/releases/%{name}-%{version}.tar.gz +# Source0-md5: 33b20ef1b767f93297101f2aa09e99ed Source1: http://downloads.powerdns.com/documentation/%{name}.pdf -Source2: %{name}.init -Source3: %{name}.conf - +# Source1-md5: 3ce3a16df5d91ceab75dea8307b35f2c +Source2: http://downloads.powerdns.com/documentation/%{name}.txt +Source3: %{name}.init +Source4: %{name}.conf +Source5: %{name}.sysconfig +Patch0: %{name}-configure.patch +Patch1: %{name}-int16.patch +Patch2: %{name}-openldap-2.3.patch +URL: http://www.powerdns.com/ BuildRequires: bison +BuildRequires: boost-devel +BuildRequires: boost-ref-devel BuildRequires: flex -BuildRequires: mysql-devel -BuildRequires: postgresql-c++-devel +BuildRequires: libpq++-devel BuildRequires: libstdc++-devel +BuildRequires: mysql-devel +BuildRequires: openldap-devel >= 2.3.0 +BuildRequires: rpmbuild(macros) >= 1.268 BuildRequires: zlib-devel +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/sbin/useradd +Requires(pre): /usr/bin/getgid Requires(pre): /usr/sbin/groupadd -Requires(pre): /bin/id -Requires(postun): /usr/sbin/userdel +Requires(pre): /usr/sbin/useradd +Requires: rc-scripts +Provides: group(djbdns) +Provides: nameserver +Provides: user(pdns) +Obsoletes: powerdns BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) -Provides: nameserver pdns powerdns -Obsoletes: nameserver pdns powerdns %description PowerDNS is a versatile nameserver which supports a large number of @@ -37,110 +49,155 @@ 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. +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 devel -Summary: PowerDNS developement libraries -Summary(pl): Biblioteki PowerDNS +%package backend-pipe +Summary: PowerDNS support for custom pipe backend +Summary(pl): Wsparcie PowerDNS dla w³asnego mechanizmu przechowywania stref Group: Development/Libraries +Requires: %{name} = %{version}-%{release} -%description devel -Developement libraries for PowerDNS. +%description backend-pipe +This package allows creation of own backend using simple STDIN/STDOUT +API. Example backend script in Perl is provided in package +documentation. -%description devel -l pl -Pliki bibliotek dla PowerDNS. +%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. -%package static -Summary: PowerDNS static libs -Summary(pl): Biblioteki statyczne PowerDNS +%package backend-gpgsql +Summary: PowerDNS support for PostgreSQL +Summary(pl): Wsparcie PowerDNS dla baz PostgresQL Group: Development/Libraries +Requires: %{name} = %{version}-%{release} -%description static -Static PowerDNS libraries. +%description backend-gpgsql +This package allows zone storage in PostgreSQL relational db tables. -%description static -l pl -Statyczne biblioteki PowerDNS. +%description backend-gpgsql -l pl +Ten pakiet pozwala na przechowywanie danych o strefach w tabelach +relacyjnej bazy danych PostgreSQL. -%prep +%package backend-gmysql +Summary: PowerDNS support for MySQL +Summary(pl): Wsparcie PowerDNS dla baz MySQL +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} -%setup -q +%description backend-gmysql +This package allows zone storage in MySQL relational db tables. -%build +%description backend-gmysql -l pl +Ten pakiet pozwala na przechowywanie danych o strefach w tabelach +relacyjnej bazy danych MySQL. + +%package backend-ldap +Summary: PowerDNS support for LDAP +Summary(pl): Wsparcie PowerDNS dla baz LDAP +Group: Development/Libraries +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. + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +cp %{SOURCE1} . +cp %{SOURCE2} . +%build +CPPFLAGS="-DHAVE_NAMESPACE_STD -DHAVE_CXX_STRING_HEADER -DDLLIMPORT=\"\"" %configure \ - --libexecdir=%{_libexecdir} \ - --libdir=%{_libdir}/%{name} \ - --bindir=%{_sbindir} \ - --sbindir=%{_sbindir} \ - --sysconfdir=%{_sysconfdir}/%{name} \ - --with-socketdir=/var/run \ - --with-dynmodules="gmysql gpgsql pipe" \ - --with-modules="" \ - --with-pgsql-includes=/usr/include \ - --enable-mysql \ - --enable-pgsql + --libdir=%{_libdir}/%{name} \ + --sysconfdir=%{_sysconfdir}/%{name} \ + --with-socketdir=/var/run \ + --with-dynmodules="gmysql gpgsql pipe ldap" \ + --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 %{__make} %install rm -rf $RPM_BUILD_ROOT +install -d $RPM_BUILD_ROOT{%{_initrddir},%{_sysconfdir}/%{name},/etc/sysconfig} %{__make} install \ - DESTDIR="%{buildroot}" + 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 -install -d %{buildroot}/%{_initrddir} -install -d %{buildroot}/%{_sysconfdir}/%{name} -install -m644 %{SOURCE1} %{buildroot}/%{name}.pdf -install -m754 %{SOURCE2} %{buildroot}/%{_initrddir}/%{name} -install -m600 %{SOURCE3} %{buildroot}/%{_sysconfdir}/%{name}/%{name}.conf +# useless - modules are dlopened by *.so +rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/*.la + +%clean +rm -rf $RPM_BUILD_ROOT %pre -if [ -n "`getgid djbdns`" ]; then - if [ "`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 -r -f djbdns -fi -if [ -n "`id -u pdns 2>/dev/null`" ]; then - if [ "`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 -r -d /dev/null -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 +# dirty hack so the config file is processed correctly, and server does not respawn +sed -i -e 's/^ *//' /etc/pdns/pdns.conf + /sbin/chkconfig --add pdns +%service pdns restart %preun -/sbin/chkconfig --del pdns +if [ "$1" = "0" ]; then + %service pdns stop + /sbin/chkconfig --del pdns +fi %postun if [ "$1" = "0" ]; then - /usr/sbin/userdel pdns + %userremove pdns + %groupremove djbdns fi -%clean -[ -n "%{buildroot}" -a "%{buildroot}" != / ] && rm -rf %{buildroot} - %files %defattr(644,root,root,755) -%doc ChangeLog HACKING INSTALL README TODO WARNING %{name}.pdf -%config(noreplace) %attr(0600,root,root) %{_sysconfdir}/%{name}/%{name}.conf -%config(noreplace) %attr(0754,root,root) %{_initrddir}/%{name} -%dir %{_sysconfdir}%{name} +%doc ChangeLog HACKING INSTALL README TODO pdns.pdf pdns.txt +%attr(754,root,root) %{_initrddir}/%{name} +%dir %{_sysconfdir}/%{name} +%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 %attr(755,root,root) %{_sbindir}/* -%{_libdir}%{name}/* +%attr(755,root,root) %{_bindir}/* %{_mandir}/man8/* -%files devel -%attr(755,root,root) %{_libdir}/%{name}/*.so -%attr(644,root,root) %{_libdir}/%{name}/*.la +%files backend-gmysql +%defattr(644,root,root,755) +%attr(755,root,root) %{_libdir}/%{name}/*mysql*.so* -%files static -%attr(644,root,root) %{_libdir}/%{name}/*.a +%files backend-gpgsql +%defattr(644,root,root,755) +%attr(755,root,root) %{_libdir}/%{name}/*pgsql*.so* + +%files backend-pipe +%defattr(644,root,root,755) +%attr(755,root,root) %{_libdir}/%{name}/*pipe*.so* + +%files backend-ldap +%defattr(644,root,root,755) +%attr(755,root,root) %{_libdir}/%{name}/*ldap*.so*