1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
9 thisapp = %{name}-%{version}
11 groups = Networking/DNS
12 url = http://powerdns.com/
14 summary = A modern, advanced and high performance authoritative-only nameserver.
17 The PowerDNS Nameserver is a modern, advanced and high performance
18 authoritative-only nameserver. It is written from scratch and conforms
19 to all relevant DNS standards documents.
20 Furthermore, PowerDNS interfaces with almost any database.
23 source_dl = http://downloads.powerdns.com/releases/
24 sources = %{thisapp}.tar.bz2
42 # No paralilelism build.
45 configure_options += \
46 --sysconfdir=%{sysconfdir}/pdns \
47 --libdir=%{libdir}/powerdns \
49 --with-dynmodules="pipe gsqlite3" \
67 # Create directories for pdns sqlite db.
68 mkdir -p %{BUILDROOT}%{datadir}/pdns/
69 mkdir -p %{BUILDROOT}%{sharedstatedir}/pdns/
71 # Install shema for sqlite database.
72 install -m 0644 %{DIR_SOURCE}/pdns.table \
73 %{BUILDROOT}%{datadir}/pdns/pdns.table
75 # Install default configuration.
76 install -m 0644 %{DIR_SOURCE}/pdns.conf \
77 %{BUILDROOT}%{sysconfdir}/pdns/pdns.conf
78 rm -vf %{BUILDROOT}%{sysconfdir}/pdns/pdns.conf-dist
80 # Create empty database file.
81 touch %{BUILDROOT}%{sharedstatedir}/pdns/pdns.db
83 # Fix permissions and ownership from database.
84 chown -R pdns:pdns %{BUILDROOT}%{sharedstatedir}/pdns
85 chmod 660 %{BUILDROOT}%{sharedstatedir}/pdns/pdns.db
87 # Remove unneded binaries.
88 rm -vf %{BUILDROOT}%{bindir}/zone2ldap
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