Patrick Laughton c318a1
%define testrelease 0
Patrick Laughton 22ddee
%define releasecandidate 0
Patrick Laughton e85159
%if 0%{testrelease}
Patrick Laughton e85159
  %define extrapath test-releases/
Patrick Laughton 4c9487
  %define extraversion test30
Patrick Laughton e85159
%endif
Patrick Laughton e85159
%if 0%{releasecandidate}
Patrick Laughton e85159
  %define extrapath release-candidates/
Patrick Laughton c318a1
  %define extraversion rc1
Patrick Laughton e85159
%endif
Patrick Laughton 9fa2ba
Patrick Laughton b0365f
Name:           dnsmasq
Itamar Reis Peixoto 0d9e8c
Version:        2.52
Stephen Gallagher 027222
Release:        4%{?extraversion}%{?dist}
Patrick Laughton b0365f
Summary:        A lightweight DHCP/caching DNS server
Patrick Laughton b0365f
Patrick Laughton b0365f
Group:          System Environment/Daemons
Patrick Laughton 62e384
License:        GPLv2 or GPLv3
Patrick Laughton b0365f
URL:            http://www.thekelleys.org.uk/dnsmasq/
Ville Skyttä 27df76
Source0:        http://www.thekelleys.org.uk/dnsmasq/%{?extrapath}%{name}-%{version}%{?extraversion}.tar.lzma
Patrick Laughton a4a3c3
Source1:        %{name}.service
Patrick Laughton b0365f
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Patrick Laughton b0365f
Patrick Laughton b0365f
BuildRequires:  dbus-devel
Patrick Laughton c81c9a
BuildRequires:  pkgconfig
Patrick Laughton cc527e
Patrick Laughton a4a3c3
BuildRequires:  systemd-units
Patrick Laughton a4a3c3
Requires(post): systemd-units systemd-sysv chkconfig 
Patrick Laughton a4a3c3
Requires(preun): systemd-units
Patrick Laughton a4a3c3
Requires(postun): systemd-units 
Patrick Laughton a4a3c3
Patrick Laughton b0365f
Patrick Laughton b0365f
%description
Patrick Laughton b0365f
Dnsmasq is lightweight, easy to configure DNS forwarder and DHCP server. 
Patrick Laughton b0365f
It is designed to provide DNS and, optionally, DHCP, to a small network. 
Patrick Laughton b0365f
It can serve the names of local machines which are not in the global 
Patrick Laughton b0365f
DNS. The DHCP server integrates with the DNS server and allows machines 
Patrick Laughton b0365f
with DHCP-allocated addresses to appear in the DNS with names configured 
Patrick Laughton b0365f
either in each host or in a central configuration file. Dnsmasq supports 
Patrick Laughton b0365f
static and dynamic DHCP leases and BOOTP for network booting of diskless 
Patrick Laughton b0365f
machines.
Patrick Laughton b0365f
Patrick Laughton b0365f
Patrick Laughton b0365f
%prep
Patrick Laughton 9fa2ba
%setup -q -n %{name}-%{version}%{?extraversion}
Itamar Reis Peixoto 80a758
Itamar Reis Peixoto 80a758
# use /var/lib/dnsmasq instead of /var/lib/misc
Itamar Reis Peixoto 80a758
for file in dnsmasq.conf.example man/dnsmasq.8 man/es/dnsmasq.8 src/config.h; do
Itamar Reis Peixoto 80a758
    sed -i 's|/var/lib/misc/dnsmasq.leases|/var/lib/dnsmasq/dnsmasq.leases|g' "$file"
Itamar Reis Peixoto 80a758
done
Itamar Reis Peixoto 80a758
Itamar Reis Peixoto 80a758
#enable dbus
Itamar Reis Peixoto 0d9e8c
sed -i 's|/\* #define HAVE_DBUS \*/|#define HAVE_DBUS|g' src/config.h
Itamar Reis Peixoto 80a758
Itamar Reis Peixoto 80a758
#enable /etc/dnsmasq.d fix bz 526703
Itamar Reis Peixoto 80a758
sed -i 's|#conf-dir=/etc/dnsmasq.d|conf-dir=/etc/dnsmasq.d|g' dnsmasq.conf.example
Itamar Reis Peixoto 80a758
Patrick Laughton b0365f
Patrick Laughton b0365f
%build
Patrick Laughton b0365f
make %{?_smp_mflags}
Patrick Laughton b0365f
Patrick Laughton b0365f
Patrick Laughton b0365f
%install
Patrick Laughton b0365f
rm -rf $RPM_BUILD_ROOT
Patrick Laughton b0365f
# normally i'd do 'make install'...it's a bit messy, though
Itamar Reis Peixoto 80a758
mkdir -p $RPM_BUILD_ROOT%{_sbindir} \
Patrick Laughton c81c9a
        $RPM_BUILD_ROOT%{_mandir}/man8 \
