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/
39 # No paralilelism build.
42 configure_options += \
43 --sysconfdir=%{sysconfdir}/pdns \
44 --libdir=%{libdir}/powerdns \
46 --with-dynmodules="pipe geo gsqlite3" \
51 # Regenerate build system.
58 # Create directories for pdns sqlite db.
59 mkdir -p %{BUILDROOT}%{datadir}/pdns/
60 mkdir -p %{BUILDROOT}%{sharedstatedir}/pdns/
62 # Install shema for sqlite database.
63 install -m 0644 %{DIR_SOURCE}/pdns.table \
64 %{BUILDROOT}%{datadir}/pdns/pdns.table
66 # Install default configuration.
67 install -m 0644 %{DIR_SOURCE}/pdns.conf \
68 %{BUILDROOT}%{sysconfdir}/pdns/pdns.conf
69 rm -vf %{BUILDROOT}%{sysconfdir}/pdns/pdns.conf-dist
71 # Create empty database file.
72 touch %{BUILDROOT}%{sharedstatedir}/pdns/pdns.db
74 # Fix permissions and ownership from database.
75 chown -R pdns:pdns %{BUILDROOT}%{sharedstatedir}/pdns
76 chmod 660 %{BUILDROOT}%{sharedstatedir}/pdns/pdns.db
78 # Remove unneded binaries.
79 rm -vf %{BUILDROOT}%{bindir}/zone2ldap
81 # Remove rpath from binaries and backend libs.
82 chrpath --delete %{BUILDROOT}/usr/bin/pdns_control
83 chrpath --delete %{BUILDROOT}/usr/bin/zone2sql
84 chrpath --delete %{BUILDROOT}/usr/sbin/pdns_server
85 chrpath --delete %{BUILDROOT}%{libdir}/powerdns/*.so
86 chrpath --delete %{BUILDROOT}/usr/bin/dnsreplay
87 chrpath --delete %{BUILDROOT}/usr/bin/pdnssec
92 getent group pdns >/dev/null || groupadd -r pdns
93 getent passwd pdns >/dev/null || \
94 useradd -r -g pdns -d %{sharedstatedir}/pdns -s /sbin/nologin \
95 -c "PowerDNS user" pdns
107 pdns-recursor >= 3.3-8
111 %{sysconfdir}/pdns/pdns.conf
119 systemctl daemon-reload >/dev/null 2>&1 || :
121 # Check if DB allready exists. Create pdns sqlite database if not.
122 if [ ! -s "%{sharedstatedir}/pdns/pdns.db" ]; then
123 sqlite3 %{sharedstatedir}/pdns/pdns.db < %{datadir}/pdns/pdns.table
128 systemctl --no-reload disable pdns.service >/dev/null 2>&1 || :
129 systemctl stop pdns.service >/dev/null 2>&1 || :
131 # Backup existing database.
132 mv %{sharedstatedir}/pdns/pdns.db{,.bak}
136 systemctl daemon-reload >/dev/null 2>&1 || :
140 systemctl daemon-reload >/dev/null 2>&1 || :
141 systemctl try-restart pdns.service >/dev/null 2>&1 || :
145 package %{name}-debuginfo