]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blame - pdns/pdns.nm
pdns: Update to version 3.4.7
[people/amarx/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
MT
7version = 3.4.7
8release = 1
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
26 requires
27 boost-devel
28 chrpath
29 gcc-c++
30 lua-devel
1c3d8873 31 polarssl-devel
476b248c 32 shadow-utils
802ea3af
MT
33 sqlite-devel
34 zlib-devel
35 end
36
476b248c 37 # No paralilelism build.
802ea3af
MT
38 PARALLELISMFLAGS =
39
40 configure_options += \
476b248c 41 --sysconfdir=%{sysconfdir}/pdns \
3e486aa4 42 --with-system-polarssl \
802ea3af 43 --with-modules="" \
476b248c 44 --with-dynmodules="pipe geo gsqlite3" \
802ea3af 45 --with-lua \
3e486aa4 46 --enable-tools \
1c6d5458
MT
47 --disable-static \
48 --enable-unit-tests
802ea3af 49
476b248c
SS
50 prepare_cmds
51 %{create_user}
52 end
53
1c6d5458
MT
54 test
55 make -C pdns check
56 end
57
802ea3af 58 install_cmds
476b248c
SS
59 # Create directories for pdns sqlite db.
60 mkdir -p %{BUILDROOT}%{datadir}/pdns/
61 mkdir -p %{BUILDROOT}%{sharedstatedir}/pdns/
62
63 # Install shema for sqlite database.
64 install -m 0644 %{DIR_SOURCE}/pdns.table \
65 %{BUILDROOT}%{datadir}/pdns/pdns.table
66
67 # Install default configuration.
68 install -m 0644 %{DIR_SOURCE}/pdns.conf \
69 %{BUILDROOT}%{sysconfdir}/pdns/pdns.conf
3078b82b 70 rm -vf %{BUILDROOT}%{sysconfdir}/pdns/pdns.conf-dist
476b248c
SS
71
72 # Create empty database file.
73 touch %{BUILDROOT}%{sharedstatedir}/pdns/pdns.db
74
75 # Fix permissions and ownership from database.
76 chown -R pdns:pdns %{BUILDROOT}%{sharedstatedir}/pdns
77 chmod 660 %{BUILDROOT}%{sharedstatedir}/pdns/pdns.db
78
79 # Remove unneded binaries.
80 rm -vf %{BUILDROOT}%{bindir}/zone2ldap
81
82 # Remove rpath from binaries and backend libs.
802ea3af 83 chrpath --delete %{BUILDROOT}/usr/bin/pdns_control
802ea3af
MT
84 chrpath --delete %{BUILDROOT}/usr/bin/zone2sql
85 chrpath --delete %{BUILDROOT}/usr/sbin/pdns_server
1c6d5458 86 chrpath --delete %{BUILDROOT}%{libdir}/pdns/*.so
802ea3af 87 chrpath --delete %{BUILDROOT}/usr/bin/dnsreplay
aa429b66 88 chrpath --delete %{BUILDROOT}/usr/bin/pdnssec
802ea3af
MT
89 end
90end
91
476b248c
SS
92create_user
93 getent group pdns >/dev/null || groupadd -r pdns
94 getent passwd pdns >/dev/null || \
95 useradd -r -g pdns -d %{sharedstatedir}/pdns -s /sbin/nologin \
96 -c "PowerDNS user" pdns
97end
98
802ea3af
MT
99packages
100 package %{name}
476b248c
SS
101 prerequires
102 coreutils
103 shadow-utils
104 sqlite
105 end
3078b82b 106
476b248c 107 configfiles
3078b82b 108 %{sysconfdir}/pdns/pdns.conf
476b248c
SS
109 end
110
e8e9e8e7
SS
111 datafiles
112 %{sharedstatedir}/pdns/pdns.db
113 end
114
476b248c
SS
115 script prein
116 %{create_user}
117 end
118
119 script postin
120 systemctl daemon-reload >/dev/null 2>&1 || :
121
122 # Check if DB allready exists. Create pdns sqlite database if not.
123 if [ ! -s "%{sharedstatedir}/pdns/pdns.db" ]; then
124 sqlite3 %{sharedstatedir}/pdns/pdns.db < %{datadir}/pdns/pdns.table
125 fi
126 end
127
128 script preun
129 systemctl --no-reload disable pdns.service >/dev/null 2>&1 || :
130 systemctl stop pdns.service >/dev/null 2>&1 || :
131
132 # Backup existing database.
133 mv %{sharedstatedir}/pdns/pdns.db{,.bak}
134 end
135
136 script postun
137 systemctl daemon-reload >/dev/null 2>&1 || :
138 end
139
140 script postup
141 systemctl daemon-reload >/dev/null 2>&1 || :
142 systemctl try-restart pdns.service >/dev/null 2>&1 || :
143 end
144 end
1f9bc2f0
MT
145
146 package %{name}-debuginfo
147 template DEBUGINFO
148 end
802ea3af 149end