Patrick Laughton 91d4b3
        $RPM_BUILD_ROOT%{_var}/lib/dnsmasq \
Patrick Laughton 65d7a4
        $RPM_BUILD_ROOT%{_sysconfdir}/dnsmasq.d \
Patrick Laughton c81c9a
        $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1/system.d
Patrick Laughton b0365f
install src/dnsmasq $RPM_BUILD_ROOT%{_sbindir}/dnsmasq
Patrick Laughton b0365f
install dnsmasq.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/dnsmasq.conf
Patrick Laughton aa950b
install dbus/dnsmasq.conf $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1/system.d/
Patrick Laughton 6a4bb3
install -m 644 man/dnsmasq.8 $RPM_BUILD_ROOT%{_mandir}/man8/
Patrick Laughton b0365f
Patrick Laughton a4a3c3
# Systemd 
Patrick Laughton a4a3c3
mkdir -p %{buildroot}%{_unitdir}
Patrick Laughton a4a3c3
install -m644 %{SOURCE1} %{buildroot}%{_unitdir}
Patrick Laughton a4a3c3
rm -rf %{buildroot}%{_initrddir}
Patrick Laughton a4a3c3
Patrick Laughton b0365f
%clean
Patrick Laughton b0365f
rm -rf $RPM_BUILD_ROOT
Patrick Laughton b0365f
Patrick Laughton b0365f
%post
Patrick Laughton a4a3c3
if [ $1 -eq 1 ] ; then
Patrick Laughton a4a3c3
    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
Patrick Laughton 1b0973
fi
Patrick Laughton b0365f
Patrick Laughton b0365f
%preun
Patrick Laughton a4a3c3
if [ $1 -eq 0 ]; then
Patrick Laughton a4a3c3
  /bin/systemctl --no-reload dnsmasq.service > /dev/null 2>&1 || :
Patrick Laughton a4a3c3
  /bin/systemctl stop dnsmasq.service > /dev/null 2>&1 || :
Patrick Laughton b0365f
fi
Patrick Laughton b0365f
Patrick Laughton b0365f
Patrick Laughton a4a3c3
%postun 
Patrick Laughton a4a3c3
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
Patrick Laughton a4a3c3
if [ $1 -ge 1 ] ; then
Patrick Laughton a4a3c3
    /bin/systemctl try-restart dnsmasq.service >/dev/null 2>&1 || :
