New release candidate

Add MongoDB backend
Enable LUA support
Convert to systemd
This commit is contained in:
Ruben 2011-07-20 17:07:05 +02:00
parent 4b8fb29169
commit 1e981e8fef
7 changed files with 132 additions and 65 deletions

2
.gitignore vendored
View File

@ -1,2 +1,4 @@
pdns-2.9.22.tar.gz
/pdns-3.0-pre.20110327.2103.tar.gz
/pdns-3.0-rc2.tar.gz
/pdns-3.0-rc3.tar.gz

View File

@ -0,0 +1,12 @@
diff -up pdns-3.0-rc3/configure.orig pdns-3.0-rc3/configure
--- pdns-3.0-rc3/configure.orig 2011-07-20 14:09:39.960000514 +0200
+++ pdns-3.0-rc3/configure 2011-07-20 14:09:46.288007162 +0200
@@ -16494,7 +16494,7 @@ $as_echo_n "checking if with lua... " >&
# Check whether --with-lua was given.
if test "${with_lua+set}" = set; then :
- withval=$with_lua; WITH_LUA=$withval]
+ withval=$with_lua; WITH_LUA=$withval
else
WITH_LUA=yes
fi

View File

@ -0,0 +1,16 @@
diff -up pdns-3.0-rc3/modules/mongodbbackend/Makefile.in.orig pdns-3.0-rc3/modules/mongodbbackend/Makefile.in
--- pdns-3.0-rc3/modules/mongodbbackend/Makefile.in.orig 2011-07-20 14:41:20.181000073 +0200
+++ pdns-3.0-rc3/modules/mongodbbackend/Makefile.in 2011-07-20 14:41:45.191996169 +0200
@@ -256,10 +256,10 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CPPFLAGS = @THREADFLAGS@
EXTRA_DIST = OBJECTFILES OBJECTLIBS
-INCLUDES = -I/opt/mongo/include/mongo/
+INCLUDES = -I/usr/include/mongo/
lib_LTLIBRARIES = libmongodbbackend.la
libmongodbbackend_la_SOURCES = mongodbbackend.cc mongodbbackend.hh minimal.cc slave.cc master.cc reload.cc private.cc dnssec.cc supermaster.cc crc32.cc
-libmongodbbackend_la_LDFLAGS = -module -avoid-version -L/opt/mongo/lib64 $(BOOST_THREAD_LDFLAGS) $(BOOST_FILESYSTEM_LDFLAGS) $(BOOST_SYSTEM_LDFLAGS) -lmongoclient $(BOOST_THREAD_LIBS) $(BOOST_FILESYSTEM_LIBS) $(BOOST_SYSTEM_LIBS)
+libmongodbbackend_la_LDFLAGS = -module -avoid-version $(BOOST_THREAD_LDFLAGS) $(BOOST_FILESYSTEM_LDFLAGS) $(BOOST_SYSTEM_LDFLAGS) -lmongoclient $(BOOST_THREAD_LIBS) $(BOOST_FILESYSTEM_LIBS) $(BOOST_SYSTEM_LIBS)
all: all-am
.SUFFIXES:

View File

@ -1,22 +0,0 @@
diff -up pdns-3.0-pre.20110327.2103/configure.orig pdns-3.0-pre.20110327.2103/configure
--- pdns-3.0-pre.20110327.2103/configure.orig 2011-03-28 09:44:22.690000393 +0200
+++ pdns-3.0-pre.20110327.2103/configure 2011-03-28 09:46:26.822000001 +0200
@@ -18224,7 +18224,7 @@ if test "${with_pgsql+set}" = set; then
withval=$with_pgsql; PGSQL_lib_check="$withval/lib/pgsql $with_pgsql/lib"
PGSQL_inc_check="$withval/include/pgsql"
else
- PGSQL_lib_check="/usr/local/pgsql/lib/pgsql /usr/local/lib/pgsql /opt/pgsql/lib/pgsql /usr/lib/pgsql /usr/local/pgsql/lib /usr/local/lib /opt/pgsql/lib /usr/lib"
+ PGSQL_lib_check="/usr/local/pgsql/lib/pgsql /usr/local/lib/pgsql /opt/pgsql/lib/pgsql /usr/lib/pgsql /usr/local/pgsql/lib /usr/local/lib /opt/pgsql/lib /usr/lib /usr/lib64"
PGSQL_inc_check="/usr/local/pgsql/include/pgsql /usr/include /usr/local/include/postgresql/ /usr/local/include /opt/pgsql/include/pgsql /opt/pgsql/include /usr/include/pgsql/ /usr/include/postgresql"
fi
@@ -18244,8 +18244,7 @@ fi
$as_echo_n "checking for PgSQL library directory... " >&6; }
PGSQL_libdir=
for m in $PGSQL_lib_check; do
- if test -d "$m" && \
- (test -f "$m/libpq.a" || test -f "$m/libpq++.a")
+ if test -d "$m" && test -f "$m/libpq.so"
then
PGSQL_libdir=$m
break

