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/
35 # No paralilelism build.
38 configure_options += \
39 --sysconfdir=%{sysconfdir}/pdns \
40 --libdir=%{libdir}/powerdns \
42 --with-dynmodules="pipe geo gsqlite3" \
51 # Create directories for pdns sqlite db.
52 mkdir -p %{BUILDROOT}%{datadir}/pdns/
53 mkdir -p %{BUILDROOT}%{sharedstatedir}/pdns/
55 # Install shema for sqlite database.
56 install -m 0644 %{DIR_SOURCE}/pdns.table \
57 %{BUILDROOT}%{datadir}/pdns/pdns.table
59 # Install default configuration.
60 install -m 0644 %{DIR_SOURCE}/pdns.conf \
61 %{BUILDROOT}%{sysconfdir}/pdns/pdns.conf
62 rm -vf %{BUILDROOT}%{sysconfdir}/pdns/pdns.conf-dist
64 # Create empty database file.
65 touch %{BUILDROOT}%{sharedstatedir}/pdns/pdns.db
67 # Fix permissions and ownership from database.
68 chown -R pdns:pdns %{BUILDROOT}%{sharedstatedir}/pdns
69 chmod 660 %{BUILDROOT}%{sharedstatedir}/pdns/pdns.db
71 # Remove unneded binaries.
72 rm -vf %{BUILDROOT}%{bindir}/zone2ldap
74 # Remove rpath from binaries and backend libs.
75 chrpath --delete %{BUILDROOT}/usr/bin/pdns_control
76 chrpath --delete %{BUILDROOT}/usr/bin/zone2sql
77 chrpath --delete %{BUILDROOT}/usr/sbin/pdns_server
78 chrpath --delete %{BUILDROOT}%{libdir}/powerdns/*.so
79 chrpath --delete %{BUILDROOT}/usr/bin/dnsreplay
80 chrpath --delete %{BUILDROOT}/usr/bin/pdnssec
85 getent group pdns >/dev/null || groupadd -r pdns
86 getent passwd pdns >/dev/null || \
87 useradd -r -g pdns -d %{sharedstatedir}/pdns -s /sbin/nologin \
88 -c "PowerDNS user" pdns
100 pdns-recursor >= 3.3-8
104 %{sysconfdir}/pdns/pdns.conf
112 systemctl daemon-reload >/dev/null 2>&1 || :
114 # Check if DB allready exists. Create pdns sqlite database if not.
115 if [ ! -s "%{sharedstatedir}/pdns/pdns.db" ]; then
116 sqlite3 %{sharedstatedir}/pdns/pdns.db < %{datadir}/pdns/pdns.table
121 systemctl --no-reload disable pdns.service >/dev/null 2>&1 || :
122 systemctl stop pdns.service >/dev/null 2>&1 || :
124 # Backup existing database.
125 mv %{sharedstatedir}/pdns/pdns.db{,.bak}
129 systemctl daemon-reload >/dev/null 2>&1 || :
133 systemctl daemon-reload >/dev/null 2>&1 || :
134 systemctl try-restart pdns.service >/dev/null 2>&1 || :
138 package %{name}-debuginfo