]> git.ipfire.org Git - people/arne_f/ipfire-3.x.git/blob - pdns-recursor/pdns-recursor.nm
checkpolicy: Update to 2.1.8.
[people/arne_f/ipfire-3.x.git] / pdns-recursor / pdns-recursor.nm
1 ###############################################################################
2 # IPFire.org - An Open Source Firewall Solution #
3 # Copyright (C) - IPFire Development Team <info@ipfire.org> #
4 ###############################################################################
5
6 name = pdns-recursor
7 version = 3.3
8 release = 7
9
10 groups = Networking/DNS
11 url = http://powerdns.com/
12 license = GPLv2
13 summary = A modern, advanced and high performance recursing nameserver.
14
15 description
16 PowerDNS Recursor is a non authoritative/recursing DNS server. Use this
17 package if you need a dns cache for your network.
18 end
19
20 source_dl = http://downloads.powerdns.com/releases/
21 sources = %{thisapp}.tar.bz2
22
23 build
24 requires
25 gcc-c++
26 boost-devel
27 lua-devel
28 shadow-utils
29 end
30
31 prepare_cmds
32 %{create_user}
33 end
34
35 build
36 LUA=1 LUA_CPPFLAGS_CONFIG= LUA_LIBS_CONFIG=-llua \
37 make OPTFLAGS="%{CFLAGS}" #%{PARALLELISMFLAGS}
38 end
39
40 install
41 make install DESTDIR=%{BUILDROOT} \
42 CONFIGDIR=/etc/%{name}
43
44 # Remove sysvinit file
45 rm -rf %{BUILDROOT}/etc/init.d
46
47 # Remove shipped config file
48 rm -rf %{BUILDROOT}/etc/%{name}/recursor.conf-dist
49
50 # Install our default config file
51 cp -vf %{DIR_SOURCE}/recursor.conf %{BUILDROOT}/etc/%{name}/recursor.conf
52
53 # Create folder for chroot
54 mkdir -pv %{BUILDROOT}/var/lib/pdns-recursor
55
56 # Create directory for socket and stuff.
57 mkdir -pv %{BUILDROOT}/run/pdns-recursor
58 chown -v pdns-recursor.pdns-recursor %{BUILDROOT}/run/pdns-recursor
59 end
60 end
61
62 create_user
63 getent group pdns-recursor >/dev/null || groupadd -r pdns-recursor
64 getent passwd pdns-recursor >/dev/null || \
65 useradd -r -g pdns-recursor -d /var/lib/pdns-recursor -s /sbin/nologin \
66 pdns-recursor
67 end
68
69 packages
70 package %{name}
71 configfiles
72 /etc/%{name}/recursor.conf
73 end
74
75 prerequires
76 shadow-utils
77 systemd-units
78 end
79
80 script prein
81 %{create_user}
82 end
83
84 script postin
85 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
86 /bin/systemctl --no-reload enable pdns-recursor.service >/dev/null 2>&1 || :
87 end
88
89 script preun
90 /bin/systemctl --no-reload disable pdns-recursor.service >/dev/null 2>&1 || :
91 /bin/systemctl stop pdns-recursor.service >/dev/null 2>&1 || :
92 end
93
94 script postun
95 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
96 end
97
98 script postup
99 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
100 /bin/systemctl try-restart pdns-recursor.service >/dev/null 2>&1 || :
101 end
102 end
103
104 package %{name}-debuginfo
105 template DEBUGINFO
106 end
107 end