]> git.ipfire.org Git - people/arne_f/ipfire-3.x.git/blame - pdns/pdns.nm
pdns: Don't use bundeled 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
dfe7386f 7version = 3.1
1c3d8873 8release = 4
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/
802ea3af
MT
23
24build
25 requires
1c3d8873
SS
26 autoconf
27 automake
802ea3af
MT
28 boost-devel
29 chrpath
30 gcc-c++
1c3d8873 31 libtool
802ea3af 32 lua-devel
1c3d8873 33 polarssl-devel
476b248c 34 shadow-utils
802ea3af
MT
35 sqlite-devel
36 zlib-devel
37 end
38
476b248c 39 # No paralilelism build.
802ea3af
MT
40 PARALLELISMFLAGS =
41
42 configure_options += \
476b248c 43 --sysconfdir=%{sysconfdir}/pdns \
aa429b66 44 --libdir=%{libdir}/powerdns \
802ea3af 45 --with-modules="" \
476b248c 46 --with-dynmodules="pipe geo gsqlite3" \
802ea3af
MT
47 --with-lua \
48 --disable-static
49
476b248c 50 prepare_cmds
1c3d8873
SS
51 # Regenerate build system.
52 autoreconf -vfi
53
476b248c
SS
54 %{create_user}
55 end
56
802ea3af 57 install_cmds
476b248c
SS
58 # Create directories for pdns sqlite db.
59 mkdir -p %{BUILDROOT}%{datadir}/pdns/
60 mkdir -p %{BUILDROOT}%{sharedstatedir}/pdns/
61
62 # Install shema for sqlite database.
63 install -m 0644 %{DIR_SOURCE}/pdns.table \
64 %{BUILDROOT}%{datadir}/pdns/pdns.table
65
66 # Install default configuration.
67 install -m 0644 %{DIR_SOURCE}/pdns.conf \
68 %{BUILDROOT}%{sysconfdir}/pdns/pdns.conf
3078b82b 69 rm -vf %{BUILDROOT}%{sysconfdir}/pdns/pdns.conf-dist
476b248c
SS
70
71 # Create empty database file.
72 touch %{BUILDROOT}%{sharedstatedir}/pdns/pdns.db
73
74 # Fix permissions and ownership from database.
75 chown -R pdns:pdns %{BUILDROOT}%{sharedstatedir}/pdns
76 chmod 660 %{BUILDROOT}%{sharedstatedir}/pdns/pdns.db
77
78 # Remove unneded binaries.
79 rm -vf %{BUILDROOT}%{bindir}/zone2ldap
80
81 # Remove rpath from binaries and backend libs.
802ea3af 82 chrpath --delete %{BUILDROOT}/usr/bin/pdns_control
802ea3af
MT
83 chrpath --delete %{BUILDROOT}/usr/bin/zone2sql
84 chrpath --delete %{BUILDROOT}/usr/sbin/pdns_server
aa429b66 85 chrpath --delete %{BUILDROOT}%{libdir}/powerdns/*.so
802ea3af 86 chrpath --delete %{BUILDROOT}/usr/bin/dnsreplay
aa429b66 87 chrpath --delete %{BUILDROOT}/usr/bin/pdnssec
802ea3af
MT
88 end
89end
90
476b248c
SS
91create_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
96end
97
802ea3af
MT
98packages
99 package %{name}
476b248c
SS
100 prerequires
101 coreutils
102 shadow-utils
103 sqlite
104 end
3078b82b
MT
105
106 requires
107 pdns-recursor >= 3.3-8
108 end
476b248c
SS
109
110 configfiles
3078b82b 111 %{sysconfdir}/pdns/pdns.conf
476b248c
SS
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
1f9bc2f0
MT
144
145 package %{name}-debuginfo
146 template DEBUGINFO
147 end
802ea3af 148end