rpms/dnsmasq/devel dnsmasq-configuration.patch, NONE, 1.1 dnsmasq.spec, 1.25, 1.26

Patrick Laughton (jima) fedora-extras-commits at redhat.com
Tue Dec 4 15:47:24 UTC 2007


Author: jima

Update of /cvs/pkgs/rpms/dnsmasq/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27409

Modified Files:
	dnsmasq.spec 
Added Files:
	dnsmasq-configuration.patch 
Log Message:

* Tue Dec 04 2007 Patrick "Jima" Laughton <jima at beer.tclug.org> 2.41-0.2.test20
- New upstream test release
- Moving dnsmasq.leases to /var/lib/dnsmasq/ as per BZ#407901
- Ignoring dangerous-command-in-%%post rpmlint warning (as per above fix)
- Patch consolidation/cleanup
- Removed conditionals for Fedora <= 3 and Aurora 2.0


dnsmasq-configuration.patch:

--- NEW FILE dnsmasq-configuration.patch ---
diff -up dnsmasq-2.41test20/src/config.h.orig dnsmasq-2.41test20/src/config.h
--- dnsmasq-2.41test20/src/config.h.orig	2007-11-27 14:09:01.000000000 -0600
+++ dnsmasq-2.41test20/src/config.h	2007-12-04 08:21:49.000000000 -0600
@@ -42,7 +42,7 @@
 #elif defined(__sun__)
 #   define LEASEFILE "/var/cache/dnsmasq.leases"
 #else
-#   define LEASEFILE "/var/lib/misc/dnsmasq.leases"
+#   define LEASEFILE "/var/lib/dnsmasq/dnsmasq.leases"
 #endif
 #if defined(__FreeBSD__)
 #   define CONFFILE "/usr/local/etc/dnsmasq.conf"
@@ -182,7 +182,7 @@ NOTES:
 #define HAVE_TFTP
 /* #define HAVE_BROKEN_RTC */
 /* #define HAVE_ISC_READER */
-/* #define HAVE_DBUS */
+#define HAVE_DBUS
 
 #if defined(HAVE_BROKEN_RTC) && defined(HAVE_ISC_READER)
 #  error HAVE_ISC_READER is not compatible with HAVE_BROKEN_RTC
diff -up dnsmasq-2.41test20/man/es/dnsmasq.8.orig dnsmasq-2.41test20/man/es/dnsmasq.8
--- dnsmasq-2.41test20/man/es/dnsmasq.8.orig	2007-11-27 14:09:01.000000000 -0600
+++ dnsmasq-2.41test20/man/es/dnsmasq.8	2007-12-04 08:33:07.000000000 -0600
@@ -1075,7 +1075,7 @@ un CPU de 1GHz y aproximadamente 60MB de
 
 .IR /etc/ethers
 
-.IR /var/lib/misc/dnsmasq.leases 
+.IR /var/lib/dnsmasq/dnsmasq.leases 
 
 .IR /var/db/dnsmasq.leases
 
diff -up dnsmasq-2.41test20/man/dnsmasq.8.orig dnsmasq-2.41test20/man/dnsmasq.8
--- dnsmasq-2.41test20/man/dnsmasq.8.orig	2007-11-27 14:09:01.000000000 -0600
+++ dnsmasq-2.41test20/man/dnsmasq.8	2007-12-04 08:33:07.000000000 -0600
@@ -1070,7 +1070,7 @@ file needs a 1GHz processor and about 60
 
 .IR /etc/ethers
 
-.IR /var/lib/misc/dnsmasq.leases 
+.IR /var/lib/dnsmasq/dnsmasq.leases 
 
 .IR /var/db/dnsmasq.leases
 
diff -up dnsmasq-2.41test20/dnsmasq.conf.example.orig dnsmasq-2.41test20/dnsmasq.conf.example
--- dnsmasq-2.41test20/dnsmasq.conf.example.orig	2007-11-27 14:09:01.000000000 -0600
+++ dnsmasq-2.41test20/dnsmasq.conf.example	2007-12-04 08:44:16.000000000 -0600
@@ -344,7 +344,7 @@
 # The DHCP server needs somewhere on disk to keep its lease database.
 # This defaults to a sane location, but if you want to change it, use
 # the line below.
-#dhcp-leasefile=/var/lib/misc/dnsmasq.leases
+#dhcp-leasefile=/var/lib/dnsmasq/dnsmasq.leases
 
 # Set the DHCP server to authoritative mode. In this mode it will barge in
 # and take over the lease for any client which broadcasts on the network,
@@ -461,4 +461,4 @@
 
 # Include a another lot of configuration options.
 #conf-file=/etc/dnsmasq.more.conf
-#conf-dir=/etc/dnsmasq.d
+conf-dir=/etc/dnsmasq.d


Index: dnsmasq.spec
===================================================================
RCS file: /cvs/pkgs/rpms/dnsmasq/devel/dnsmasq.spec,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- dnsmasq.spec	27 Nov 2007 22:04:41 -0000	1.25
+++ dnsmasq.spec	4 Dec 2007 15:46:52 -0000	1.26
@@ -11,7 +11,7 @@
 
 Name:           dnsmasq
 Version:        2.41
-Release:        0.1.%{?extraversion}%{?dist}
+Release:        0.2.%{?extraversion}%{?dist}
 Summary:        A lightweight DHCP/caching DNS server
 
 Group:          System Environment/Daemons
