149 lines
3.4 KiB
Plaintext
149 lines
3.4 KiB
Plaintext
###############################################################################
|
|
# IPFire.org - An Open Source Firewall Solution #
|
|
# Copyright (C) - IPFire Development Team <info@ipfire.org> #
|
|
###############################################################################
|
|
|
|
name = pdns
|
|
version = 4.7.3
|
|
release = 1
|
|
thisapp = %{name}-%{version}
|
|
|
|
groups = Networking/DNS
|
|
url = https://powerdns.com/
|
|
license = GPLv2
|
|
summary = A modern, advanced and high performance authoritative-only nameserver.
|
|
|
|
description
|
|
The PowerDNS Nameserver is a modern, advanced and high performance
|
|
authoritative-only nameserver. It is written from scratch and conforms
|
|
to all relevant DNS standards documents.
|
|
Furthermore, PowerDNS interfaces with almost any database.
|
|
end
|
|
|
|
source_dl = https://downloads.powerdns.com/releases/
|
|
sources = %{thisapp}.tar.bz2
|
|
|
|
build
|
|
requires
|
|
/usr/bin/hostname
|
|
boost-devel >= 1.60.0
|
|
bison
|
|
curl-devel
|
|
flex
|
|
gcc-c++
|
|
libsodium-devel
|
|
lua-devel
|
|
openssl-devel
|
|
ragel
|
|
shadow-utils
|
|
sqlite-devel
|
|
systemd-devel
|
|
zlib-devel
|
|
end
|
|
|
|
configure_options += \
|
|
--sysconfdir=%{sysconfdir}/pdns \
|
|
--libdir=%{libdir}/powerdns \
|
|
--with-modules="" \
|
|
--with-dynmodules="pipe gsqlite3" \
|
|
--with-lua \
|
|
--with-sqlite3 \
|
|
--enable-libsodium \
|
|
--enable-systemd \
|
|
--enable-tools \
|
|
--enable-unit-tests \
|
|
--disable-static
|
|
|
|
prepare_cmds
|
|
%{create_user}
|
|
end
|
|
|
|
test
|
|
make -C pdns check || :
|
|
end
|
|
|
|
install_cmds
|
|
# Create directories for pdns sqlite db.
|
|
mkdir -p %{BUILDROOT}%{datadir}/pdns/
|
|
mkdir -p %{BUILDROOT}%{sharedstatedir}/pdns/
|
|
|
|
# Install shema for sqlite database.
|
|
install -m 0644 %{DIR_SOURCE}/pdns.table \
|
|
%{BUILDROOT}%{datadir}/pdns/pdns.table
|
|
|
|
# Install default configuration.
|
|
install -m 0644 %{DIR_SOURCE}/pdns.conf \
|
|
%{BUILDROOT}%{sysconfdir}/pdns/pdns.conf
|
|
rm -vf %{BUILDROOT}%{sysconfdir}/pdns/pdns.conf-dist
|
|
|
|
# Create empty database file.
|
|
touch %{BUILDROOT}%{sharedstatedir}/pdns/pdns.db
|
|
|
|
# Fix permissions and ownership from database.
|
|
chown -R pdns:pdns %{BUILDROOT}%{sharedstatedir}/pdns
|
|
chmod 660 %{BUILDROOT}%{sharedstatedir}/pdns/pdns.db
|
|
|
|
# Remove unneded binaries.
|
|
rm -vf %{BUILDROOT}%{bindir}/zone2ldap
|
|
end
|
|
end
|
|
|
|
create_user
|
|
getent group pdns >/dev/null || groupadd -r pdns
|
|
getent passwd pdns >/dev/null || \
|
|
useradd -r -g pdns -d %{sharedstatedir}/pdns -s /sbin/nologin \
|
|
-c "PowerDNS user" pdns
|
|
end
|
|
|
|
packages
|
|
package %{name}
|
|
prerequires
|
|
coreutils
|
|
shadow-utils
|
|
sqlite
|
|
end
|
|
|
|
configfiles
|
|
%{sysconfdir}/pdns/pdns.conf
|
|
end
|
|
|
|
datafiles
|
|
%{sharedstatedir}/pdns/pdns.db
|
|
end
|
|
|
|
script prein
|
|
%{create_user}
|
|
end
|
|
|
|
script postin
|
|
systemctl daemon-reload >/dev/null 2>&1 || :
|
|
|
|
# Check if DB allready exists. Create pdns sqlite database if not.
|
|
if [ ! -s "%{sharedstatedir}/pdns/pdns.db" ]; then
|
|
sqlite3 %{sharedstatedir}/pdns/pdns.db < %{datadir}/pdns/pdns.table
|
|
fi
|
|
end
|
|
|
|
script preun
|
|
systemctl --no-reload disable pdns.service >/dev/null 2>&1 || :
|
|
systemctl stop pdns.service >/dev/null 2>&1 || :
|
|
|
|
# Backup existing database.
|
|
mv %{sharedstatedir}/pdns/pdns.db{,.bak}
|
|
end
|
|
|
|
script postun
|
|
systemctl daemon-reload >/dev/null 2>&1 || :
|
|
end
|
|
|
|
script postup
|
|
systemctl daemon-reload >/dev/null 2>&1 || :
|
|
systemctl try-restart pdns.service >/dev/null 2>&1 || :
|
|
end
|
|
end
|
|
|
|
package %{name}-debuginfo
|
|
template DEBUGINFO
|
|
end
|
|
end
|