Blob Blame History Raw
Summary:		Modern, advanced and high performance recursing/non authoritative nameserver
Name:			pdns-recursor
Version:		3.1.7.1
Release:		2%{?dist}
Group:			System Environment/Daemons
License:		GPLv2
URL:			http://powerdns.com
BuildRoot:		%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Source0:		http://downloads.powerdns.com/releases/%{name}-%{version}.tar.bz2
Source1:		pdns-recursor.init	

Patch0:			pdns-recursor-fixmakefile.patch
Patch1:			pdns-recursor-fixsysconfdir.patch

Provides:		powerdns-recursor = %{version}-%{release}
BuildRequires:		boost-devel, lua-devel
Requires(post):		/sbin/chkconfig
Requires(preun):	/sbin/chkconfig, /sbin/service

%description
PowerDNS Recursor is a non authoritative/recursing DNS server. Use this
package if you need a dns cache for your network.

%prep
%setup -q
%patch0 -p1 -b .fixmakefile
%patch1 -p1 -b .fixsysconfdir

%build
LUA=1 LUA_CPPFLAGS_CONFIG= LUA_LIBS_CONFIG=-llua OPTFLAGS="%{optflags}" make %{?_smp_mflags}


%install
%{__rm} -rf %{buildroot}
make install DESTDIR=%{buildroot} CONFIGDIR="%{_sysconfdir}/%{name}"
%{__install} -D -p %{SOURCE1} %{buildroot}%{_initrddir}/pdns-recursor

%{__mv} %{buildroot}%{_sysconfdir}/%{name}/recursor.conf{-dist,}

# add pdns user and group to top of configfile
sed -i '1i\setuid=pdns-recursor' %{buildroot}%{_sysconfdir}/%{name}/recursor.conf
sed -i '2i\setgid=pdns-recursor' %{buildroot}%{_sysconfdir}/%{name}/recursor.conf

%post
if [ $1 -eq 1 ]; then
	/sbin/chkconfig --add %{name}
	userid=`id -u pdns-recursor 2>/dev/null`
	if [ x"$userid" = x ]; then
		%{_sbindir}/useradd -c "PowerDNS Recursor user" -s /sbin/nologin -r -d / pdns-recursor >/dev/null 2>&1 || :
	fi
fi
%preun
if [ $1 -eq 0 ]; then
	/sbin/service %{name} stop >/dev/null 2>&1 || :
	/sbin/chkconfig --del %{name}
fi

%postun
if [ $1 -ge 1 ]; then
	/sbin/service %{name} condrestart >/dev/null 2>&1 || :
fi

%clean
%{__rm} -rf %{buildroot}

%files
%defattr(-,root,root,-)
%{_bindir}/rec_control
%{_sbindir}/pdns_recursor
%{_mandir}/man1/pdns_recursor.1.gz
%{_mandir}/man1/rec_control.1.gz
%{_initrddir}/pdns-recursor
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/recursor.conf
%doc COPYING README


%changelog
* Mon Aug 10 2009 Ruben Kerkhof <ruben@rubenkerkhof.com> - 3.1.7.1-2
- Re-add accidently dropped patch (#516562)

* Mon Aug 03 2009 Ruben Kerkhof <ruben@rubenkerkhof.com> - 3.1.7.1-1
- Upstream released new version
- Drop patches included upstream

* Fri Feb 27 2009 Ruben Kerkhof <ruben@rubenkerkhof.com> - 3.1.7-4
- Fix errors with newer Boost
- Fix build with gcc4.4

* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.7-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Thu Jul 24 2008 Ruben Kerkhof <ruben@rubenkerkhof.com> - 3.1.7-2
- Use OPTFLAGS because CXXFLAGS overrides the defaults

* Thu Jul 24 2008 Ruben Kerkhof <ruben@rubenkerkhof.com> - 3.1.7-1
- Upstream released new version, now with Lua support

* Sun May 11 2008 Ruben Kerkhof <ruben@rubenkerkhof.com> - 3.1.6
- Upstream released new version

* Wed Apr 02 2008 Ruben Kerkhof <ruben@rubenkerkhof.com> - 3.1.5
- Upstream released new version

* Sat Feb 16 2008 Ruben Kerkhof <ruben@rubenkerkhof.com> - 3.1.5-0.1.snapshot4
- Snapshot 4
- Drop gcc 4.3 patch, fixed upstream

* Sat Feb 09 2008 Ruben Kerkhof <ruben@rubenkerkhof.com> - 3.1.5-0.1.snapshot3
- Sync with upstream
- Compile fixes for gcc43

* Sun Jan 27 2007 <ruben@rubenkerkhof.com> 3.1.4-4
- Now really fix the description in init script
* Sat Jan 27 2007 <ruben@rubenkerkhof.com> 3.1.4-3
- Fixed Description in init script
* Wed Jan 24 2007 <ruben@rubenkerkhof.com> 3.1.4-2
- Fixes per bz review 221188:
- Changed user to pdns-recursor
- Patched the Makefile to not strip debugsymbols
- Skipped the configure step, it didn't do much
- Added a more Fedora-centric initscript
- Use condrestart instead of restart in %%postun
* Sun Dec 31 2006 <ruben@rubenkerkhof.com> 3.1.4-1
- Initial import