13
pdns.service Normal file
View File

@ -0,0 +1,13 @@
[Unit]
Description=PDNS DNS Server
After=syslog.target network.target
[Service]
Type=forking
ExecStart=/usr/sbin/pdns_server --daemon --guardian=yes
ExecReload=/usr/bin/pdns_control cycle
ExecStop=/usr/bin/pdns_control quit
[Install]
WantedBy=multi-user.target

130
pdns.spec
View File

@ -1,22 +1,24 @@
%global alphatag pre.20110327.2103
%global alphatag rc3
Summary: A modern, advanced and high performance authoritative-only nameserver
Name: pdns
Version: 3.0
Release: 4.%{alphatag}%{?dist}
Release: 5.%{alphatag}%{?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}-%{alphatag}.tar.gz
Patch0: %{name}-fixinit.patch
Patch1: pdns-fix-postgres-detection.patch
Source1: pdns.service
Patch0: pdns-fix-mongo-backend.patch
Patch1: pdns-fix-lua-detection.patch
Requires(post): %{_sbindir}/useradd, /sbin/chkconfig
Requires(preun): /sbin/service, /sbin/chkconfig
Requires(pre): shadow-utils
Requires(post): systemd-units, systemd-sysv
Requires(preun): systemd-units
Requires(postun): systemd-units
BuildRequires: boost-devel, chrpath, lua-devel
BuildRequires: boost-devel, chrpath, lua-devel, cryptopp-devel, systemd-units
Provides: powerdns = %{version}-%{release}
%description
@ -28,37 +30,43 @@ Furthermore, PowerDNS interfaces with almost any database.
%package backend-mysql
Summary: MySQL backend for %{name}
Group: System Environment/Daemons
Requires: %{name} = %{version}-%{release}
Requires: %{name}%{?_isa} = %{version}-%{release}
BuildRequires: mysql-devel
%package backend-postgresql
Summary: PostgreSQL backend for %{name}
Group: System Environment/Daemons
Requires: %{name} = %{version}-%{release}
Requires: %{name}%{?_isa} = %{version}-%{release}
BuildRequires: postgresql-devel
%package backend-pipe
Summary: Pipe backend for %{name}
Group: System Environment/Daemons
Requires: %{name} = %{version}-%{release}
Requires: %{name}%{?_isa} = %{version}-%{release}
%package backend-geo
Summary: Geo backend for %{name}
Group: System Environment/Daemons
Requires: %{name} = %{version}-%{release}
Requires: %{name}%{?_isa} = %{version}-%{release}
%package backend-ldap
Summary: LDAP backend for %{name}
Group: System Environment/Daemons
Requires: %{name} = %{version}-%{release}
Requires: %{name}%{?_isa} = %{version}-%{release}
BuildRequires: openldap-devel
%package backend-sqlite
Summary: SQLite backend for %{name}
Group: System Environment/Daemons
Requires: %{name} = %{version}-%{release}
Requires: %{name}%{?_isa} = %{version}-%{release}
BuildRequires: sqlite-devel
%package backend-mongodb
Summary: MongoDB backend for %{name}
Group: System Environment/Daemons
Requires: %{name}%{?_isa} = %{version}-%{release}
BuildRequires: mongodb-devel
%description backend-mysql
This package contains the gmysql backend for %{name}
@ -79,11 +87,14 @@ This package contains the ldap backend for %{name}
%description backend-sqlite
This package contains the SQLite backend for %{name}
%description backend-mongodb
This package contains the MongoDB backend for %{name}
%prep
%setup -q -n %{name}-%{version}-%{alphatag}
%patch0 -p1 -b .fixinit
%patch1 -p1 -b .postgres
%patch0 -p1 -b .fixmongo
%patch1 -p1 -b .fixlua
%build
export CPPFLAGS="-DLDAP_DEPRECATED %{optflags}"
@ -93,18 +104,19 @@ export CPPFLAGS="-DLDAP_DEPRECATED %{optflags}"
--libdir=%{_libdir}/%{name} \
--disable-static \
--with-modules='' \
--with-dynmodules='pipe gmysql gpgsql geo ldap gsqlite3' \
--with-mysql-lib=%{_libdir}/mysql \
--with-sqlite3-lib=%{_libdir}
--with-lua \
--with-dynmodules='pipe gmysql gpgsql geo ldap gsqlite3 mongodb' \
--enable-cryptopp
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make %{?_smp_mflags}
%install
%{__rm} -rf %{buildroot}
make install DESTDIR=%{buildroot}
%{__rm} -f %{buildroot}%{_libdir}/%{name}/*.la
%{__install} -p -D -m 0755 pdns/pdns %{buildroot}%{_initrddir}/pdns
%{__mv} %{buildroot}%{_sysconfdir}/%{name}/pdns.conf{-dist,}
# add the pdns user to the config file
@ -118,26 +130,55 @@ chrpath --delete %{buildroot}%{_bindir}/zone2sql
chrpath --delete %{buildroot}%{_sbindir}/pdns_server
chrpath --delete %{buildroot}%{_libdir}/%{name}/*.so
# Copy systemd service file
install -p -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/pdns.service
%pre
getent group pdns >/dev/null || groupadd -r pdns
getent passwd pdns >/dev/null || \
useradd -r -g pdns -d / -s /sbin/nologin \
-c "PowerDNS user" pdns
exit 0
%post
if [ $1 -eq 1 ]; then
/sbin/chkconfig --add pdns
userid=`id -u pdns 2>/dev/null`
if [ x"$userid" = x ]; then
%{_sbindir}/useradd -c "PowerDNS user" -s /sbin/nologin -r -d / pdns > /dev/null || :
fi
fi
%preun
if [ $1 -eq 0 ]; then
/sbin/service pdns stop >/dev/null 2>&1 || :
/sbin/chkconfig --del pdns
# Initial installation
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
%clean
%{__rm} -rf %{buildroot}
%preun
if [ $1 -eq 0 ]; then
# Package removal; not upgrade
/bin/systemctl --no-reload disable pdns.service &>/dev/null || :
/bin/systemctl stop pdns.service &>/dev/null || :
fi
%postun
/bin/systemctl daemon-reload &>/dev/null || :
if [ $1 -ge 1 ]; then
# Package upgrade; not install
/bin/systemctl try-restart pdns.service &>/dev/null || :
fi
%triggerun -- pdns < 3.0-rc3
# Save the current service runlevel info
# User must manually run systemd-sysv-convert --apply pdns
# to migrate them to systemd targets
%{_bindir}/systemd-sysv-convert --save pdns &>/dev/null ||:
# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del pdns &>/dev/null || :
/bin/systemctl try-restart pdns.service &>/dev/null || :
%files
%defattr(-,root,root,-)
%doc ChangeLog TODO pdns
%doc COPYING README
%{_bindir}/dnsreplay
%{_bindir}/pdns_control
%{_bindir}/pdnssec
@ -147,44 +188,49 @@ fi
%{_mandir}/man8/pdns_control.8.gz
%{_mandir}/man8/pdns_server.8.gz
%{_mandir}/man8/zone2sql.8.gz
%{_initrddir}/pdns
%{_unitdir}/pdns.service
%dir %{_libdir}/%{name}/
%dir %{_sysconfdir}/%{name}/
%config(noreplace) %{_sysconfdir}/%{name}/pdns.conf
%files backend-mysql
%defattr(-,root,root,-)
%doc COPYING
%{_libdir}/%{name}/libgmysqlbackend.so
%files backend-postgresql
%defattr(-,root,root,-)
%doc COPYING
%{_libdir}/%{name}/libgpgsqlbackend.so
%files backend-pipe
%defattr(-,root,root,-)
%doc COPYING
%{_libdir}/%{name}/libpipebackend.so
%files backend-geo
%defattr(-,root,root,-)
%doc COPYING modules/geobackend/README
%doc modules/geobackend/README
%{_libdir}/%{name}/libgeobackend.so
%files backend-ldap
%defattr(-,root,root,-)
%doc COPYING
%{_libdir}/%{name}/libldapbackend.so
%files backend-sqlite
%defattr(-,root,root,-)
%doc COPYING
%{_libdir}/%{name}/libgsqlite3backend.so
%files backend-mongodb
%defattr(-,root,root,-)
%{_libdir}/%{name}/libmongodbbackend.so
%changelog
* Sat Apr 09 2011 Ruben Kerkhof <ruben@rubenkerkhof.com> 3.0-4.
* Wed Jul 20 2011 Ruben Kerkhof <ruben@rubenkerkhof.com> 3.0-5.rc3
- New release candidate
- Add MongoDB backend
- Enable LUA support
- Convert to systemd
* Sat Apr 09 2011 Ruben Kerkhof <ruben@rubenkerkhof.com> 3.0-4.pre.20110327.2103.fc16
- Rebuilt for new boost
* Mon Mar 28 2011 Ruben Kerkhof <ruben@rubenkerkhof.com> 3.0-3.pre.20110327.2103

View File

@ -1 +1 @@
b4ea207b6c43d0f39c96d3156f5fba95 pdns-3.0-pre.20110327.2103.tar.gz
c77a88084c6d33c3b028482c511f80a4 pdns-3.0-rc3.tar.gz