]>
Commit | Line | Data |
---|---|---|
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 | 6 | name = pdns |
3e486aa4 MT |
7 | version = 3.3.1 |
8 | release = 1 | |
1e42f23e | 9 | |
802ea3af MT |
10 | groups = Networking/DNS |
11 | url = http://powerdns.com/ | |
12 | license = GPLv2 | |
13 | summary = A modern, advanced and high performance authoritative-only nameserver. | |
1e42f23e | 14 | |
802ea3af MT |
15 | description |
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 |
20 | end |
21 | ||
aa429b66 | 22 | source_dl = http://downloads.powerdns.com/releases/ |
802ea3af MT |
23 | |
24 | build | |
25 | requires | |
26 | boost-devel | |
27 | chrpath | |
28 | gcc-c++ | |
29 | lua-devel | |
1c3d8873 | 30 | polarssl-devel |
476b248c | 31 | shadow-utils |
802ea3af MT |
32 | sqlite-devel |
33 | zlib-devel | |
34 | end | |
35 | ||
476b248c | 36 | # No paralilelism build. |
802ea3af MT |
37 | PARALLELISMFLAGS = |
38 | ||
39 | configure_options += \ | |
476b248c | 40 | --sysconfdir=%{sysconfdir}/pdns \ |
aa429b66 | 41 | --libdir=%{libdir}/powerdns \ |
3e486aa4 | 42 | --with-system-polarssl \ |
802ea3af | 43 | --with-modules="" \ |
476b248c | 44 | --with-dynmodules="pipe geo gsqlite3" \ |
802ea3af | 45 | --with-lua \ |
3e486aa4 | 46 | --enable-tools \ |
802ea3af MT |
47 | --disable-static |
48 | ||
476b248c SS |
49 | prepare_cmds |
50 | %{create_user} | |
51 | end | |
52 | ||
802ea3af | 53 | install_cmds |
476b248c SS |
54 | # Create directories for pdns sqlite db. |
55 | mkdir -p %{BUILDROOT}%{datadir}/pdns/ | |
56 | mkdir -p %{BUILDROOT}%{sharedstatedir}/pdns/ | |
57 | ||
58 | # Install shema for sqlite database. | |
59 | install -m 0644 %{DIR_SOURCE}/pdns.table \ | |
60 | %{BUILDROOT}%{datadir}/pdns/pdns.table | |
61 | ||
62 | # Install default configuration. | |
63 | install -m 0644 %{DIR_SOURCE}/pdns.conf \ | |
64 | %{BUILDROOT}%{sysconfdir}/pdns/pdns.conf | |
3078b82b | 65 | rm -vf %{BUILDROOT}%{sysconfdir}/pdns/pdns.conf-dist |
476b248c SS |
66 | |
67 | # Create empty database file. | |
68 | touch %{BUILDROOT}%{sharedstatedir}/pdns/pdns.db | |
69 | ||
70 | # Fix permissions and ownership from database. | |
71 | chown -R pdns:pdns %{BUILDROOT}%{sharedstatedir}/pdns | |
72 | chmod 660 %{BUILDROOT}%{sharedstatedir}/pdns/pdns.db | |
73 | ||
74 | # Remove unneded binaries. | |
75 | rm -vf %{BUILDROOT}%{bindir}/zone2ldap | |
76 | ||
77 | # Remove rpath from binaries and backend libs. | |
802ea3af | 78 | chrpath --delete %{BUILDROOT}/usr/bin/pdns_control |
802ea3af MT |
79 | chrpath --delete %{BUILDROOT}/usr/bin/zone2sql |
80 | chrpath --delete %{BUILDROOT}/usr/sbin/pdns_server | |
aa429b66 | 81 | chrpath --delete %{BUILDROOT}%{libdir}/powerdns/*.so |
802ea3af | 82 | chrpath --delete %{BUILDROOT}/usr/bin/dnsreplay |
aa429b66 | 83 | chrpath --delete %{BUILDROOT}/usr/bin/pdnssec |
802ea3af MT |
84 | end |
85 | end | |
86 | ||
476b248c SS |
87 | create_user |
88 | getent group pdns >/dev/null || groupadd -r pdns | |
89 | getent passwd pdns >/dev/null || \ | |
90 | useradd -r -g pdns -d %{sharedstatedir}/pdns -s /sbin/nologin \ | |
91 | -c "PowerDNS user" pdns | |
92 | end | |
93 | ||
802ea3af MT |
94 | packages |
95 | package %{name} | |
476b248c SS |
96 | prerequires |
97 | coreutils | |
98 | shadow-utils | |
99 | sqlite | |
100 | end | |
3078b82b MT |
101 | |
102 | requires | |
103 | pdns-recursor >= 3.3-8 | |
104 | end | |
476b248c SS |
105 | |
106 | configfiles | |
3078b82b | 107 | %{sysconfdir}/pdns/pdns.conf |
476b248c SS |
108 | end |
109 | ||
e8e9e8e7 SS |
110 | datafiles |
111 | %{sharedstatedir}/pdns/pdns.db | |
112 | end | |
113 | ||
476b248c SS |
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 | 148 | end |