1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
10 groups = Networking/DNS
11 url = http://powerdns.com/
13 summary = A modern, advanced and high performance authoritative-only nameserver.
16 The PowerDNS Nameserver is a modern, advanced and high performance
17 authoritative-only nameserver. It is written from scratch and conforms
18 to all relevant DNS standards documents.
19 Furthermore, PowerDNS interfaces with almost any database.
22 source_dl = http://downloads.powerdns.com/releases/
23 sources = %{thisapp}.tar.bz2
26 # pdns uses polarssl which is no longer maintained
27 # upstream any more. Since nothing else is using
28 # polarssl any more we have dropped this from the
29 # distribution and bundle it with pdns.
41 # No paralilelism build.
44 configure_options += \
45 --sysconfdir=%{sysconfdir}/pdns \
47 --with-dynmodules="pipe geo gsqlite3" \
62 # Create directories for pdns sqlite db.
63 mkdir -p %{BUILDROOT}%{datadir}/pdns/
64 mkdir -p %{BUILDROOT}%{sharedstatedir}/pdns/
66 # Install shema for sqlite database.
67 install -m 0644 %{DIR_SOURCE}/pdns.table \
68 %{BUILDROOT}%{datadir}/pdns/pdns.table
70 # Install default configuration.
71 install -m 0644 %{DIR_SOURCE}/pdns.conf \
72 %{BUILDROOT}%{sysconfdir}/pdns/pdns.conf
73 rm -vf %{BUILDROOT}%{sysconfdir}/pdns/pdns.conf-dist
75 # Create empty database file.
76 touch %{BUILDROOT}%{sharedstatedir}/pdns/pdns.db
78 # Fix permissions and ownership from database.
79 chown -R pdns:pdns %{BUILDROOT}%{sharedstatedir}/pdns
80 chmod 660 %{BUILDROOT}%{sharedstatedir}/pdns/pdns.db
82 # Remove unneded binaries.
83 rm -vf %{BUILDROOT}%{bindir}/zone2ldap
85 # Remove rpath from binaries and backend libs.
86 chrpath --delete %{BUILDROOT}/usr/bin/pdns_control
87 chrpath --delete %{BUILDROOT}/usr/bin/zone2sql
88 chrpath --delete %{BUILDROOT}/usr/sbin/pdns_server
89 chrpath --delete %{BUILDROOT}%{libdir}/pdns/*.so
90 chrpath --delete %{BUILDROOT}/usr/bin/dnsreplay
91 chrpath --delete %{BUILDROOT}/usr/bin/pdnssec
96 getent group pdns >/dev/null || groupadd -r pdns
97 getent passwd pdns >/dev/null || \
98 useradd -r -g pdns -d %{sharedstatedir}/pdns -s /sbin/nologin \
99 -c "PowerDNS user" pdns
111 %{sysconfdir}/pdns/pdns.conf
115 %{sharedstatedir}/pdns/pdns.db
123 systemctl daemon-reload >/dev/null 2>&1 || :
125 # Check if DB allready exists. Create pdns sqlite database if not.
126 if [ ! -s "%{sharedstatedir}/pdns/pdns.db" ]; then
127 sqlite3 %{sharedstatedir}/pdns/pdns.db < %{datadir}/pdns/pdns.table
132 systemctl --no-reload disable pdns.service >/dev/null 2>&1 || :
133 systemctl stop pdns.service >/dev/null 2>&1 || :
135 # Backup existing database.
136 mv %{sharedstatedir}/pdns/pdns.db{,.bak}
140 systemctl daemon-reload >/dev/null 2>&1 || :
144 systemctl daemon-reload >/dev/null 2>&1 || :
145 systemctl try-restart pdns.service >/dev/null 2>&1 || :
149 package %{name}-debuginfo