@@ -19,18 +19,15 @@
 URL:            http://www.thekelleys.org.uk/dnsmasq/
 Source0:        http://www.thekelleys.org.uk/dnsmasq/%{?extrapath}%{name}-%{version}%{?extraversion}.tar.gz
 Patch0:         %{name}-2.33-initscript.patch
-Patch1:         %{name}-2.33-enable-dbus.patch
-Patch2:         %{name}-2.35-conf-dir.patch
+Patch1:         %{name}-configuration.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
-%if "%fedora" > "3" || "%aurora" > "2"
 BuildRequires:  dbus-devel
-%endif
-
 BuildRequires:  pkgconfig
 
 Requires(post):  /sbin/chkconfig
 Requires(post):  /sbin/service
+Requires(post):  /bin/sed /bin/grep
 Requires(preun): /sbin/chkconfig
 Requires(preun): /sbin/service
 
@@ -48,10 +45,7 @@
 %prep
 %setup -q -n %{name}-%{version}%{?extraversion}
 %patch0 -p1
-%if "%fedora" > "3" || "%aurora" > "2"
 %patch1 -p1
-%endif
-%patch2 -p1
 
 %build
 make %{?_smp_mflags}
@@ -62,13 +56,12 @@
 # normally i'd do 'make install'...it's a bit messy, though
 mkdir -p $RPM_BUILD_ROOT%{_sbindir} $RPM_BUILD_ROOT%{_initrddir} \
         $RPM_BUILD_ROOT%{_mandir}/man8 \
+        $RPM_BUILD_ROOT%{_var}/lib/dnsmasq \
         $RPM_BUILD_ROOT%{_sysconfdir}/dnsmasq.d \
         $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1/system.d
 install src/dnsmasq $RPM_BUILD_ROOT%{_sbindir}/dnsmasq
 install dnsmasq.conf.example $RPM_BUILD_ROOT%{_sysconfdir}/dnsmasq.conf
-%if "%fedora" > "3" || "%aurora" > "2"
 install dbus/dnsmasq.conf $RPM_BUILD_ROOT%{_sysconfdir}/dbus-1/system.d/
-%endif
 install rpm/dnsmasq.init $RPM_BUILD_ROOT%{_initrddir}/dnsmasq
 install -m 644 man/dnsmasq.8 $RPM_BUILD_ROOT%{_mandir}/man8/
 
@@ -77,6 +70,20 @@
 
 %post
 if [ "$1" = "2" ]; then # if we're being upgraded
+    # if using the old leases location, move the file to the new one
+    # but only if we're not clobbering another file
+    #
+    if [ -f /var/lib/misc/dnsmasq.leases -a ! -f /var/lib/dnsmasq/dnsmasq.leases ]; then
+        # causes rpmlint to report dangerous-command-in-post,
+        # but that's the price of selinux compliance :-(
+        mv -f /var/lib/misc/dnsmasq.leases /var/lib/dnsmasq/dnsmasq.leases || :
+    fi
+    # ugly, but kind of necessary
+    if [ ! `grep -q dhcp-leasefile=/var/lib/misc/dnsmasq.leases %{_sysconfdir}/dnsmasq.conf` ]; then
+        cp %{_sysconfdir}/dnsmasq.conf %{_sysconfdir}/dnsmasq.conf.tmp || :
+        sed -e 's/var\/lib\/misc/var\/lib\/dnsmasq/' < %{_sysconfdir}/dnsmasq.conf.tmp > %{_sysconfdir}/dnsmasq.conf || :
+        rm -f %{_sysconfdir}/dnsmasq.conf.tmp || :
+    fi
     /sbin/service dnsmasq condrestart >/dev/null 2>&1 || :
 else # if we're being installed
     /sbin/chkconfig --add dnsmasq
@@ -94,20 +101,20 @@
 %doc CHANGELOG COPYING FAQ doc.html setup.html dbus/DBus-interface
 %config(noreplace) %attr(644,root,root) %{_sysconfdir}/dnsmasq.conf
 %dir /etc/dnsmasq.d
-%if "%fedora" > "3" || "%aurora" > "2"
+%dir %{_var}/lib/dnsmasq
 %config(noreplace) %attr(644,root,root) %{_sysconfdir}/dbus-1/system.d/dnsmasq.conf
-%endif
 %{_initrddir}/dnsmasq
 %{_sbindir}/dnsmasq
 %{_mandir}/man8/dnsmasq*
 
 
 %changelog
-* Tue Nov 27 2007 Patrick "Jima" Laughton <jima at beer.tclug.org> 2.41-0.1.test20
-- New upstream test release
-
-* Mon Oct 22 2007 Patrick "Jima" Laughton <jima at beer.tclug.org> 2.41-0.1.test11
+* Tue Dec 04 2007 Patrick "Jima" Laughton <jima at beer.tclug.org> 2.41-0.2.test20
 - New upstream test release
+- Moving dnsmasq.leases to /var/lib/dnsmasq/ as per BZ#407901
+- Ignoring dangerous-command-in-%%post rpmlint warning (as per above fix)
+- Patch consolidation/cleanup
+- Removed conditionals for Fedora <= 3 and Aurora 2.0
 
 * Tue Sep 18 2007 Patrick "Jima" Laughton <jima at beer.tclug.org> 2.40-1
 - Finalized upstream release




More information about the fedora-extras-commits mailing list