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

Revision 12487, 12.4 KB checked in by tomop, 4 years ago (diff)

updated 11 packages

chrony-3.5.1-2

dnsmasq-2.82-1

epiphany-3.36.4-2

filezilla-3.50.0-1

gnutls-3.6.15-1

libfilezilla-0.24.1-1

nettle-3.6-1

rdesktop-1.9.0-2

tigervnc-1.10.1-2

webkitgtk4-2.28.4-1

wxGTK3-3.0.5-1

Line 
1%bcond_with systemd
2
3Name:           dnsmasq
4Version:        2.82
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* 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
Note: See TracBrowser for help on using the repository browser.