]> git.ipfire.org Git - ipfire-3.x.git/blob - pdns/pdns.nm
json-c: Update to version 0.17-20230812
[ipfire-3.x.git] / pdns / pdns.nm
1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
5
6 name = pdns
7 version = 4.7.3
8 release = 1
9 thisapp = %{name}-%{version}
10
11 groups = Networking/DNS
12 url = https://powerdns.com/
13 license = GPLv2
14 summary = A modern, advanced and high performance authoritative-only nameserver.
15
16 description
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.
21 end
22
23 source_dl = https://downloads.powerdns.com/releases/
24 sources = %{thisapp}.tar.bz2
25
26 build
27 requires
28 /usr/bin/hostname
29 boost-devel >= 1.60.0
30 bison
31 curl-devel
32 flex
33 gcc-c++
34 libsodium-devel
35 lua-devel
36 openssl-devel
37 ragel
38 shadow-utils
39 sqlite-devel
40 systemd-devel
41 zlib-devel
42 end
43
44 configure_options += \
45 --sysconfdir=%{sysconfdir}/pdns \
46 --libdir=%{libdir}/powerdns \
47 --with-modules="" \
48 --with-dynmodules="pipe gsqlite3" \
49 --with-lua \
50 --with-sqlite3 \
51 --enable-libsodium \
52 --enable-systemd \
53 --enable-tools \
54 --enable-unit-tests \
55 --disable-static
56
57 prepare_cmds
58 %{create_user}
59 end
60
61 test
62 make -C pdns check || :
63 end
64
65 install_cmds
66 # Create directories for pdns sqlite db.
67 mkdir -p %{BUILDROOT}%{datadir}/pdns/
68 mkdir -p %{BUILDROOT}%{sharedstatedir}/pdns/
69
70 # Install shema for sqlite database.
71 install -m 0644 %{DIR_SOURCE}/pdns.table \
72 %{BUILDROOT}%{datadir}/pdns/pdns.table
73
74 # Install default configuration.
75 install -m 0644 %{DIR_SOURCE}/pdns.conf \
76 %{BUILDROOT}%{sysconfdir}/pdns/pdns.conf
77 rm -vf %{BUILDROOT}%{sysconfdir}/pdns/pdns.conf-dist
78
79 # Create empty database file.
80 touch %{BUILDROOT}%{sharedstatedir}/pdns/pdns.db
81
82 # Fix permissions and ownership from database.
83 chown -R pdns:pdns %{BUILDROOT}%{sharedstatedir}/pdns
84 chmod 660 %{BUILDROOT}%{sharedstatedir}/pdns/pdns.db
85
86 # Remove unneded binaries.
87 rm -vf %{BUILDROOT}%{bindir}/zone2ldap
88 end
89 end
90
91 create_user
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
96 end
97
98 packages
99 package %{name}
100 prerequires
101 coreutils
102 shadow-utils
103 sqlite
104 end
105
106 configfiles
107 %{sysconfdir}/pdns/pdns.conf
108 end
109
110 datafiles
111 %{sharedstatedir}/pdns/pdns.db
112 end
113
114 script prein
115 %{create_user}
116 end
117
118 script postin
119 systemctl daemon-reload >/dev/null 2>&1 || :
120
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
124 fi
125 end
126
127 script preun
128 systemctl --no-reload disable pdns.service >/dev/null 2>&1 || :
129 systemctl stop pdns.service >/dev/null 2>&1 || :
130
131 # Backup existing database.
132 mv %{sharedstatedir}/pdns/pdns.db{,.bak}
133 end
134
135 script postun
136 systemctl daemon-reload >/dev/null 2>&1 || :
137 end
138
139 script postup
140 systemctl daemon-reload >/dev/null 2>&1 || :
141 systemctl try-restart pdns.service >/dev/null 2>&1 || :
142 end
143 end
144
145 package %{name}-debuginfo
146 template DEBUGINFO
147 end
148 end