source: projects/specs/trunk/d/dnsmasq/dnsmasq-vl.spec @ 12521

Revision 12521, 12.5 KB checked in by tomop, 3 years ago (diff)

updated 11 packages

dnsmasq-2.84-1

firefox-78.7.0-1

kernel-5.4.93-1

libmaxminddb-1.5.0-1

nsd-4.3.5-1

openldap-2.4.57-1

python-pillow-8.1.0-1

rust-1.49.0-1

samba-4.13.4-1

sudo-1.9.5p2-1

thunderbird-78.7.0-1

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