c318a1e
%define testrelease 0
609b978
%define releasecandidate 0
e85159c
%if 0%{testrelease}
e85159c
  %define extrapath test-releases/
4c94878
  %define extraversion test30
e85159c
%endif
e85159c
%if 0%{releasecandidate}
e85159c
  %define extrapath release-candidates/
16e329b
  %define extraversion rc5
e85159c
%endif
9fa2ba4
b0365fb
Name:           dnsmasq
b0df409
Version:        2.66
c217afd
Release:        3%{?extraversion}%{?dist}
b0365fb
Summary:        A lightweight DHCP/caching DNS server
b0365fb
b0365fb
Group:          System Environment/Daemons
779e6b5
License:        GPLv2
b0365fb
URL:            http://www.thekelleys.org.uk/dnsmasq/
e517ebc
Source0:        http://www.thekelleys.org.uk/dnsmasq/%{?extrapath}%{name}-%{version}%{?extraversion}.tar.gz
a4a3c32
Source1:        %{name}.service
d474b81
c217afd
#include upstream bug fix patches committed after stable release
c217afd
# commit 4582c0efe7d7af93517b1f3bcc7af67685ab3e5c
c217afd
Patch0:         %{name}-2.66-Fix-wrong_size_in_memset_call.patch
c217afd
# commit bd08ae67f9a0cae2ce15be885254cad9449d4551
c217afd
Patch1:         %{name}-2.66-Allow-option_number_zero_in_encapsulated_DHCP_options.patch
c217afd
b0365fb
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
b0365fb
b0365fb
BuildRequires:  dbus-devel
c81c9a2
BuildRequires:  pkgconfig
24df3be
BuildRequires:  libidn-devel
cc527ef
31764d7
BuildRequires:  systemd
31764d7
Requires(post): systemd systemd-sysv chkconfig
31764d7
Requires(preun): systemd
31764d7
Requires(postun): systemd
a4a3c32
b0365fb
b0365fb
%description
92202b2
Dnsmasq is lightweight, easy to configure DNS forwarder and DHCP server.
92202b2
It is designed to provide DNS and, optionally, DHCP, to a small network.
92202b2
It can serve the names of local machines which are not in the global
92202b2
DNS. The DHCP server integrates with the DNS server and allows machines
92202b2
with DHCP-allocated addresses to appear in the DNS with names configured
92202b2
either in each host or in a central configuration file. Dnsmasq supports
92202b2
static and dynamic DHCP leases and BOOTP for network booting of diskless
b0365fb
machines.
b0365fb
389b910
%package        utils
389b910
Summary:        Utilities for manipulating DHCP server leases
389b910
Group:          System Environment/Daemons
389b910
389b910
%description    utils
389b910
Utilities that use the standard DHCP protocol to
389b910
query/remove a DHCP server's leases.
389b910
b0365fb
b0365fb
%prep
9fa2ba4
%setup -q -n %{name}-%{version}%{?extraversion}
80a7583
c217afd
%patch0 -p1 -b .wrong_size
c217afd
%patch1 -p1 -b .zero_DHCP_option
c217afd
80a7583
# use /var/lib/dnsmasq instead of /var/lib/misc
80a7583
for file in dnsmasq.conf.example man/dnsmasq.8 man/es/dnsmasq.8 src/config.h; do
80a7583
    sed -i 's|/var/lib/misc/dnsmasq.leases|/var/lib/dnsmasq/dnsmasq.leases|g' "$file"
80a7583
done
80a7583
80a7583
#enable dbus
0d9e8c4
sed -i 's|/\* #define HAVE_DBUS \*/|#define HAVE_DBUS|g' src/config.h
80a7583
24df3be
#enable IDN support
24df3be
sed -i 's|/\* #define HAVE_IDN \*/|#define HAVE_IDN|g' src/config.h
24df3be
80a7583
#enable /etc/dnsmasq.d fix bz 526703
80a7583
sed -i 's|#conf-dir=/etc/dnsmasq.d|conf-dir=/etc/dnsmasq.d|g' dnsmasq.conf.example
80a7583
b0365fb
b0365fb
%build
4db4008
# We need to compile the daemon with PIE, PIC and FULL RELRO
4db4008
RPM_LD_FLAGS="-Wl,-z,relro,-z,now -pie"
e34aa6b
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -fPIE -DPIE -fPIC"
e34aa6b
f600696
make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS"
f600696
make -C contrib/wrt %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS"
b0365fb
b0365fb
b0365fb
%install
b0365fb
rm -rf $RPM_BUILD_ROOT
b0365fb
# normally i'd do 'make install'...it's a bit messy, though
80a7583
mkdir -p $RPM_BUILD_ROOT%{_sbindir} \
c81c9a2
        $RPM_BUILD_ROOT%{_mandir}/man8 \
