rpms/nut/devel nut-2.2.0-glibcopen.patch, NONE, 1.1 nut-2.2.0-udevusb.patch, NONE, 1.1 nut.spec, 1.46, 1.47 ups.init, 1.7, 1.8 ups.sysconfig, 1.3, 1.4

Tomas Smetana (tsmetana) fedora-extras-commits at redhat.com
Thu Aug 16 10:31:45 UTC 2007


Author: tsmetana

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

Modified Files:
	nut.spec ups.init ups.sysconfig 
Added Files:
	nut-2.2.0-glibcopen.patch nut-2.2.0-udevusb.patch 
Log Message:
* Wed Aug 15 2007 Tomas Smetana <tsmetana at redhat.com> 2.2.0-2
- fix #249028 - usb udev rules
- update initscript and sysconfig file
- fix calls to open() for compatibility with the new glibc


nut-2.2.0-glibcopen.patch:

--- NEW FILE nut-2.2.0-glibcopen.patch ---
--- nut-2.2.0/drivers/megatec_usb.c.open	2007-08-16 09:32:03.000000000 +0200
+++ nut-2.2.0/drivers/megatec_usb.c	2007-08-16 09:32:24.000000000 +0200
@@ -209,7 +209,7 @@
 	/* link the matchers */
 	regex_matcher->next = &subdriver_matcher;
 
-	ret = usb->open(&udev, &hiddevice, regex_matcher, NULL, MODE_NOHID);
+	ret = (usb->open)(&udev, &hiddevice, regex_matcher, NULL, MODE_NOHID);
 	if (ret < 0)
 		usb_open_error(port);
 
--- nut-2.2.0/drivers/libhid.c.open	2007-08-16 09:28:05.000000000 +0200
+++ nut-2.2.0/drivers/libhid.c	2007-08-16 09:28:23.000000000 +0200
@@ -589,7 +589,7 @@
 	}
 
 	/* get and parse descriptors (dev, cfg and report) */
-	ReportSize = comm_driver->open(udevp, hd, matcher, ReportDesc, mode);
+	ReportSize = (comm_driver->open)(udevp, hd, matcher, ReportDesc, mode);
 
 	if (ReportSize == -1)
 		return NULL;

nut-2.2.0-udevusb.patch:

--- NEW FILE nut-2.2.0-udevusb.patch ---
--- nut-2.2.0/scripts/udev/nut-usbups.rules.in.udevusb	2007-08-15 13:25:38.000000000 +0200
+++ nut-2.2.0/scripts/udev/nut-usbups.rules.in	2007-08-15 13:25:50.000000000 +0200
@@ -1,6 +1,6 @@
 # udev rules for the NUT USB drivers
 
-SUBSYSTEM!="usb_device", GOTO="nut-usbups_rules_end"
+SUBSYSTEM!="usb", GOTO="nut-usbups_rules_end"
 ACTION!="add", GOTO="nut-usbups_rules_end"
 
 # MGE UPS SYSTEMS - usbhid-ups


Index: nut.spec
===================================================================
RCS file: /cvs/pkgs/rpms/nut/devel/nut.spec,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- nut.spec	13 Jul 2007 12:35:43 -0000	1.46
+++ nut.spec	16 Aug 2007 10:31:13 -0000	1.47
@@ -9,9 +9,9 @@
 Summary: Network UPS Tools
 Name: nut
 Version: 2.2.0
-Release: 1.1%{?dist}
+Release: 2%{?dist}
 Group: Applications/System
-License: GPL
+License: GPLv2+
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Url: http://www.networkupstools.org/
 Source: http://www.networkupstools.org/source/2.0/%{name}-%{version}.tar.gz
@@ -20,6 +20,8 @@
 
 Patch0: nut-2.2.0-conf.patch
 Patch1: nut-2.2.0-multilib.patch
+Patch2: nut-2.2.0-udevusb.patch
+Patch3: nut-2.2.0-glibcopen.patch
 
 Requires: nut-client => 2.0.0 hal dbus-glib
 Requires(post): fileutils /sbin/chkconfig /sbin/service
@@ -86,6 +88,8 @@
 %setup -q
 %patch0 -p1 -b .conf
 %patch1 -p1 -b .multilib