Patrick Laughton a4a3c3
fi
Patrick Laughton a4a3c3
Patrick Laughton a4a3c3
%triggerun -- dnsmasq < 2.52-3
Patrick Laughton a4a3c3
%{_bindir}/systemd-sysv-convert --save dnsmasq >/dev/null 2>&1 ||:
Patrick Laughton a4a3c3
/bin/systemctl enable dnsmasq.service >/dev/null 2>&1
Patrick Laughton a4a3c3
/sbin/chkconfig --del dnsmasq >/dev/null 2>&1 || :
Patrick Laughton a4a3c3
/bin/systemctl try-restart dnsmasq.service >/dev/null 2>&1 || :
Patrick Laughton a4a3c3
Patrick Laughton b0365f
%files
Patrick Laughton b0365f
%defattr(-,root,root,-)
Patrick Laughton 474aab
%doc CHANGELOG COPYING FAQ doc.html setup.html dbus/DBus-interface
Patrick Laughton aa950b
%config(noreplace) %attr(644,root,root) %{_sysconfdir}/dnsmasq.conf
Patrick Laughton 474aab
%dir /etc/dnsmasq.d
Patrick Laughton 91d4b3
%dir %{_var}/lib/dnsmasq
Patrick Laughton aa950b
%config(noreplace) %attr(644,root,root) %{_sysconfdir}/dbus-1/system.d/dnsmasq.conf
Patrick Laughton a4a3c3
%{_unitdir}/%{name}.service
Patrick Laughton b0365f
%{_sbindir}/dnsmasq
Patrick Laughton b0365f
%{_mandir}/man8/dnsmasq*
Patrick Laughton b0365f
Patrick Laughton b0365f
Patrick Laughton b0365f
%changelog
Stephen Gallagher 027222
* Mon Aug 08 2011 Patrick "Jima" Laughton <jima@fedoraproject.org> - 2.52-4
Stephen Gallagher 027222
- Include systemd unit file
Stephen Gallagher 027222
Patrick Laughton a4a3c3
* Mon Aug 08 2011 Patrick "Jima" Laughton <jima@fedoraproject.org> - 2.52-3
Patrick Laughton a4a3c3
- Applied Jóhann's patch, minor cleanup
Patrick Laughton a4a3c3
Patrick Laughton a4a3c3
* Thu Jul 26 2011 Jóhann B. Guðmundsson <johannbg@gmail.com> - 2.52-3
Patrick Laughton a4a3c3
- Introduce systemd unit file, drop SysV support
Patrick Laughton a4a3c3
Dennis Gilmore 417aeb
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.52-2
Dennis Gilmore 417aeb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
Dennis Gilmore 417aeb
Itamar Reis Peixoto 0d9e8c
* Tue Jan 26 2010 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 2.52-1
Itamar Reis Peixoto 0d9e8c
- New Version 2.52
Itamar Reis Peixoto 0d9e8c
- fix condrestart() in initscript bz 547605
Itamar Reis Peixoto 0d9e8c
- fix sed to enable DBUS(the '*' need some escaping) bz 553161
Itamar Reis Peixoto 0d9e8c
Itamar Reis Peixoto 243a5a
* Sun Nov 22 2009 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 2.51-2
Itamar Reis Peixoto 243a5a
- fix bz 512664
Itamar Reis Peixoto 243a5a
Itamar Reis Peixoto fa0792
* Sat Oct 17 2009 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 2.51-1
Itamar Reis Peixoto 80a758
- move initscript from patch to a plain text file
Itamar Reis Peixoto 80a758
- drop (dnsmasq-configuration.patch) and use sed instead
Itamar Reis Peixoto 80a758
- enable /etc/dnsmasq.d fix bz 526703
Itamar Reis Peixoto 80a758
- change requires to package name instead of file
Itamar Reis Peixoto fa0792
- new version 2.51
Itamar Reis Peixoto 80a758
Mark McLoughlin 8b0560
* Mon Oct  5 2009 Mark McLoughlin <markmc@redhat.com> - 2.48-4
Mark McLoughlin 8b0560
- Fix multiple TFTP server vulnerabilities (CVE-2009-2957, CVE-2009-2958)
Mark McLoughlin 8b0560
Ville Skyttä 27df76
* Wed Aug 12 2009 Ville Skyttä <ville.skytta@iki.fi> - 2.48-3
Ville Skyttä 27df76
- Use lzma compressed upstream tarball.
Ville Skyttä 27df76
Jesse Keating 1ac3bd
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.48-2
Jesse Keating 1ac3bd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
Jesse Keating 1ac3bd
Patrick Laughton 01b090
* Wed Jun 10 2009 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.48-1
Patrick Laughton 01b090
- Bugfix/feature enhancement update
Patrick Laughton 01b090
- Fixing BZ#494094
Patrick Laughton 01b090
Patrick Laughton 7cad9d
* Fri May 29 2009 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.47-1
Patrick Laughton 7cad9d
- Bugfix/feature enhancement update
Patrick Laughton 7cad9d
Jesse Keating af406a
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.46-2
Jesse Keating af406a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
Jesse Keating af406a
Matej Cepl d2d844
* Mon Dec 29 2008 Matěj Cepl <mcepl@redhat.com> - 2.45-2
Matej Cepl d2d844
- rebuilt
Matej Cepl d2d844
Patrick Laughton 4bc8e5
* Mon Jul 21 2008 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.45-1
Patrick Laughton 4bc8e5
- Upstream release (bugfixes)
Patrick Laughton 4bc8e5
Patrick Laughton 3d10ff
* Wed Jul 16 2008 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.43-2
Patrick Laughton ce211c
- New upstream release, contains fixes for CVE-2008-1447/CERT VU#800113
Patrick Laughton 3d10ff
- Dropped patch for newer glibc (merged upstream)
Patrick Laughton ce211c
Patrick Laughton 62e384
* Wed Feb 13 2008 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.41-0.8
Patrick Laughton 62e384
- Added upstream-authored patch for newer glibc (thanks Simon!)
Patrick Laughton 62e384
Patrick Laughton 22ddee
* Wed Feb 13 2008 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.41-0.7
Patrick Laughton 22ddee
- New upstream release
Patrick Laughton 22ddee
Patrick Laughton c318a1
* Wed Jan 30 2008 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.41-0.6.rc1
Patrick Laughton c318a1
- Release candidate
Patrick Laughton c318a1
- Happy Birthday Isaac!
Patrick Laughton c318a1
Patrick Laughton 4c9487
* Wed Jan 23 2008 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.41-0.5.test30
Patrick Laughton 4c9487
- Bugfix update
Patrick Laughton 4c9487
Patrick Laughton d996be
* Mon Dec 31 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.41-0.4.test26
Patrick Laughton d996be
- Bugfix/feature enhancement update
Patrick Laughton d996be
Patrick Laughton d927a5
* Thu Dec 13 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.41-0.3.test24
Patrick Laughton d927a5
- Upstream fix for fairly serious regression
Patrick Laughton d927a5
Patrick Laughton 91d4b3
* Tue Dec 04 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.41-0.2.test20
Patrick Laughton a1e0af
- New upstream test release
Patrick Laughton 91d4b3
- Moving dnsmasq.leases to /var/lib/dnsmasq/ as per BZ#407901
Patrick Laughton 91d4b3
- Ignoring dangerous-command-in-%%post rpmlint warning (as per above fix)
Patrick Laughton 91d4b3
- Patch consolidation/cleanup
Patrick Laughton 91d4b3
- Removed conditionals for Fedora <= 3 and Aurora 2.0
Patrick Laughton a1e0af
Patrick Laughton f994f1
* Tue Sep 18 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.40-1
Patrick Laughton f994f1
- Finalized upstream release
Patrick Laughton f994f1
- Removing URLs from patch lines (CVS is the authoritative source)
Patrick Laughton f994f1
- Added more magic to make spinning rc/test packages more seamless
Patrick Laughton f994f1
Patrick Laughton 9fa2ba
* Sun Aug 26 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.40-0.1.rc2
Patrick Laughton 9fa2ba
- New upstream release candidate (feature-frozen), thanks Simon!
Patrick Laughton 9fa2ba
- License clarification
Patrick Laughton 9fa2ba
Patrick Laughton d1bbee
* Tue May 29 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.39-1
Patrick Laughton d1bbee
- New upstream version (bugfixes, enhancements)
Patrick Laughton d1bbee
Patrick Laughton d000b5
* Mon Feb 12 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.38-1
Patrick Laughton d000b5
- New upstream version with bugfix for potential hang
Patrick Laughton d000b5
Patrick Laughton 253ce1
* Tue Feb 06 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.37-1
Patrick Laughton 253ce1
- New upstream version
Patrick Laughton 253ce1
Patrick Laughton 793056
* Wed Jan 24 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.36-1
Patrick Laughton 793056
- New upstream version
Patrick Laughton 793056
Patrick Laughton 65d7a4
* Mon Nov 06 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.35-2
Patrick Laughton 65d7a4
- Stop creating /etc/sysconfig on %%install
Patrick Laughton 65d7a4
- Create /etc/dnsmasq.d on %%install
Patrick Laughton 65d7a4
Patrick Laughton 474aab
* Mon Nov 06 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.35-1
Patrick Laughton 474aab
- Update to 2.35
Patrick Laughton 474aab
- Removed UPGRADING_to_2.0 from %%doc as per upstream change
Patrick Laughton 474aab
- Enabled conf-dir in default config as per RFE BZ#214220 (thanks Chris!)
Patrick Laughton 474aab
- Added %%dir /etc/dnsmasq.d to %%files as per above RFE
Patrick Laughton 474aab
Patrick Laughton 1b0973
* Tue Oct 24 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.34-2
Patrick Laughton 1b0973
- Fixed BZ#212005
Patrick Laughton 1b0973
- Moved %%postun scriptlet to %%post, where it made more sense
Patrick Laughton 1b0973
- Render scriptlets safer
Patrick Laughton 1b0973
- Minor cleanup for consistency
Patrick Laughton 1b0973
Patrick Laughton c99b31
* Thu Oct 19 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.34-1
Patrick Laughton c99b31
- Hardcoded version in patches, as I'm getting tired of updating them
Patrick Laughton c99b31
- Update to 2.34
Patrick Laughton c99b31
Patrick Laughton 507262
* Mon Aug 28 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.33-2
Patrick Laughton 507262
- Rebuild for FC6
Patrick Laughton 507262
Patrick Laughton c81c9a
* Tue Aug 15 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.33-1
Patrick Laughton c81c9a
- Update
Patrick Laughton c81c9a
Patrick Laughton cc527e
* Sat Jul 22 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.32-3
Patrick Laughton cc527e
- Added pkgconfig BuildReq due to reduced buildroot
Patrick Laughton cc527e
Patrick Laughton b3b82d
* Thu Jul 20 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.32-2
Patrick Laughton b3b82d
- Forced update due to dbus version bump
Patrick Laughton b3b82d
Patrick Laughton bc74c1
* Mon Jun 12 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.32-1
Patrick Laughton bc74c1
- Update from upstream
Patrick Laughton bc74c1
- Patch from Dennis Gilmore fixed the conditionals to detect Aurora Linux
Patrick Laughton bc74c1
Patrick Laughton 60068e
* Mon May  8 2006 Patrick "Jima" Laughton <jima@auroralinux.org> 2.31-1
Patrick Laughton 60068e
- Removed dbus config patch (now provided upstream)
Patrick Laughton 60068e
- Patched in init script (no longer provided upstream)
Patrick Laughton 60068e
- Added DBus-interface to docs
Patrick Laughton 60068e
Patrick Laughton 527509
* Tue May  2 2006 Patrick "Jima" Laughton <jima@auroralinux.org> 2.30-4.2
Patrick Laughton 00482d
- More upstream-recommended cleanups :)
Patrick Laughton 00482d
- Killed sysconfig file (provides unneeded functionality)
Patrick Laughton 00482d
- Tweaked init script a little more
Patrick Laughton 00482d
Patrick Laughton aa950b
* Tue May  2 2006 Patrick "Jima" Laughton <jima@auroralinux.org> 2.30-4
Patrick Laughton aa950b
- Moved options out of init script and into /etc/sysconfig/dnsmasq
Patrick Laughton aa950b
- Disabled DHCP_LEASE in sysconfig file, fixing bug #190379
Patrick Laughton aa950b
- Simon Kelley provided dbus/dnsmasq.conf, soon to be part of the tarball
Patrick Laughton aa950b
Patrick Laughton 9433ec
* Thu Apr 27 2006 Patrick "Jima" Laughton <jima@auroralinux.org> 2.30-3
Patrick Laughton 9433ec
- Un-enabled HAVE_ISC_READER, a hack to enable a deprecated feature (request)
Patrick Laughton 9433ec
- Split initscript & enable-dbus patches, conditionalized dbus for FC3
Patrick Laughton 9433ec
- Tweaked name field in changelog entries (trying to be consistent)
Patrick Laughton 9433ec
Patrick Laughton 9433ec
* Mon Apr 24 2006 Patrick "Jima" Laughton <jima@auroralinux.org> 2.30-2
Patrick Laughton b0365f
- Disabled stripping of binary while installing (oops)
Patrick Laughton b0365f
- Enabled HAVE_ISC_READER/HAVE_DBUS via patch
Patrick Laughton b0365f
- Added BuildReq for dbus-devel
Patrick Laughton b0365f
Patrick Laughton 9433ec
* Mon Apr 24 2006 Patrick "Jima" Laughton <jima@auroralinux.org> 2.30-1
Patrick Laughton b0365f
- Initial Fedora Extras RPM