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/
36 # No paralilelism build.
39 configure_options += \
40 --sysconfdir=%{sysconfdir}/pdns \
41 --libdir=%{libdir}/powerdns \
42 --with-system-polarssl \
44 --with-dynmodules="pipe geo gsqlite3" \
54 # Create directories for pdns sqlite db.
55 mkdir -p %{BUILDROOT}%{datadir}/pdns/
56 mkdir -p %{BUILDROOT}%{sharedstatedir}/pdns/
58 # Install shema for sqlite database.
59 install -m 0644 %{DIR_SOURCE}/pdns.table \
60 %{BUILDROOT}%{datadir}/pdns/pdns.table
62 # Install default configuration.
63 install -m 0644 %{DIR_SOURCE}/pdns.conf \
64 %{BUILDROOT}%{sysconfdir}/pdns/pdns.conf
65 rm -vf %{BUILDROOT}%{sysconfdir}/pdns/pdns.conf-dist
67 # Create empty database file.
68 touch %{BUILDROOT}%{sharedstatedir}/pdns/pdns.db
70 # Fix permissions and ownership from database.
71 chown -R pdns:pdns %{BUILDROOT}%{sharedstatedir}/pdns
72 chmod 660 %{BUILDROOT}%{sharedstatedir}/pdns/pdns.db
74 # Remove unneded binaries.
75 rm -vf %{BUILDROOT}%{bindir}/zone2ldap
77 # Remove rpath from binaries and backend libs.
78 chrpath --delete %{BUILDROOT}/usr/bin/pdns_control
79 chrpath --delete %{BUILDROOT}/usr/bin/zone2sql
80 chrpath --delete %{BUILDROOT}/usr/sbin/pdns_server
81 chrpath --delete %{BUILDROOT}%{libdir}/powerdns/*.so
82 chrpath --delete %{BUILDROOT}/usr/bin/dnsreplay
83 chrpath --delete %{BUILDROOT}/usr/bin/pdnssec
88 getent group pdns >/dev/null || groupadd -r pdns
89 getent passwd pdns >/dev/null || \
90 useradd -r -g pdns -d %{sharedstatedir}/pdns -s /sbin/nologin \
91 -c "PowerDNS user" pdns
103 pdns-recursor >= 3.3-8
107 %{sysconfdir}/pdns/pdns.conf
111 %{sharedstatedir}/pdns/pdns.db
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