]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blame - pdns/pdns.nm
perl-XML-SAX-Base: New package.
[people/ms/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
e8e9e8e7 8release = 5
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
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