]> git.ipfire.org Git - people/arne_f/ipfire-3.x.git/blame - pdns/pdns.nm
pdns: Don't depend on polarssl
[people/arne_f/ipfire-3.x.git] / pdns / pdns.nm
CommitLineData
1e42f23e 1###############################################################################
802ea3af
MT
2# IPFire.org - An Open Source Firewall Solution #
3# Copyright (C) - IPFire Development Team <info@ipfire.org> #
1e42f23e
MT
4###############################################################################
5
802ea3af 6name = pdns
1c6d5458 7version = 3.4.7
47ac6200 8release = 2
1e42f23e 9
802ea3af
MT
10groups = Networking/DNS
11url = http://powerdns.com/
12license = GPLv2
13summary = A modern, advanced and high performance authoritative-only nameserver.
1e42f23e 14
802ea3af
MT
15description
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.
1e42f23e 19 Furthermore, PowerDNS interfaces with almost any database.
802ea3af
MT
20end
21
aa429b66 22source_dl = http://downloads.powerdns.com/releases/
1c6d5458 23sources = %{thisapp}.tar.bz2
802ea3af
MT
24
25build
47ac6200
MT
26 # pdns uses polarssl which is no longer maintained
27 # upstream any more. Since nothing else is using
28 # polarssl any more we have dropped this from the
29 # distribution and bundle it with pdns.
30
802ea3af
MT
31 requires
32 boost-devel
33 chrpath
34 gcc-c++
35 lua-devel
476b248c 36 shadow-utils
802ea3af
MT
37 sqlite-devel
38 zlib-devel
39 end
40
476b248c 41 # No paralilelism build.
802ea3af
MT
42 PARALLELISMFLAGS =
43
44 configure_options += \
476b248c 45 --sysconfdir=%{sysconfdir}/pdns \
802ea3af 46 --with-modules="" \
476b248c 47 --with-dynmodules="pipe geo gsqlite3" \
802ea3af 48 --with-lua \
3e486aa4 49 --enable-tools \
1c6d5458
MT
50 --disable-static \
51 --enable-unit-tests
802ea3af 52
476b248c
SS
53 prepare_cmds
54 %{create_user}
55 end
56
1c6d5458
MT
57 test
58 make -C pdns check
59 end
60
802ea3af 61 install_cmds
476b248c
SS
62 # Create directories for pdns sqlite db.
63 mkdir -p %{BUILDROOT}%{datadir}/pdns/
64 mkdir -p %{BUILDROOT}%{sharedstatedir}/pdns/
65
66 # Install shema for sqlite database.
67 install -m 0644 %{DIR_SOURCE}/pdns.table \
68 %{BUILDROOT}%{datadir}/pdns/pdns.table
69
70 # Install default configuration.
71 install -m 0644 %{DIR_SOURCE}/pdns.conf \
72 %{BUILDROOT}%{sysconfdir}/pdns/pdns.conf
3078b82b 73 rm -vf %{BUILDROOT}%{sysconfdir}/pdns/pdns.conf-dist
476b248c
SS
74
75 # Create empty database file.
76 touch %{BUILDROOT}%{sharedstatedir}/pdns/pdns.db
77
78 # Fix permissions and ownership from database.
79 chown -R pdns:pdns %{BUILDROOT}%{sharedstatedir}/pdns
80 chmod 660 %{BUILDROOT}%{sharedstatedir}/pdns/pdns.db
81
82 # Remove unneded binaries.
83 rm -vf %{BUILDROOT}%{bindir}/zone2ldap
84
85 # Remove rpath from binaries and backend libs.
802ea3af 86 chrpath --delete %{BUILDROOT}/usr/bin/pdns_control
802ea3af
MT
87 chrpath --delete %{BUILDROOT}/usr/bin/zone2sql
88 chrpath --delete %{BUILDROOT}/usr/sbin/pdns_server
1c6d5458 89 chrpath --delete %{BUILDROOT}%{libdir}/pdns/*.so
802ea3af 90 chrpath --delete %{BUILDROOT}/usr/bin/dnsreplay
aa429b66 91 chrpath --delete %{BUILDROOT}/usr/bin/pdnssec
802ea3af
MT
92 end
93end
94
476b248c
SS
95create_user
96 getent group pdns >/dev/null || groupadd -r pdns
97 getent passwd pdns >/dev/null || \
98 useradd -r -g pdns -d %{sharedstatedir}/pdns -s /sbin/nologin \
99 -c "PowerDNS user" pdns
100end
101
802ea3af
MT
102packages
103 package %{name}
476b248c
SS
104 prerequires
105 coreutils
106 shadow-utils
107 sqlite
108 end
3078b82b 109
476b248c 110 configfiles
3078b82b 111 %{sysconfdir}/pdns/pdns.conf
476b248c
SS
112 end
113
e8e9e8e7
SS
114 datafiles
115 %{sharedstatedir}/pdns/pdns.db
116 end
117
476b248c
SS
118 script prein
119 %{create_user}
120 end
121
122 script postin
123 systemctl daemon-reload >/dev/null 2>&1 || :
124
125 # Check if DB allready exists. Create pdns sqlite database if not.
126 if [ ! -s "%{sharedstatedir}/pdns/pdns.db" ]; then
127 sqlite3 %{sharedstatedir}/pdns/pdns.db < %{datadir}/pdns/pdns.table
128 fi
129 end
130
131 script preun
132 systemctl --no-reload disable pdns.service >/dev/null 2>&1 || :
133 systemctl stop pdns.service >/dev/null 2>&1 || :
134
135 # Backup existing database.
136 mv %{sharedstatedir}/pdns/pdns.db{,.bak}
137 end
138
139 script postun
140 systemctl daemon-reload >/dev/null 2>&1 || :
141 end
142
143 script postup
144 systemctl daemon-reload >/dev/null 2>&1 || :
145 systemctl try-restart pdns.service >/dev/null 2>&1 || :
146 end
147 end
1f9bc2f0
MT
148
149 package %{name}-debuginfo
150 template DEBUGINFO
151 end
802ea3af 152end