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

Revision 12413, 12.3 KB checked in by tomop, 4 years ago (diff)

updated 6 packages

cyrus-sasl-2.1.27-2

dnsmasq-2.81-1

freerdp-2.1.1-1

glib2-2.64.3-1

libmariadb-3.1.8-1

openssh-8.3p1-1

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