df9568a
%global backends %{nil}
df9568a
473c30f
Summary:	A modern, advanced and high performance authoritative-only nameserver
473c30f
Name:		pdns
d926ad4
Version:	3.0.1
d926ad4
Release:	1%{?dist}
473c30f
473c30f
Group:		System Environment/Daemons
b97d90b
License:	GPLv2
473c30f
URL:		http://powerdns.com
d926ad4
Source0:	ftp://training.powerdns.com/CVE-2004-0789/%{name}-%{version}.tar.gz
1e981e8
Source1:	pdns.service
1e981e8
Patch0:		pdns-fix-mongo-backend.patch
1e981e8
Patch1:		pdns-fix-lua-detection.patch
473c30f
1e981e8
Requires(pre):	shadow-utils
1e981e8
Requires(post):	systemd-units, systemd-sysv
d926ad4
Requires(preun):	systemd-units
d926ad4
Requires(postun):	systemd-units
f7a8198
1e981e8
BuildRequires:	boost-devel, chrpath, lua-devel, cryptopp-devel, systemd-units
473c30f
Provides:	powerdns = %{version}-%{release}
473c30f
473c30f
%description
473c30f
The PowerDNS Nameserver is a modern, advanced and high performance
473c30f
authoritative-only nameserver. It is written from scratch and conforms
473c30f
to all relevant DNS standards documents.
473c30f
Furthermore, PowerDNS interfaces with almost any database.
473c30f
473c30f
%package	backend-mysql
473c30f
Summary:	MySQL backend for %{name}
473c30f
Group:		System Environment/Daemons
1e981e8
Requires:	%{name}%{?_isa} = %{version}-%{release}
473c30f
BuildRequires:	mysql-devel
df9568a
%global backends %{backends} gmysql
473c30f
473c30f
%package	backend-postgresql
473c30f
Summary:	PostgreSQL backend for %{name}
473c30f
Group:		System Environment/Daemons
1e981e8
Requires:	%{name}%{?_isa} = %{version}-%{release}
473c30f
BuildRequires:	postgresql-devel
df9568a
%global backends %{backends} gpgsql
473c30f
473c30f
%package	backend-pipe
473c30f
Summary:	Pipe backend for %{name}
473c30f
Group:		System Environment/Daemons
1e981e8
Requires:	%{name}%{?_isa} = %{version}-%{release}
df9568a
%global backends %{backends} pipe
473c30f
473c30f
%package	backend-geo
473c30f
Summary:	Geo backend for %{name}
473c30f
Group:		System Environment/Daemons
1e981e8
Requires:	%{name}%{?_isa} = %{version}-%{release}
df9568a
%global backends %{backends} geo
473c30f
473c30f
%package	backend-ldap
473c30f
Summary:	LDAP backend for %{name}
473c30f
Group:		System Environment/Daemons
1e981e8
Requires:	%{name}%{?_isa} = %{version}-%{release}
473c30f
BuildRequires:	openldap-devel
df9568a
%global backends %{backends} ldap
473c30f
e54484b
%package	backend-sqlite
e54484b
Summary:	SQLite backend for %{name}
e54484b
Group:		System Environment/Daemons
1e981e8
Requires:	%{name}%{?_isa} = %{version}-%{release}
e54484b
BuildRequires:	sqlite-devel
df9568a
%global backends %{backends} gsqlite3
e54484b
df9568a
%ifarch %{ix86} x86_64
1e981e8
%package	backend-mongodb
1e981e8
Summary:	MongoDB backend for %{name}
1e981e8
Group:		System Environment/Daemons
1e981e8
Requires:	%{name}%{?_isa} = %{version}-%{release}
1e981e8
BuildRequires:	mongodb-devel
df9568a
%global backends %{backends} mongodb
df9568a
%endif
1e981e8
473c30f
%description	backend-mysql
473c30f
This package contains the gmysql backend for %{name}
473c30f
473c30f
%description	backend-postgresql
473c30f
This package contains the gpgsql backend for %{name}
473c30f
473c30f
%description	backend-pipe
473c30f
This package contains the pipe backend for %{name}
473c30f
473c30f
%description	backend-geo
473c30f
This package contains the geo backend for %{name}
473c30f
It allows different answers to DNS queries coming from different
473c30f
IP address ranges or based on the geographic location
473c30f
473c30f
%description	backend-ldap
473c30f
This package contains the ldap backend for %{name}
473c30f
e54484b
%description	backend-sqlite
e54484b
This package contains the SQLite backend for %{name}
e54484b
df9568a
%ifarch %{ix86} x86_64
1e981e8
%description	backend-mongodb
1e981e8
This package contains the MongoDB backend for %{name}
df9568a
%endif
1e981e8
473c30f
473c30f
%prep
a8bc0af
%setup -q
1e981e8
%patch0 -p1 -b .fixmongo
1e981e8
%patch1 -p1 -b .fixlua
473c30f
473c30f
%build
473c30f
export CPPFLAGS="-DLDAP_DEPRECATED %{optflags}"
473c30f
473c30f
%configure \
473c30f
	--sysconfdir=%{_sysconfdir}/%{name} \
