Search
j0ke.net Open Build Service
>
Projects
>
home:opeter
>
powerdns
> Changes
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
Changes of Revision 86
[-]
[+]
Changed
pdns.spec
@@ -1,57 +1,188 @@ -BuildRoot: /tmp/pdns -Name: pdns-static -Version: 3.2 -Release: 1 -Summary: extremely powerful and versatile nameserver -License: GPL -Distribution: Neutral -Vendor: PowerDNS.COM BV -Group: System/DNS -AutoReqProv: no -Requires: glibc >= 2.4 +Summary: PowerDNS is a Versatile Database Driven Nameserver +Name: pdns +Version: 3.2 +Release: 2%{dist} +Epoch: 0 +License: GPL +Group: System/Servers +URL: http://www.powerdns.com/ +Source0: http://downloads.powerdns.com/releases/pdns-%{version}.tar.gz + +#Patch0: pdns-3.2-init.patch +Patch1: pdns-3.2-slavedb.patch +Patch2: pdns-3.2-allow-axfr-from.patch + +Source1: http://downloads.powerdns.com/documentation/html.tar.gz + +BuildRequires: autoconf automake make ragel +BuildRequires: gcc gcc-c++ +BuildRequires: zlib-devel +BuildRequires: lua-devel +BuildRequires: sqlite-devel >= 3.0.0 +BuildRequires: Percona-Server-devel-51 Percona-Server-shared-51 +%if 0%{?rhel_version} < 600 +BuildRequires: boost-devel >= 1.34.0 +#BuildRequires: mysql-devel >= 5.0.0 +%else +BuildRequires: boost-devel >= 1.4 +#BuildRequires: mysql-devel >= 5.1.0 +%endif + +Requires: lua + +%if 0%{?rhel_version} < 600 +Requires: boost-serialization >= 1.34.0 +Requires: boost-program-options >= 1.34.0 +%else +Requires: boost-serialization >= 1.41.0 +Requires: boost-program-options >= 1.41.0 +%endif + + +Provides: nameserver pdns-server powerdns = %{version}-%{release} +BuildRoot: %{_tmppath}/%{name}-%{version}-root -%define _rpmdir ../ -%define _rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm %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. -This RPM is statically compiled and should work on all Linux distributions. -It comes with support for MySQL, PostgreSQL, Bind zonefiles and the 'pipe -backend'. +This RPM comes with support for MySQL backend. -%files -%defattr(-,root,root) -"/usr/sbin/pdns_server" -"/usr/bin/pdns_control" -"/usr/bin/zone2sql" -"/usr/bin/zone2json" -"/usr/bin/pdnssec" -#"/usr/bin/zone2ldap" -"/usr/man/man8/pdns_control.8" -"/usr/man/man8/pdns_server.8" -"/usr/man/man8/zone2sql.8" - -%dir "/etc/powerdns/" -%config(noreplace) "/etc/powerdns/pdns.conf" -%config "/etc/init.d/pdns" +%package tools +Summary: DNS tools for %{name} +Group: System/Servers +Requires: %{name} = %{version} + +%description tools +This package contains the DNS tools for the PowerDNS nameserver. + +%package devel +Summary: Development headers and libraries for %{name} +Group: System/Servers +Requires: %{name} = %{version} + +%description devel +Development headers and libraries for %{name} + +%prep +%setup -q -n pdns-%{version} -a1 +#%patch0 -p0 -b .init +%patch1 -p0 +%patch2 -p0 + +%build +%configure \ + --sysconfdir=%{_sysconfdir}/pdns \ + --libdir=%{_libdir}/%{name} \ + --libdir=%{_libdir} \ + --with-sqlite3 \ + --with-mysql-lib=%{_libdir}/mysql \ + --with-socketdir=/var/run/pdns-server \ + --with-modules="gmysql geo pipe" \ + --enable-static-binaries +%{__make} + +%install +[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT + +install -d $RPM_BUILD_ROOT%{_sysconfdir}/pdns/ +install -d $RPM_BUILD_ROOT%{_localstatedir}/run/pdns-server + +%{__make} %{?_smp_mflags} DESTDIR=$RPM_BUILD_ROOT install + +# fix the config +mv $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pdns.conf-dist $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pdns.conf + +cat >> $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/pdns.conf << EOF +module-dir=%{_libdir} +socket-dir=/var/run/pdns-server +setuid=pdns +setgid=pdns +EOF + +chmod 600 $RPM_BUILD_ROOT%{_sysconfdir}/pdns/pdns.conf + +# install sysv scripts +install -d $RPM_BUILD_ROOT%{_initrddir} +install -m755 pdns/pdns $RPM_BUILD_ROOT%{_initrddir}/pdns + +%clean +[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT + +%pre +if [ -z "`/usr/bin/id -g pdns 2>/dev/null`" ]; then + /usr/sbin/groupadd -g 25 -r -f pdns 2>&1 || : +fi +if [ -z "`/usr/bin/id -u pdns 2>/dev/null`" ]; then + /usr/sbin/useradd -u 25 -r -M -d /tmp -s /sbin/nologin -c "PowerDNS" -g pdns pdns 2>&1 || : +fi %post -echo Remember to create a 'pdns' user before starting pdns +/sbin/chkconfig --add pdns -%package -n pdns-tools -Summary: extremely powerful and versatile nameserver -License: GPL -Distribution: Neutral -Vendor: PowerDNS.COM BV -Group: System/DNS -AutoReqProv: no +%preun +if [ $1 -eq 0 ]; then + /sbin/service pdns stop >/dev/null 2>&1 || : + /sbin/chkconfig --del pdns + + if [ -d /var/run/pdns-server ]; then + rm -rf /var/run/pdns-server/* + fi +fi + +%postun +if [ $1 -eq 0 ]; then + rm -rf %{_localstatedir}/run/pdns-server/ + /usr/sbin/userdel pdns 2>/dev/null || : + /usr/sbin/groupdel pdns 2>/dev/null || : +fi + +%files +%defattr(-,root,root) +%doc ChangeLog HACKING INSTALL README TODO html +%config(noreplace) %attr(0600,root,root) %{_sysconfdir}/pdns/pdns.conf +%config(noreplace) %attr(0755,root,root) %{_initrddir}/pdns +%dir %{_sysconfdir}/pdns +%dir %attr(0755,pdns,pdns) /var/run/pdns-server +%{_bindir}/pdns_control +%{_bindir}/pdnssec +%{_sbindir}/pdns_server +%{_mandir}/man8/pdns_control.8* +%{_mandir}/man8/pdns_server.8* +%{_libdir}/libgeobackend.so +%{_libdir}/libgmysqlbackend.so +%{_libdir}/libpipebackend.so -%description -n pdns-tools -These are the tools