+%patch2 -p1 -b .udevusb
+%patch3 -p1 -b .open
 
 %build
 %configure \
@@ -105,8 +109,6 @@
 	--disable-static
 
 make %{?_smp_mflags}
-make %{?_smp_mflags} snmp
-make %{?_smp_mflags} usb
 
 %install
 rm -rf %{buildroot}
@@ -275,6 +277,11 @@
 %{_libdir}/pkgconfig/libupsclient.pc
 
 %changelog
+* Wed Aug 15 2007 Tomas Smetana <tsmetana at redhat.com> 2.2.0-2
+- fix #249028 - usb udev rules
+- update initscript and sysconfig file
+- fix calls to open() for compatibility with the new glibc
+
 * Fri Jul 13 2007 Tomas Smetana <tsmetana at redhat.com> 2.2.0-1.1
 - rebuild
 


Index: ups.init
===================================================================
RCS file: /cvs/pkgs/rpms/nut/devel/ups.init,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ups.init	13 Jul 2007 11:03:22 -0000	1.7
+++ ups.init	16 Aug 2007 10:31:13 -0000	1.8
@@ -25,28 +25,24 @@
 
 start() {
 	if [ "$SERVER" = "yes" ]; then
-		# Exit if server = yes and model = NONE (not configured)
-
-		if [ "$MODEL" = "NONE" ]; then 
-			exit 0
-		fi
-
-		echo -n $"Starting $MODEL: "
-		if [ "$MODEL" = "upsdrvctl" ]; then
-			daemon /sbin/upsdrvctl start
-		else
-			daemon /sbin/$MODEL $OPTIONS $DEVICE 
-		fi
+		echo -n $"Starting UPS driver controller: "
+		daemon /sbin/upsdrvctl start
+		RETVAL=$?
 		echo
 
 		prog="upsd"
 		echo -n $"Starting $prog: "
 		daemon /usr/sbin/upsd $UPSD_OPTIONS
-		RETVAL=$?
+		if [ "$RETVAL" = 0 ]; then
+			RETVAL=$?
+		fi
 		echo
 
 		echo -n $"Starting UPS monitor (master): "
 		daemon /usr/sbin/upsmon
+		if [ "$RETVAL" = 0 ]; then
+			RETVAL=$?
+		fi
 		echo
 	else
 		echo -n $"Starting UPS monitor (slave): "
@@ -122,7 +118,11 @@
 	status)
 		if [ "$SERVER" = "yes" ]; then
 			if [ "$MODEL" = "upsdrvctl" ]; then
-				/sbin/upsdrvctl -v status
+				# show status of each configured driver
+				for MYMODEL in $(egrep '^[[:space:]]*driver' /etc/ups/ups.conf \
+						| sed 's/.*=[[:space:]]*//'); do 
+					status $MYMODEL
+				done
 			else
 				status $MODEL
 			fi


Index: ups.sysconfig
===================================================================
RCS file: /cvs/pkgs/rpms/nut/devel/ups.sysconfig,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ups.sysconfig	13 Jul 2007 11:03:22 -0000	1.3
+++ ups.sysconfig	16 Aug 2007 10:31:13 -0000	1.4
@@ -1,23 +1,8 @@
 # If the UPS is locally attached set it to "yes"
 SERVER=yes
-# Model of the UPS (filename to call for it, without path)
-# Example - one of
-#	apcsmart	- APC SMartUPS and similar
-#	optiups
-#	bestups
-#	genericups
-#	ups-trust425+625
-#  upsdrvctl
-# You MUST change this, or set SERVER to "no"
-# To support multiple drivers, set MODEL=upsdrvctl
-MODEL=NONE
-# UPS device - needed if UPS is locally attached
-DEVICE=/dev/ttyS0
-# Any options to pass to $MODEL
-# ex. for my TrippLite UPS, use 
-#	OPTIONS="-t 5"
-OPTIONS=
 # Any options to pass to upsd
 UPSD_OPTIONS=
+# This *must* be the same as in /etc/ups/upsmon.conf
+POWERDOWNFLAG=/etc/killpower
 #
 # [End]




More information about the fedora-extras-commits mailing list