91d4b30
        $RPM_BUILD_ROOT%{_var}/lib/dnsmasq \
65d7a40
        $RPM_BUILD_ROOT%{_sysconfdir}/dnsmasq.d \
c81c9a2
        $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1/system.d
b0365fb
install src/dnsmasq $RPM_BUILD_ROOT%{_sbindir}/dnsmasq
b0365fb
install dnsmasq.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/dnsmasq.conf
aa950b3
install dbus/dnsmasq.conf $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1/system.d/
6a4bb30
install -m 644 man/dnsmasq.8 $RPM_BUILD_ROOT%{_mandir}/man8/
b0365fb
389b910
# utils sub package
389b910
mkdir -p $RPM_BUILD_ROOT%{_bindir} \
389b910
         $RPM_BUILD_ROOT%{_mandir}/man1
389b910
install -m 755 contrib/wrt/dhcp_release $RPM_BUILD_ROOT%{_bindir}/dhcp_release
389b910
install -m 644 contrib/wrt/dhcp_release.1 $RPM_BUILD_ROOT%{_mandir}/man1/dhcp_release.1
389b910
install -m 755 contrib/wrt/dhcp_lease_time $RPM_BUILD_ROOT%{_bindir}/dhcp_lease_time
389b910
install -m 644 contrib/wrt/dhcp_lease_time.1 $RPM_BUILD_ROOT%{_mandir}/man1/dhcp_lease_time.1
389b910
92202b2
# Systemd
a4a3c32
mkdir -p %{buildroot}%{_unitdir}
a4a3c32
install -m644 %{SOURCE1} %{buildroot}%{_unitdir}
a4a3c32
rm -rf %{buildroot}%{_initrddir}
a4a3c32
b0365fb
%clean
b0365fb
rm -rf $RPM_BUILD_ROOT
b0365fb
b0365fb
%post
31764d7
%systemd_post dnsmasq.service
b0365fb
b0365fb
%preun
31764d7
%systemd_preun dnsmasq.service
b0365fb
92202b2
%postun
31764d7
%systemd_postun_with_restart dnsmasq.service
a4a3c32
a4a3c32
%triggerun -- dnsmasq < 2.52-3
a4a3c32
%{_bindir}/systemd-sysv-convert --save dnsmasq >/dev/null 2>&1 ||:
a4a3c32
/sbin/chkconfig --del dnsmasq >/dev/null 2>&1 || :
a4a3c32
/bin/systemctl try-restart dnsmasq.service >/dev/null 2>&1 || :
a4a3c32
b0365fb
%files
b0365fb
%defattr(-,root,root,-)
474aabd
%doc CHANGELOG COPYING FAQ doc.html setup.html dbus/DBus-interface
aa950b3
%config(noreplace) %attr(644,root,root) %{_sysconfdir}/dnsmasq.conf
474aabd
%dir /etc/dnsmasq.d
91d4b30
%dir %{_var}/lib/dnsmasq
aa950b3
%config(noreplace) %attr(644,root,root) %{_sysconfdir}/dbus-1/system.d/dnsmasq.conf
a4a3c32
%{_unitdir}/%{name}.service
b0365fb
%{_sbindir}/dnsmasq
b0365fb
%{_mandir}/man8/dnsmasq*
b0365fb
389b910
%files utils
389b910
%{_bindir}/dhcp_*
389b910
%{_mandir}/man1/dhcp_*
b0365fb
b0365fb
%changelog
4db4008
* Sat Apr 20 2013 Tomas Hozza <thozza@redhat.com> - 2.66-3
4db4008
- Use Full RELRO when linking the daemon
e34aa6b
- compile the daemon with PIE
c217afd
- include two fixes from upstream git repo
c217afd
609b978
* Thu Apr 18 2013 Tomas Hozza <thozza@redhat.com> - 2.66-2
609b978
- New stable version dnsmasq-2.66
609b978
- Drop of merged patch
609b978
16e329b
* Fri Apr 12 2013 Tomas Hozza <thozza@redhat.com> - 2.66-1.rc5
16e329b
- Update to latest dnsmasq-2.66rc5
16e329b
- Include fix for segfault when lease limit is reached
16e329b
b0df409
* Fri Mar 22 2013 Tomas Hozza <thozza@redhat.com> - 2.66-1.rc1
b0df409
- Update to latest dnsmasq-2.66rc1
b0df409
- Dropping unneeded patches
24df3be
- Enable IDN support
b0df409
bebbe6c
* Fri Mar 15 2013 Tomas Hozza <thozza@redhat.com> - 2.65-5
bebbe6c
- Allocate dhcp_buff-ers also if daemon->ra_contexts to prevent SIGSEGV (#920300)
bebbe6c
261955a
* Thu Jan 31 2013 Tomas Hozza <thozza@redhat.com> - 2.65-4
261955a
- Handle locally-routed DNS Queries (#904940)
261955a
f600696
* Thu Jan 24 2013 Tomas Hozza <thozza@redhat.com> - 2.65-3
f600696
- build dnsmasq with $RPM_OPT_FLAGS, $RPM_LD_FLAGS explicitly (#903362) 
f600696
837eefa
* Tue Jan 22 2013 Tomas Hozza <thozza@redhat.com> - 2.65-2
837eefa
- Fix for CVE-2013-0198 (checking of TCP connection interfaces) (#901555)
837eefa
89b8fd1
* Sat Dec 15 2012 Tomas Hozza <thozza@redhat.com> - 2.65-1
89b8fd1
- new version 2.65
89b8fd1
6df5634
* Wed Dec 05 2012 Tomas Hozza <thozza@redhat.com> - 2.64-1
6df5634
- New version 2.64
6df5634
- Merged patches dropped
6df5634
fcb9614
* Tue Nov 20 2012 Tomas Hozza <thozza@redhat.com> - 2.63-4
fcb9614
- Remove EnvironmentFile from service file (#878343)
fcb9614
d474b81
* Mon Nov 19 2012 Tomas Hozza <thozza@redhat.com> - 2.63-3
d474b81
- dhcp6 support fixes (#867054)
0a7f00b
- removed "-s $HOSTNAME" from .service file (#753656, #822797)
d474b81
31764d7
* Tue Oct 23 2012 Tomas Hozza <thozza@redhat.com> - 2.63-2
31764d7
- Introduce new systemd-rpm macros in dnsmasq spec file (#850096)
31764d7
33f9cfc
* Thu Aug 23 2012 Douglas Schilling Landgraf <dougsland@redhat.com> - 2.63-1
e517ebc
- Use .tar.gz compression, in upstream site there is no .lzma anymore
e517ebc
- New version 2.63
1a4e01a
edbef00
* Sat Feb 11 2012 Pádraig Brady <P@draigBrady.com> - 2.59-5
edbef00
- Compile DHCP lease management utils with RPM_OPT_FLAGS
edbef00
389b910
* Thu Feb  9 2012 Pádraig Brady <P@draigBrady.com> - 2.59-4
389b910
- Include DHCP lease management utils in a subpackage
389b910
b1ab587
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.59-3
b1ab587
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
b1ab587
2845e25
* Fri Aug 26 2011 Douglas Schilling Landgraf <dougsland@redhat.com> - 2.59-2
2845e25
- do not enable service by default
2845e25
c9a3d1c
* Fri Aug 26 2011 Douglas Schilling Landgraf <dougsland@redhat.com> - 2.59-1
c9a3d1c
- New version 2.59
c9a3d1c
- Fix regression in 2.58 (IPv6 issue) - bz 744814
c9a3d1c
ce3da53
* Fri Aug 26 2011 Douglas Schilling Landgraf <dougsland@redhat.com> - 2.58-1
ce3da53
- Fixed License
ce3da53
- New version 2.58
ce3da53
79727a1
* Mon Aug 08 2011 Patrick "Jima" Laughton <jima@fedoraproject.org> - 2.52-5
0272224
- Include systemd unit file
0272224
a4a3c32
* Mon Aug 08 2011 Patrick "Jima" Laughton <jima@fedoraproject.org> - 2.52-3
a4a3c32
- Applied Jóhann's patch, minor cleanup
a4a3c32
33f9cfc
* Tue Jul 26 2011 Jóhann B. Guðmundsson <johannbg@gmail.com> - 2.52-3
a4a3c32
- Introduce systemd unit file, drop SysV support
a4a3c32
417aeba
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.52-2
417aeba
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
417aeba
0d9e8c4
* Tue Jan 26 2010 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 2.52-1
0d9e8c4
- New Version 2.52
0d9e8c4
- fix condrestart() in initscript bz 547605
0d9e8c4
- fix sed to enable DBUS(the '*' need some escaping) bz 553161
0d9e8c4
243a5a3
* Sun Nov 22 2009 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 2.51-2
243a5a3
- fix bz 512664
243a5a3
fa07928
* Sat Oct 17 2009 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 2.51-1
80a7583
- move initscript from patch to a plain text file
80a7583
- drop (dnsmasq-configuration.patch) and use sed instead
80a7583
- enable /etc/dnsmasq.d fix bz 526703
80a7583
- change requires to package name instead of file
fa07928
- new version 2.51
80a7583
8b0560d
* Mon Oct  5 2009 Mark McLoughlin <markmc@redhat.com> - 2.48-4
8b0560d
- Fix multiple TFTP server vulnerabilities (CVE-2009-2957, CVE-2009-2958)
8b0560d
27df76d
* Wed Aug 12 2009 Ville Skyttä <ville.skytta@iki.fi> - 2.48-3
27df76d
- Use lzma compressed upstream tarball.
27df76d
1ac3bd3
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.48-2
1ac3bd3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
1ac3bd3
01b090e
* Wed Jun 10 2009 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.48-1
01b090e
- Bugfix/feature enhancement update
01b090e
- Fixing BZ#494094
01b090e
7cad9d9
* Fri May 29 2009 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.47-1
7cad9d9
- Bugfix/feature enhancement update
7cad9d9
af406a1
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.46-2
af406a1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
af406a1
d2d8444
* Mon Dec 29 2008 Matěj Cepl <mcepl@redhat.com> - 2.45-2
d2d8444
- rebuilt
d2d8444
4bc8e57
* Mon Jul 21 2008 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.45-1
4bc8e57
- Upstream release (bugfixes)
4bc8e57
3d10ffe
* Wed Jul 16 2008 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.43-2
ce211c7
- New upstream release, contains fixes for CVE-2008-1447/CERT VU#800113
3d10ffe
- Dropped patch for newer glibc (merged upstream)
ce211c7
62e3847
* Wed Feb 13 2008 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.41-0.8
62e3847
- Added upstream-authored patch for newer glibc (thanks Simon!)
62e3847
22ddee6
* Wed Feb 13 2008 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.41-0.7
22ddee6
- New upstream release
22ddee6
c318a1e
* Wed Jan 30 2008 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.41-0.6.rc1
c318a1e
- Release candidate
c318a1e
- Happy Birthday Isaac!
c318a1e
4c94878
* Wed Jan 23 2008 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.41-0.5.test30
4c94878
- Bugfix update
4c94878
d996be6
* Mon Dec 31 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.41-0.4.test26
d996be6
- Bugfix/feature enhancement update
d996be6
d927a5c
* Thu Dec 13 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.41-0.3.test24
d927a5c
- Upstream fix for fairly serious regression
d927a5c
91d4b30
* Tue Dec 04 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.41-0.2.test20
a1e0af8
- New upstream test release
91d4b30
- Moving dnsmasq.leases to /var/lib/dnsmasq/ as per BZ#407901
91d4b30
- Ignoring dangerous-command-in-%%post rpmlint warning (as per above fix)
91d4b30
- Patch consolidation/cleanup
91d4b30
- Removed conditionals for Fedora <= 3 and Aurora 2.0
a1e0af8
f994f12
* Tue Sep 18 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.40-1
f994f12
- Finalized upstream release
f994f12
- Removing URLs from patch lines (CVS is the authoritative source)
f994f12
- Added more magic to make spinning rc/test packages more seamless
f994f12
9fa2ba4
* Sun Aug 26 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.40-0.1.rc2
9fa2ba4
- New upstream release candidate (feature-frozen), thanks Simon!
9fa2ba4
- License clarification
9fa2ba4
d1bbeeb
* Tue May 29 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.39-1
d1bbeeb
- New upstream version (bugfixes, enhancements)
d1bbeeb
d000b5a
* Mon Feb 12 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.38-1
d000b5a
- New upstream version with bugfix for potential hang
d000b5a
253ce1d
* Tue Feb 06 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.37-1
253ce1d
- New upstream version
253ce1d
7930563
* Wed Jan 24 2007 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.36-1
7930563
- New upstream version
7930563
65d7a40
* Mon Nov 06 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.35-2
65d7a40
- Stop creating /etc/sysconfig on %%install
65d7a40
- Create /etc/dnsmasq.d on %%install
65d7a40
474aabd
* Mon Nov 06 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.35-1
474aabd
- Update to 2.35
474aabd
- Removed UPGRADING_to_2.0 from %%doc as per upstream change
474aabd
- Enabled conf-dir in default config as per RFE BZ#214220 (thanks Chris!)
474aabd
- Added %%dir /etc/dnsmasq.d to %%files as per above RFE
474aabd
1b09738
* Tue Oct 24 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.34-2
1b09738
- Fixed BZ#212005
1b09738
- Moved %%postun scriptlet to %%post, where it made more sense
1b09738
- Render scriptlets safer
1b09738
- Minor cleanup for consistency
1b09738
c99b31e
* Thu Oct 19 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.34-1
c99b31e
- Hardcoded version in patches, as I'm getting tired of updating them
c99b31e
- Update to 2.34
c99b31e
507262e
* Mon Aug 28 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.33-2
507262e
- Rebuild for FC6
507262e
c81c9a2
* Tue Aug 15 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.33-1
c81c9a2
- Update
c81c9a2
cc527ef
* Sat Jul 22 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.32-3
cc527ef
- Added pkgconfig BuildReq due to reduced buildroot
cc527ef
b3b82db
* Thu Jul 20 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.32-2
b3b82db
- Forced update due to dbus version bump
b3b82db
bc74c1b
* Mon Jun 12 2006 Patrick "Jima" Laughton <jima@beer.tclug.org> 2.32-1
bc74c1b
- Update from upstream
bc74c1b
- Patch from Dennis Gilmore fixed the conditionals to detect Aurora Linux
bc74c1b
60068e4
* Mon May  8 2006 Patrick "Jima" Laughton <jima@auroralinux.org> 2.31-1
60068e4
- Removed dbus config patch (now provided upstream)
60068e4
- Patched in init script (no longer provided upstream)
60068e4
- Added DBus-interface to docs
60068e4
5275092
* Tue May  2 2006 Patrick "Jima" Laughton <jima@auroralinux.org> 2.30-4.2
00482dd
- More upstream-recommended cleanups :)
00482dd
- Killed sysconfig file (provides unneeded functionality)
00482dd
- Tweaked init script a little more
00482dd
aa950b3
* Tue May  2 2006 Patrick "Jima" Laughton <jima@auroralinux.org> 2.30-4
aa950b3
- Moved options out of init script and into /etc/sysconfig/dnsmasq
aa950b3
- Disabled DHCP_LEASE in sysconfig file, fixing bug #190379
aa950b3
- Simon Kelley provided dbus/dnsmasq.conf, soon to be part of the tarball
aa950b3
9433ece
* Thu Apr 27 2006 Patrick "Jima" Laughton <jima@auroralinux.org> 2.30-3
9433ece
- Un-enabled HAVE_ISC_READER, a hack to enable a deprecated feature (request)
9433ece
- Split initscript & enable-dbus patches, conditionalized dbus for FC3
9433ece
- Tweaked name field in changelog entries (trying to be consistent)
9433ece
9433ece
* Mon Apr 24 2006 Patrick "Jima" Laughton <jima@auroralinux.org> 2.30-2
b0365fb
- Disabled stripping of binary while installing (oops)
b0365fb
- Enabled HAVE_ISC_READER/HAVE_DBUS via patch
b0365fb
- Added BuildReq for dbus-devel
b0365fb
9433ece
* Mon Apr 24 2006 Patrick "Jima" Laughton <jima@auroralinux.org> 2.30-1
b0365fb
- Initial Fedora Extras RPM