473c30f
	--libdir=%{_libdir}/%{name} \
473c30f
	--disable-static \
473c30f
	--with-modules='' \
1e981e8
	--with-lua \
df9568a
	--with-dynmodules='%{backends}' \
1e981e8
	--enable-cryptopp
1e981e8
1e981e8
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
1e981e8
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
473c30f
473c30f
make %{?_smp_mflags}
473c30f
473c30f
%install
473c30f
make install DESTDIR=%{buildroot}
473c30f
473c30f
%{__rm} -f %{buildroot}%{_libdir}/%{name}/*.la
473c30f
%{__mv} %{buildroot}%{_sysconfdir}/%{name}/pdns.conf{-dist,}
473c30f
68ad749
# add the pdns user to the config file
68ad749
sed -i '1i\setuid=pdns' %{buildroot}%{_sysconfdir}/%{name}/pdns.conf
68ad749
sed -i '2i\setgid=pdns' %{buildroot}%{_sysconfdir}/%{name}/pdns.conf
68ad749
473c30f
# strip the static rpath from the binaries
473c30f
chrpath --delete %{buildroot}%{_bindir}/pdns_control
473c30f
chrpath --delete %{buildroot}%{_bindir}/zone2ldap
473c30f
chrpath --delete %{buildroot}%{_bindir}/zone2sql
473c30f
chrpath --delete %{buildroot}%{_sbindir}/pdns_server
473c30f
chrpath --delete %{buildroot}%{_libdir}/%{name}/*.so
473c30f
1e981e8
# Copy systemd service file
1e981e8
install -p -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/pdns.service
1e981e8
1e981e8
1e981e8
%pre
1e981e8
getent group pdns >/dev/null || groupadd -r pdns
1e981e8
getent passwd pdns >/dev/null || \
1e981e8
	useradd -r -g pdns -d / -s /sbin/nologin \
1e981e8
	-c "PowerDNS user" pdns
1e981e8
exit 0
1e981e8
1e981e8
473c30f
%post
68ad749
if [ $1 -eq 1 ]; then
1e981e8
	# Initial installation
1e981e8
	/bin/systemctl daemon-reload >/dev/null 2>&1 || :
473c30f
fi
1e981e8
1e981e8
473c30f
%preun
68ad749
if [ $1 -eq 0 ]; then
1e981e8
	# Package removal; not upgrade
1e981e8
	/bin/systemctl --no-reload disable pdns.service &>/dev/null || :
1e981e8
	/bin/systemctl stop pdns.service &>/dev/null || :
473c30f
fi
473c30f
1e981e8
1e981e8
%postun
1e981e8
/bin/systemctl daemon-reload &>/dev/null || :
1e981e8
if [ $1 -ge 1 ]; then
1e981e8
	# Package upgrade; not install
1e981e8
	/bin/systemctl try-restart pdns.service &>/dev/null || :
1e981e8
fi
1e981e8
1e981e8
1e981e8
%triggerun -- pdns < 3.0-rc3
1e981e8
# Save the current service runlevel info
1e981e8
# User must manually run systemd-sysv-convert --apply pdns
1e981e8
# to migrate them to systemd targets
1e981e8
%{_bindir}/systemd-sysv-convert --save pdns &>/dev/null ||:
1e981e8
1e981e8
# Run these because the SysV package being removed won't do them
1e981e8
/sbin/chkconfig --del pdns &>/dev/null || :
1e981e8
/bin/systemctl try-restart pdns.service &>/dev/null || :
1e981e8
473c30f
473c30f
%files
473c30f
%defattr(-,root,root,-)
1e981e8
%doc COPYING README
6b89186
%{_bindir}/dnsreplay
473c30f
%{_bindir}/pdns_control
6b89186
%{_bindir}/pdnssec
473c30f
%{_bindir}/zone2ldap
473c30f
%{_bindir}/zone2sql
473c30f
%{_sbindir}/pdns_server
473c30f
%{_mandir}/man8/pdns_control.8.gz
473c30f
%{_mandir}/man8/pdns_server.8.gz
473c30f
%{_mandir}/man8/zone2sql.8.gz
1e981e8
%{_unitdir}/pdns.service
473c30f
%dir %{_libdir}/%{name}/
473c30f
%dir %{_sysconfdir}/%{name}/
473c30f
%config(noreplace) %{_sysconfdir}/%{name}/pdns.conf
473c30f
473c30f
%files backend-mysql
473c30f
%defattr(-,root,root,-)
473c30f
%{_libdir}/%{name}/libgmysqlbackend.so
473c30f
473c30f
%files backend-postgresql
473c30f
%defattr(-,root,root,-)
473c30f
%{_libdir}/%{name}/libgpgsqlbackend.so
473c30f
473c30f
%files backend-pipe
473c30f
%defattr(-,root,root,-)
473c30f
%{_libdir}/%{name}/libpipebackend.so
473c30f
473c30f
%files backend-geo
473c30f
%defattr(-,root,root,-)
1e981e8
%doc modules/geobackend/README
473c30f
%{_libdir}/%{name}/libgeobackend.so
473c30f
473c30f
%files backend-ldap
473c30f
%defattr(-,root,root,-)
473c30f
%{_libdir}/%{name}/libldapbackend.so
473c30f
e54484b
%files backend-sqlite
e54484b
%defattr(-,root,root,-)
e54484b
%{_libdir}/%{name}/libgsqlite3backend.so
e54484b
df9568a
%ifarch %{ix86} x86_64
1e981e8
%files backend-mongodb
1e981e8
%defattr(-,root,root,-)
1e981e8
%{_libdir}/%{name}/libmongodbbackend.so
df9568a
%endif
1e981e8
473c30f
473c30f
%changelog
d926ad4
* Mon Jan 09 2012 Ruben Kerkhof 
d926ad4
- CVE-2012-0206
d926ad4
f0c3528
* Thu Dec 01 2011 Ruben Kerkhof <ruben@rubenkerkhof.com> 3.0-8
f0c3528
- Rebuilt for new boost
f0c3528
df9568a
* Sun Aug 07 2011 Dan Horák <dan@danny.cz> - 3.0-7
df9568a
- mongodb supports only x86
df9568a
a8bc0af
* Mon Jul 25 2011 Ruben Kerkhof <ruben@rubenkerkhof.com> 3.0-6
a8bc0af
- Upstream released new version
a8bc0af
1e981e8
* Wed Jul 20 2011 Ruben Kerkhof <ruben@rubenkerkhof.com> 3.0-5.rc3
1e981e8
- New release candidate
1e981e8
- Add MongoDB backend
1e981e8
- Enable LUA support
1e981e8
- Convert to systemd
1e981e8
1e981e8
* Sat Apr 09 2011 Ruben Kerkhof <ruben@rubenkerkhof.com> 3.0-4.pre.20110327.2103.fc16
4b8fb29
- Rebuilt for new boost
4b8fb29
6b89186
* Mon Mar 28 2011 Ruben Kerkhof <ruben@rubenkerkhof.com> 3.0-3.pre.20110327.2103
6b89186
- License file moved a directory up
6b89186
- Add pdnssec and dnsreplay commands
6b89186
9af8632
* Mon Mar 28 2011 Ruben Kerkhof <ruben@rubenkerkhof.com> 3.0-2.pre.20110327.2103
9af8632
- Add lua BuildRequires
9af8632
736f3d5
* Mon Mar 28 2011 Ruben Kerkhof <ruben@rubenkerkhof.com> 3.0-1.pre.20110327.2103
736f3d5
- Upstream released new pre-release version
736f3d5
- Now with DNSSEC support
736f3d5
- Drop merged patches
736f3d5
f572a95
* Wed Mar 23 2011 Dan Horák <dan@danny.cz> - 2.9.22-13
f572a95
- rebuilt for mysql 5.5.10 (soname bump in libmysqlclient)
f572a95
09e915c
* Wed Mar 23 2011 Ruben Kerkhof <ruben@rubenkerkhof.com> 2.9.22-12
09e915c
- Rebuilt for new mysqlclient
09e915c
70fe3c5
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9.22-11
70fe3c5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
70fe3c5
a09b593
* Tue Dec 14 2010 Ruben Kerkhof <ruben@rubenkerkhof.com> 2.9.22-10
a09b593
- Fix crash on SIGSTOP and SIGCONT, thanks to Anders Kaseorg (#652841)
a09b593
fdee565
* Thu Jan 14 2010 Ruben Kerkhof <ruben@rubenkerkhof.com> 2.9.22-9
fdee565
- Fix changelog entry
fdee565
fdee565
* Thu Jan 14 2010 Ruben Kerkhof <ruben@rubenkerkhof.com> 2.9.22-8
5e17938
- Fix postgres lib detection (#555462)
5e17938
da6781e
* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 2.9.22-7
da6781e
- rebuilt with new openssl
da6781e
84a7419
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9.22-6
84a7419
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
84a7419
2fd8544
* Thu Feb 26 2009 Ruben Kerkhof <ruben@rubenkerkhof.com> - 2.9.22-5
2fd8544
- Fix build with gcc4.4
2fd8544
979f8bd
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9.22-4
979f8bd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
979f8bd
77f1870
* Mon Jan 26 2009 Ruben Kerkhof <ruben@rubenkerkhof.com> 2.9.22-3
77f1870
- Upstream released new version
77f1870
b162494
* Fri Jan 23 2009 Ruben Kerkhof <ruben@rubenkerkhof.com> 2.9.22-2.rc3
b162494
- Rebuild for new libmysqlclient
b162494
32592d1
* Mon Jan 19 2009 Ruben Kerkhof <ruben@rubenkerkhof.com> 2.9.22-1.rc3
32592d1
- New release candidate
32592d1
853569f
* Wed Dec 03 2008 Ruben Kerkhof <ruben@rubenkerkhof.com> 2.9.22-1.rc2
32592d1
- Upstream released new release candidate
853569f
- Drop patches which are upstreamed
853569f
17abdeb
* Mon Nov 17 2008 Ruben Kerkhof <ruben@rubenkerkhof.com> 2.9.21.2-1
17abdeb
- Upstream released new version
17abdeb
caffe82
* Fri Sep 12 2008 Ruben Kerkhof <ruben@rubenkerkhof.com> 2.9.21.1-2
caffe82
- Fix handling of AAAA records (bz #461768)
caffe82
0aaaaec
* Wed Aug 06 2008 Ruben Kerkhof <ruben@rubenkerkhof.com> 2.9.21.1-1
0aaaaec
- CVE-2008-3337
0aaaaec
bb7118c
* Sat Feb 09 2008 Ruben Kerkhof <ruben@rubenkerkhof.com> 2.9.21-4
bb7118c
- GCC 4.3 fixes
bb7118c
95a29d0
* Wed Dec 05 2007 Ruben Kerkhof <ruben@rubenkerkhof.com> 2.9.21-3
cb1513e
- Rebuild to pick up new openldap
cb1513e
b97d90b
* Tue Sep 11 2007 Ruben Kerkhof <ruben@rubenkerkhof.com> 2.9.21-2
b97d90b
- Fix license tag
b97d90b
- Add README for geo backend to docs
e54484b
* Tue Apr 24 2007 Ruben Kerkhof <ruben@rubenkerkhof.com> 2.9.21-1
e54484b
- Upstream released 2.9.21
e54484b
- Enabled new SQLite backend
f7a8198
* Thu Apr 10 2007 <ruben@rubenkerkhof.com> 2.9.20-9
f7a8198
- Add Requires for chkconfig, service and useradd (#235582)
68ad749
* Mon Jan 1 2007 <ruben@rubenkerkhof.com> 2.9.20-8
68ad749
- Add the pdns user and group to the config file
68ad749
- Don't restart pdns on an upgrade
68ad749
- Minor cleanups in scriptlets
f19e2a7
* Mon Jan 1 2007 <ruben@rubenkerkhof.com> 2.9.20-7
f19e2a7
- Fixed typo in scriptlet
03bc80f
* Mon Jan 1 2007 <ruben@rubenkerkhof.com> 2.9.20-6
03bc80f
- Check if user pdns exists before adding it
473c30f
* Sat Dec 30 2006 <ruben@rubenkerkhof.com> 2.9.20-5
473c30f
- Strip rpath from the backends as well
473c30f
* Fri Dec 29 2006 <ruben@rubenkerkhof.com> 2.9.20-4
473c30f
- Disable rpath
473c30f
* Thu Dec 28 2006 <ruben@rubenkerkhof.com> 2.9.20-3
473c30f
- More fixes as per review #219973
473c30f
* Wed Dec 27 2006 <ruben@rubenkerkhof.com> 2.9.20-2
473c30f
- A few changes for FE review (bz #219973):
473c30f
- Renamed package to pdns, since that's how upstream calls it
473c30f
- Removed calls to ldconfig
473c30f
- Subpackages now require %%{version}-%%{release}
473c30f
* Sat Dec 16 2006 <ruben@rubenkerkhof.com> 2.9.20-1
473c30f
- Initial import
473c30f