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
37 # No paralilelism build.
40 configure_options += \
41 --sysconfdir=%{sysconfdir}/pdns \
42 --with-system-polarssl \
44 --with-dynmodules="pipe geo gsqlite3" \
59 # Create directories for pdns sqlite db.
60 mkdir -p %{BUILDROOT}%{datadir}/pdns/
61 mkdir -p %{BUILDROOT}%{sharedstatedir}/pdns/
63 # Install shema for sqlite database.
64 install -m 0644 %{DIR_SOURCE}/pdns.table \
65 %{BUILDROOT}%{datadir}/pdns/pdns.table
67 # Install default configuration.
68 install -m 0644 %{DIR_SOURCE}/pdns.conf \
69 %{BUILDROOT}%{sysconfdir}/pdns/pdns.conf
70 rm -vf %{BUILDROOT}%{sysconfdir}/pdns/pdns.conf-dist
72 # Create empty database file.
73 touch %{BUILDROOT}%{sharedstatedir}/pdns/pdns.db
75 # Fix permissions and ownership from database.
76 chown -R pdns:pdns %{BUILDROOT}%{sharedstatedir}/pdns
77 chmod 660 %{BUILDROOT}%{sharedstatedir}/pdns/pdns.db
79 # Remove unneded binaries.
80 rm -vf %{BUILDROOT}%{bindir}/zone2ldap
82 # Remove rpath from binaries and backend libs.
83 chrpath --delete %{BUILDROOT}/usr/bin/pdns_control
84 chrpath --delete %{BUILDROOT}/usr/bin/zone2sql
85 chrpath --delete %{BUILDROOT}/usr/sbin/pdns_server
86 chrpath --delete %{BUILDROOT}%{libdir}/pdns/*.so
87 chrpath --delete %{BUILDROOT}/usr/bin/dnsreplay
88 chrpath --delete %{BUILDROOT}/usr/bin/pdnssec
93 getent group pdns >/dev/null || groupadd -r pdns
94 getent passwd pdns >/dev/null || \
95 useradd -r -g pdns -d %{sharedstatedir}/pdns -s /sbin/nologin \
96 -c "PowerDNS user" pdns
108 %{sysconfdir}/pdns/pdns.conf
112 %{sharedstatedir}/pdns/pdns.db
120 systemctl daemon-reload >/dev/null 2>&1 || :
122 # Check if DB allready exists. Create pdns sqlite database if not.
123 if [ ! -s "%{sharedstatedir}/pdns/pdns.db" ]; then
124 sqlite3 %{sharedstatedir}/pdns/pdns.db < %{datadir}/pdns/pdns.table
129 systemctl --no-reload disable pdns.service >/dev/null 2>&1 || :
130 systemctl stop pdns.service >/dev/null 2>&1 || :
132 # Backup existing database.
133 mv %{sharedstatedir}/pdns/pdns.db{,.bak}
137 systemctl daemon-reload >/dev/null 2>&1 || :
141 systemctl daemon-reload >/dev/null 2>&1 || :
142 systemctl try-restart pdns.service >/dev/null 2>&1 || :
146 package %{name}-debuginfo