1 | %bcond_with systemd |
---|
2 | |
---|
3 | Name: dnsmasq |
---|
4 | Version: 2.82 |
---|
5 | Release: 1%{?_dist_release}%{?with_systemd:.systemd} |
---|
6 | Summary: A lightweight DHCP/caching DNS server |
---|
7 | Summary(ja): 軽量 DHCP/DNSキャッシュサーバ |
---|
8 | Group: servers |
---|
9 | Vendor: Project Vine |
---|
10 | Distribution: Vine Linux |
---|
11 | |
---|
12 | License: GPLv2 or GPLv3 |
---|
13 | URL: http://www.thekelleys.org.uk/dnsmasq/ |
---|
14 | Source0: http://www.thekelleys.org.uk/dnsmasq/%{name}-%{version}.tar.xz |
---|
15 | Source1: %{name}.service |
---|
16 | Source2: dnsmasq-systemd-sysusers.conf |
---|
17 | Patch0: %{name}-2.33-initscript.patch |
---|
18 | |
---|
19 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root |
---|
20 | BuildRequires: dbus-devel, libidn2-devel, nettle-devel |
---|
21 | BuildRequires: pkgconfig |
---|
22 | |
---|
23 | Requires(pre): shadow-utils |
---|
24 | Requires(post): /bin/sed /bin/grep |
---|
25 | %if %{with systemd} |
---|
26 | BuildRequires: systemd |
---|
27 | %{?systemd_requires} |
---|
28 | %else |
---|
29 | Requires(post): /sbin/chkconfig |
---|
30 | Requires(post): /sbin/service |
---|
31 | Requires(preun): /sbin/chkconfig |
---|
32 | Requires(preun): /sbin/service |
---|
33 | Requires(postun): /sbin/service |
---|
34 | %endif |
---|
35 | |
---|
36 | %description |
---|
37 | Dnsmasq is lightweight, easy to configure DNS forwarder and DHCP server. |
---|
38 | It is designed to provide DNS and, optionally, DHCP, to a small network. |
---|
39 | It can serve the names of local machines which are not in the global |
---|
40 | DNS. The DHCP server integrates with the DNS server and allows machines |
---|
41 | with DHCP-allocated addresses to appear in the DNS with names configured |
---|
42 | either in each host or in a central configuration file. Dnsmasq supports |
---|
43 | static and dynamic DHCP leases and BOOTP for network booting of diskless |
---|
44 | machines. |
---|
45 | |
---|
46 | |
---|
47 | %debug_package |
---|
48 | |
---|
49 | |
---|
50 | %prep |
---|
51 | %setup -q -n %{name}-%{version} |
---|
52 | %if !%{with systemd} |
---|
53 | %patch0 -p1 |
---|
54 | %endif |
---|
55 | |
---|
56 | # use /var/lib/dnsmasq instead of /var/lib/misc |
---|
57 | for file in dnsmasq.conf.example man/dnsmasq.8 man/es/dnsmasq.8 src/config.h; do |
---|
58 | sed -i 's|/var/lib/misc/dnsmasq.leases|/var/lib/dnsmasq/dnsmasq.leases|g' "$file" |
---|
59 | done |
---|
60 | |
---|
61 | # fix the path to the trust anchor |
---|
62 | sed -i 's|%%%%PREFIX%%%%|%{_prefix}|' dnsmasq.conf.example |
---|
63 | |
---|
64 | #set dnsmasq user / group |
---|
65 | sed -i 's|#user=|user=dnsmasq|' dnsmasq.conf.example |
---|
66 | sed -i 's|#group=|group=dnsmasq|' dnsmasq.conf.example |
---|
67 | #set default user /group in src/config.h |
---|
68 | sed -i 's|#define CHUSER "nobody"|#define CHUSER "dnsmasq"|' src/config.h |
---|
69 | sed -i 's|#define CHGRP "dip"|#define CHGRP "dnsmasq"|' src/config.h |
---|
70 | |
---|
71 | #enable dbus |
---|
72 | sed -i 's|/\* #define HAVE_DBUS \*/|#define HAVE_DBUS|g' src/config.h |
---|
73 | |
---|
74 | #enable libidn2 support |
---|
75 | sed -i 's|/\* #define HAVE_LIBIDN2 \*/|#define HAVE_LIBIDN2|g' src/config.h |
---|
76 | |
---|
77 | #enable DNSSEC support |
---|
78 | sed -i 's|/\* #define HAVE_DNSSEC \*/|#define HAVE_DNSSEC|g' src/config.h |
---|
79 | |
---|
80 | #enable /etc/dnsmasq.d fix bz 526703, ignore RPM backup files |
---|
81 | cat << EOF >> dnsmasq.conf.example |
---|
82 | |
---|
83 | # Include all files in /etc/dnsmasq.d except RPM backup files |
---|
84 | conf-dir=%{_sysconfdir}/dnsmasq.d,.rpmnew,.rpmsave,.rpmorig |
---|
85 | EOF |
---|
86 | |
---|
87 | |
---|
88 | %build |
---|
89 | make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" |
---|
90 | make %{?_smp_mflags} -C contrib/lease-tools CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" |
---|
91 | |
---|
92 | |
---|
93 | %install |
---|
94 | rm -rf $RPM_BUILD_ROOT |
---|
95 | # normally i'd do 'make install'...it's a bit messy, though |
---|
96 | mkdir -p $RPM_BUILD_ROOT%{_sbindir} \ |
---|
97 | $RPM_BUILD_ROOT%{_mandir}/man8 \ |
---|
98 | $RPM_BUILD_ROOT%{_var}/lib/dnsmasq \ |
---|
99 | $RPM_BUILD_ROOT%{_sysconfdir}/dnsmasq.d \ |
---|
100 | $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1/system.d |
---|
101 | install src/dnsmasq $RPM_BUILD_ROOT%{_sbindir}/dnsmasq |
---|
102 | install dnsmasq.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/dnsmasq.conf |
---|
103 | install dbus/dnsmasq.conf $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1/system.d/ |
---|
104 | install -m 644 man/dnsmasq.8 $RPM_BUILD_ROOT%{_mandir}/man8/ |
---|
105 | install -D trust-anchors.conf $RPM_BUILD_ROOT%{_datadir}/%{name}/trust-anchors.conf |
---|
106 | |
---|
107 | # utils sub package |
---|
108 | mkdir -p $RPM_BUILD_ROOT%{_bindir} \ |
---|
109 | $RPM_BUILD_ROOT%{_mandir}/man1 |
---|
110 | install -m 755 contrib/lease-tools/dhcp_release $RPM_BUILD_ROOT%{_bindir}/dhcp_release |
---|
111 | install -m 644 contrib/lease-tools/dhcp_release.1 $RPM_BUILD_ROOT%{_mandir}/man1/dhcp_release.1 |
---|
112 | install -m 755 contrib/lease-tools/dhcp_release6 $RPM_BUILD_ROOT%{_bindir}/dhcp_release6 |
---|
113 | install -m 644 contrib/lease-tools/dhcp_release6.1 $RPM_BUILD_ROOT%{_mandir}/man1/dhcp_release6.1 |
---|
114 | install -m 755 contrib/lease-tools/dhcp_lease_time $RPM_BUILD_ROOT%{_bindir}/dhcp_lease_time |
---|
115 | install -m 644 contrib/lease-tools/dhcp_lease_time.1 $RPM_BUILD_ROOT%{_mandir}/man1/dhcp_lease_time.1 |
---|
116 | |
---|
117 | %if %{with systemd} |
---|
118 | # Systemd |
---|
119 | mkdir -p %{buildroot}%{_unitdir} |
---|
120 | install -m644 %{SOURCE1} %{buildroot}%{_unitdir} |
---|
121 | rm -rf %{buildroot}%{_initrddir} |
---|
122 | |
---|
123 | #install systemd sysuser file |
---|
124 | install -Dpm 644 %{SOURCE2} %{buildroot}%{_sysusersdir}/%{name}.conf |
---|
125 | %else |
---|
126 | mkdir -p $RPM_BUILD_ROOT%{_initrddir} |
---|
127 | install rpm/dnsmasq.init $RPM_BUILD_ROOT%{_initrddir}/dnsmasq |
---|
128 | %endif |
---|
129 | |
---|
130 | |
---|
131 | %clean |
---|
132 | rm -rf $RPM_BUILD_ROOT |
---|
133 | |
---|
134 | |
---|
135 | %pre |
---|
136 | %if %{with systemd} |
---|
137 | #precreate users so that rpm can install files owned by that user |
---|
138 | %sysusers_create_package %{name} %{SOURCE2} |
---|
139 | %else |
---|
140 | getent group dnsmasq >/dev/null || groupadd -r dnsmasq |
---|
141 | getent passwd dnsmasq >/dev/null || \ |
---|
142 | useradd -r -g dnsmasq -d /var/lib/dnsmasq -s /sbin/nologin \ |
---|
143 | -c "Dnsmasq DHCP and DNS server" dnsmasq |
---|
144 | exit 0 |
---|
145 | %endif |
---|
146 | |
---|
147 | %post |
---|
148 | %if %{with systemd} |
---|
149 | %systemd_post dnsmasq.service |
---|
150 | %endif |
---|
151 | if [ "$1" = "2" ]; then # if we're being upgraded |
---|
152 | # if using the old leases location, move the file to the new one |
---|
153 | # but only if we're not clobbering another file |
---|
154 | # |
---|
155 | if [ -f /var/lib/misc/dnsmasq.leases -a ! -f /var/lib/dnsmasq/dnsmasq.leases ]; then |
---|
156 | # causes rpmlint to report dangerous-command-in-post, |
---|
157 | # but that's the price of selinux compliance :-( |
---|
158 | mv -f /var/lib/misc/dnsmasq.leases /var/lib/dnsmasq/dnsmasq.leases || : |
---|
159 | fi |
---|
160 | # ugly, but kind of necessary |
---|
161 | if [ ! `grep -q dhcp-leasefile=/var/lib/misc/dnsmasq.leases %{_sysconfdir}/dnsmasq.conf` ]; then |
---|
162 | cp %{_sysconfdir}/dnsmasq.conf %{_sysconfdir}/dnsmasq.conf.tmp || : |
---|
163 | sed -e 's/var\/lib\/misc/var\/lib\/dnsmasq/' < %{_sysconfdir}/dnsmasq.conf.tmp > %{_sysconfdir}/dnsmasq.conf || : |
---|
164 | rm -f %{_sysconfdir}/dnsmasq.conf.tmp || : |
---|
165 | fi |
---|
166 | %if !%{with systemd} |
---|
167 | else # if we're being installed |
---|
168 | /sbin/chkconfig --add dnsmasq |
---|
169 | %endif |
---|
170 | fi |
---|
171 | |
---|
172 | %preun |
---|
173 | %if %{with systemd} |
---|
174 | %systemd_preun dnsmasq.service |
---|
175 | %else |
---|
176 | if [ "$1" = "0" -o -x /bin/systemctl ]; then # execute this only if we are NOT doing an upgrade |
---|
177 | /sbin/service dnsmasq stop >/dev/null 2>&1 || : |
---|
178 | /sbin/chkconfig --del dnsmasq |
---|
179 | fi |
---|
180 | %endif |
---|
181 | |
---|
182 | %postun |
---|
183 | %if %{with systemd} |
---|
184 | %systemd_postun_with_restart dnsmasq.service |
---|
185 | %else |
---|
186 | if [ "$1" -gt "0" ]; then |
---|
187 | /sbin/service dnsmasq condrestart >/dev/null 2>&1 || : |
---|
188 | fi |
---|
189 | %endif |
---|
190 | |
---|
191 | |
---|
192 | %files |
---|
193 | %defattr(-,root,root,-) |
---|
194 | %license COPYING* |
---|
195 | %doc CHANGELOG FAQ doc.html setup.html dbus/DBus-interface |
---|
196 | %config(noreplace) %attr(644,root,root) %{_sysconfdir}/dnsmasq.conf |
---|
197 | %dir /etc/dnsmasq.d |
---|
198 | %dir %{_var}/lib/dnsmasq |
---|
199 | %config(noreplace) %attr(644,root,root) %{_sysconfdir}/dbus-1/system.d/dnsmasq.conf |
---|
200 | %dir %{_datadir}/dnsmasq |
---|
201 | %{_datadir}/dnsmasq/* |
---|
202 | %{_sbindir}/dnsmasq |
---|
203 | %{_mandir}/man8/dnsmasq* |
---|
204 | %if %{with systemd} |
---|
205 | %{_unitdir}/%{name}.service |
---|
206 | %{_sysusersdir}/dnsmasq.conf |
---|
207 | %else |
---|
208 | %{_initrddir}/dnsmasq |
---|
209 | %endif |
---|
210 | %{_bindir}/dhcp_* |
---|
211 | %{_mandir}/man1/dhcp_* |
---|
212 | |
---|
213 | |
---|
214 | %changelog |
---|
215 | * Tue Sep 08 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.82-1 |
---|
216 | - new upstream release. |
---|
217 | |
---|
218 | * Sat May 23 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.81-1 |
---|
219 | - new upstream release. |
---|
220 | - added systemd support (disabled as default). |
---|
221 | |
---|
222 | * Sat Mar 21 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.80-2 |
---|
223 | - rebuilt with libidn2. |
---|
224 | |
---|
225 | * Sat May 25 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.80-1 |
---|
226 | - new upstream release. |
---|
227 | |
---|
228 | * Tue Jul 5 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.76-1 |
---|
229 | - new upstream release. |
---|
230 | |
---|
231 | * Sat Dec 28 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.45-3 |
---|
232 | - rebuild with VineSeed environment |
---|
233 | |
---|
234 | * Sun Apr 17 2011 Shu KONNO <owa@bg.wakwak.com> 2.45-2 |
---|
235 | - rebuilt with rpm-4.8.1-3 |
---|
236 | |
---|
237 | * Thu Jul 31 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 2.45-1 |
---|
238 | - initial build for Vine Linux |
---|
239 | |
---|
240 | * Mon Jul 21 2008 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.45-1 |
---|
241 | - Upstream release (bugfixes) |
---|
242 | |
---|
243 | * Wed Jul 16 2008 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.43-2 |
---|
244 | - New upstream release, contains fixes for CVE-2008-1447/CERT VU#800113 |
---|
245 | - Dropped patch for newer glibc (merged upstream) |
---|
246 | |
---|
247 | * Wed Feb 13 2008 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.41-0.8 |
---|
248 | - Added upstream-authored patch for newer glibc (thanks Simon!) |
---|
249 | |
---|
250 | * Wed Feb 13 2008 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.41-0.7 |
---|
251 | - New upstream release |
---|
252 | |
---|
253 | * Wed Jan 30 2008 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.41-0.6.rc1 |
---|
254 | - Release candidate |
---|
255 | - Happy Birthday Isaac! |
---|
256 | |
---|
257 | * Wed Jan 23 2008 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.41-0.5.test30 |
---|
258 | - Bugfix update |
---|
259 | |
---|
260 | * Mon Dec 31 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.41-0.4.test26 |
---|
261 | - Bugfix/feature enhancement update |
---|
262 | |
---|
263 | * Thu Dec 13 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.41-0.3.test24 |
---|
264 | - Upstream fix for fairly serious regression |
---|
265 | |
---|
266 | * Tue Dec 04 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.41-0.2.test20 |
---|
267 | - New upstream test release |
---|
268 | - Moving dnsmasq.leases to /var/lib/dnsmasq/ as per BZ#407901 |
---|
269 | - Ignoring dangerous-command-in-%%post rpmlint warning (as per above fix) |
---|
270 | - Patch consolidation/cleanup |
---|
271 | - Removed conditionals for Fedora <= 3 and Aurora 2.0 |
---|
272 | |
---|
273 | * Tue Sep 18 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.40-1 |
---|
274 | - Finalized upstream release |
---|
275 | - Removing URLs from patch lines (CVS is the authoritative source) |
---|
276 | - Added more magic to make spinning rc/test packages more seamless |
---|
277 | |
---|
278 | * Sun Aug 26 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.40-0.1.rc2 |
---|
279 | - New upstream release candidate (feature-frozen), thanks Simon! |
---|
280 | - License clarification |
---|
281 | |
---|
282 | * Tue May 29 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.39-1 |
---|
283 | - New upstream version (bugfixes, enhancements) |
---|
284 | |
---|
285 | * Mon Feb 12 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.38-1 |
---|
286 | - New upstream version with bugfix for potential hang |
---|
287 | |
---|
288 | * Tue Feb 06 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.37-1 |
---|
289 | - New upstream version |
---|
290 | |
---|
291 | * Wed Jan 24 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.36-1 |
---|
292 | - New upstream version |
---|
293 | |
---|
294 | * Mon Nov 06 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.35-2 |
---|
295 | - Stop creating /etc/sysconfig on %%install |
---|
296 | - Create /etc/dnsmasq.d on %%install |
---|
297 | |
---|
298 | * Mon Nov 06 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.35-1 |
---|
299 | - Update to 2.35 |
---|
300 | - Removed UPGRADING_to_2.0 from %%doc as per upstream change |
---|
301 | - Enabled conf-dir in default config as per RFE BZ#214220 (thanks Chris!) |
---|
302 | - Added %%dir /etc/dnsmasq.d to %%files as per above RFE |
---|
303 | |
---|
304 | * Tue Oct 24 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.34-2 |
---|
305 | - Fixed BZ#212005 |
---|
306 | - Moved %%postun scriptlet to %%post, where it made more sense |
---|
307 | - Render scriptlets safer |
---|
308 | - Minor cleanup for consistency |
---|
309 | |
---|
310 | * Thu Oct 19 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.34-1 |
---|
311 | - Hardcoded version in patches, as I'm getting tired of updating them |
---|
312 | - Update to 2.34 |
---|
313 | |
---|
314 | * Mon Aug 28 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.33-2 |
---|
315 | - Rebuild for FC6 |
---|
316 | |
---|
317 | * Tue Aug 15 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.33-1 |
---|
318 | - Update |
---|
319 | |
---|
320 | * Sat Jul 22 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.32-3 |
---|
321 | - Added pkgconfig BuildReq due to reduced buildroot |
---|
322 | |
---|
323 | * Thu Jul 20 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.32-2 |
---|
324 | - Forced update due to dbus version bump |
---|
325 | |
---|
326 | * Mon Jun 12 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.32-1 |
---|
327 | - Update from upstream |
---|
328 | - Patch from Dennis Gilmore fixed the conditionals to detect Aurora Linux |
---|
329 | |
---|
330 | * Mon May 8 2006 Patrick "Jima" Laughton <jima@auroralinux.org> 2.31-1 |
---|
331 | - Removed dbus config patch (now provided upstream) |
---|
332 | - Patched in init script (no longer provided upstream) |
---|
333 | - Added DBus-interface to docs |
---|
334 | |
---|
335 | * Tue May 2 2006 Patrick "Jima" Laughton <jima@auroralinux.org> 2.30-4.2 |
---|
336 | - More upstream-recommended cleanups :) |
---|
337 | - Killed sysconfig file (provides unneeded functionality) |
---|
338 | - Tweaked init script a little more |
---|
339 | |
---|
340 | * Tue May 2 2006 Patrick "Jima" Laughton <jima@auroralinux.org> 2.30-4 |
---|
341 | - Moved options out of init script and into /etc/sysconfig/dnsmasq |
---|
342 | - Disabled DHCP_LEASE in sysconfig file, fixing bug #190379 |
---|
343 | - Simon Kelley provided dbus/dnsmasq.conf, soon to be part of the tarball |
---|
344 | |
---|
345 | * Thu Apr 27 2006 Patrick "Jima" Laughton <jima@auroralinux.org> 2.30-3 |
---|
346 | - Un-enabled HAVE_ISC_READER, a hack to enable a deprecated feature (request) |
---|
347 | - Split initscript & enable-dbus patches, conditionalized dbus for FC3 |
---|
348 | - Tweaked name field in changelog entries (trying to be consistent) |
---|
349 | |
---|
350 | * Mon Apr 24 2006 Patrick "Jima" Laughton <jima@auroralinux.org> 2.30-2 |
---|
351 | - Disabled stripping of binary while installing (oops) |
---|
352 | - Enabled HAVE_ISC_READER/HAVE_DBUS via patch |
---|
353 | - Added BuildReq for dbus-devel |
---|
354 | |
---|
355 | * Mon Apr 24 2006 Patrick "Jima" Laughton <jima@auroralinux.org> 2.30-1 |
---|
356 | - Initial Fedora Extras RPM |
---|