From e7a2e91072012a4e576dcd241be94438ad2c652b Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Mon, 17 Jan 2011 15:03:52 +0100 Subject: [PATCH] - nut updated to 2.6.0 - fixed reading reports than 8 bytes --- nut-2.2.2-halpath.patch | 35 ---------------------------- nut-2.4.3-bz575334.patch | 21 ----------------- nut-2.4.3-portcrash.patch | 13 ----------- nut-2.4.3-udev.patch | 21 ----------------- nut.spec | 49 +++++++++++---------------------------- 5 files changed, 14 insertions(+), 125 deletions(-) delete mode 100644 nut-2.2.2-halpath.patch delete mode 100644 nut-2.4.3-bz575334.patch delete mode 100644 nut-2.4.3-portcrash.patch delete mode 100644 nut-2.4.3-udev.patch diff --git a/nut-2.2.2-halpath.patch b/nut-2.2.2-halpath.patch deleted file mode 100644 index eefb81b..0000000 --- a/nut-2.2.2-halpath.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff -up nut-2.4.3/m4/nut_check_libhal.m4.halpath nut-2.4.3/m4/nut_check_libhal.m4 ---- nut-2.4.3/m4/nut_check_libhal.m4.halpath 2010-02-11 22:43:05.000000000 +0100 -+++ nut-2.4.3/m4/nut_check_libhal.m4 2010-02-24 15:04:17.455678931 +0100 -@@ -86,29 +86,8 @@ if test -z "${nut_have_libhal_seen}"; th - dnl As per HAL spec, §5 Callouts and §2 Device Information Files - dnl - addon install path: $libdir/hal - AC_MSG_CHECKING(for libhal Callouts path) -- HAL_CALLOUTS_PATH=`pkg-config --silence-errors --variable=libexecdir hal` -- if test -n "$HAL_CALLOUTS_PATH"; then -- AC_MSG_RESULT(${HAL_CALLOUTS_PATH}) -- else -- # fallback to detecting the right path -- if (test -d "${libdir}/hal"); then -- # For Debian -- HAL_CALLOUTS_PATH="${libdir}/hal" -- AC_MSG_RESULT(${HAL_CALLOUTS_PATH}) -- elif (test -d "/usr/libexec"); then -- # For RedHat -- HAL_CALLOUTS_PATH="${libexecdir}" -- AC_MSG_RESULT(${HAL_CALLOUTS_PATH}) -- elif (test -d "/usr/lib/hal"); then -- # For OpenSUSE -- HAL_CALLOUTS_PATH="${libdir}/hal" -- AC_MSG_RESULT(${HAL_CALLOUTS_PATH}) -- else -- # FIXME -- HAL_CALLOUTS_PATH="${libdir}/hal" -- AC_MSG_RESULT(using default (${HAL_CALLOUTS_PATH})) -- fi -- fi -+ HAL_CALLOUTS_PATH="${libexecdir}" -+ AC_MSG_RESULT(${HAL_CALLOUTS_PATH}) - - dnl - fdi install path: $datarootdir/hal/fdi/information/20thirdparty - AC_MSG_CHECKING(for libhal Device Information path) diff --git a/nut-2.4.3-bz575334.patch b/nut-2.4.3-bz575334.patch deleted file mode 100644 index b14f8c0..0000000 --- a/nut-2.4.3-bz575334.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -up nut-2.4.3/drivers/libhid.c.bz575334 nut-2.4.3/drivers/libhid.c ---- nut-2.4.3/drivers/libhid.c.bz575334 2010-03-22 17:34:16.251422549 +0100 -+++ nut-2.4.3/drivers/libhid.c 2010-03-22 17:34:16.278422151 +0100 -@@ -141,7 +141,7 @@ static int refresh_report_buffer(reportb - { - int id = pData->ReportID; - int r; -- unsigned char buf[SMALLBUF]; -+ unsigned char buf[8]; - - if (rbuf->ts[id] + age > time(NULL)) { - /* buffered report is still good; nothing to do */ -@@ -469,7 +469,7 @@ bool_t HIDSetItemValue(hid_dev_handle_t - */ - int HIDGetEvents(hid_dev_handle_t udev, HIDData_t **event, int eventsize) - { -- unsigned char buf[SMALLBUF]; -+ unsigned char buf[8]; - int itemCount = 0; - int buflen, r, i; - HIDData_t *pData; diff --git a/nut-2.4.3-portcrash.patch b/nut-2.4.3-portcrash.patch deleted file mode 100644 index d6b66fa..0000000 --- a/nut-2.4.3-portcrash.patch +++ /dev/null @@ -1,13 +0,0 @@ -~/cvsf/nut/devel ~/cvsf/nut/devel -diff -up nut-2.4.3/drivers/upsdrvctl.c.portcrash nut-2.4.3/drivers/upsdrvctl.c ---- nut-2.4.3/drivers/upsdrvctl.c.portcrash 2010-07-26 11:38:19.830941009 +0200 -+++ nut-2.4.3/drivers/upsdrvctl.c 2010-07-26 11:39:32.302764246 +0200 -@@ -131,7 +131,7 @@ static void stop_driver(const ups_t *ups - ups->driver, ups->upsname); - ret = stat(pidfn, &fs); - -- if (ret != 0) { -+ if ((ret != 0) && (ups->port != NULL)) { - snprintf(pidfn, sizeof(pidfn), "%s/%s-%s.pid", altpidpath(), - ups->driver, xbasename(ups->port)); - ret = stat(pidfn, &fs); diff --git a/nut-2.4.3-udev.patch b/nut-2.4.3-udev.patch deleted file mode 100644 index b0a9043..0000000 --- a/nut-2.4.3-udev.patch +++ /dev/null @@ -1,21 +0,0 @@ -change BUS to SUBSYSTEMS in udev rules - -There is one missing change in nut-usbups.rules.in: BUS -> SUBSYSTEMS. -Previous change (rev2071) missed this. Now, the latest udev started to complain: -... udevd[31526]: BUS= will be removed in a future udev version ... -Information about udev change can be found in udev repo: -http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;h=95776dc6ec174f47fa4dd4d8abf5d457223e5dd4 - -Index: nut/scripts/udev/nut-usbups.rules.in -=================================================================== ---- nut/scripts/udev/nut-usbups.rules.in (revision 2405) -+++ new/scripts/udev/nut-usbups.rules.in (working copy) -@@ -3,7 +3,7 @@ - ACTION!="add", GOTO="nut-usbups_rules_end" - SUBSYSTEM=="usb_device", GOTO="nut-usbups_rules_real" - SUBSYSTEM=="usb", GOTO="nut-usbups_rules_real" --BUS!="usb", GOTO="nut-usbups_rules_end" -+SUBSYSTEMS!="usb", GOTO="nut-usbups_rules_end" - - LABEL="nut-usbups_rules_real" - # Krauler UP-M500VA - blazer_usb diff --git a/nut.spec b/nut.spec index dd18dd7..ce48f28 100644 --- a/nut.spec +++ b/nut.spec @@ -8,31 +8,19 @@ Summary: Network UPS Tools Name: nut -Version: 2.4.3 -Release: 9%{?dist} +Version: 2.6.0 +Release: 1%{?dist} Group: Applications/System License: GPLv2+ Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Url: http://www.networkupstools.org/ -Source: http://www.networkupstools.org/source/2.4/%{name}-%{version}.tar.gz +Source: http://www.networkupstools.org/source/2.6/%{name}-%{version}.tar.gz Source1: ups.init Source2: ups.sysconfig Source3: nut-client.tmpfiles Patch0: nut-2.2.1-conf.patch -#rejected upstream -Patch1: nut-2.2.2-halpath.patch - -#from upstream, required for nut <= 2.4.3, bz#575334 -Patch2: nut-2.4.3-bz575334.patch - -# sent upstream, for nut<=2.4.3, rhbz#573806 -Patch3: nut-2.4.3-udev.patch - -# for nut <= 2.4.3, rhbz#616375 -Patch4: nut-2.4.3-portcrash.patch - Requires: nut-client => 2.4.0 hal Requires(pre): hal Requires(post): fileutils chkconfig initscripts @@ -125,14 +113,14 @@ necessary to develop NUT client applications. %prep %setup -q %patch0 -p1 -b .conf -%patch1 -p1 -b .halpath -%patch2 -p1 -b .bz575334 -%patch3 -p1 -b .udevpatch -%patch4 -p1 -b .portcrash %build autoreconf -i %configure \ + --with-all \ + --with-hal \ + --with-hal-callouts-path=%{_libexecdir} \ + --with-cgi \ --with-user=%{name} \ --with-group=dialout \ --with-statepath=%{piddir} \ @@ -141,12 +129,10 @@ autoreconf -i --sysconfdir=%{_sysconfdir}/ups \ --with-cgipath=%{cgidir} \ --with-drvpath=%{modeldir} \ - --with-all \ - --with-ipv6 \ - --with-linux-hiddev=%{_includedir}/linux/hiddev.h \ --with-pkgconfig-dir=%{_libdir}/pkgconfig \ --disable-static \ --libdir=%{_libdir} +# --with-doc \ asciidoc >= 8.6.3 is required #remove rpath sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool @@ -154,15 +140,6 @@ sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool make %{?_smp_mflags} -# fix old enconding manpages -mv man/upscode2.8 man/upscode2.8.iso -iconv -f ISO8859-1 -t UTF-8 -o man/upscode2.8 man/upscode2.8.iso -mv man/bcmxcp.8 man/bcmxcp.8.iso -iconv -f ISO8859-1 -t UTF-8 -o man/bcmxcp.8 man/bcmxcp.8.iso -mv man/bcmxcp_usb.8 man/bcmxcp_usb.8.iso -iconv -f ISO8859-1 -t UTF-8 -o man/bcmxcp_usb.8 man/bcmxcp_usb.8.iso -rm -f man/*.iso - %install rm -rf %{buildroot} @@ -184,7 +161,7 @@ install -m 755 %{SOURCE1} %{buildroot}%{initdir}/ups install -p -D -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/tmpfiles.d/nut-client.conf %endif -install -m 644 man/gamatronic.* %{buildroot}%{_mandir}/man8/ +#install -m 644 man/gamatronic.* %{buildroot}%{_mandir}/man8/ install -m 644 scripts/hal/ups-nut-device.fdi \ %{buildroot}%{_datadir}/hal/fdi/information/20thirdparty/20-ups-nut-device.fdi @@ -290,10 +267,8 @@ rm -rf %{buildroot} %{_mandir}/man8/isbmex.8.gz %{_mandir}/man8/ivtscd.8.gz %{_mandir}/man8/liebert.8.gz -%{_mandir}/man8/liebertgxt2.8.gz +%{_mandir}/man8/liebert-esp2.8.gz %{_mandir}/man8/masterguard.8.gz -%{_mandir}/man8/megatec.8.gz -%{_mandir}/man8/megatec_usb.8.gz %{_mandir}/man8/metasys.8.gz %{_mandir}/man8/microdowell.8.gz %{_mandir}/man8/mge-utalk.8.gz @@ -379,6 +354,10 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/libupsclient.pc %changelog +* Mon Jan 17 2011 Michal Hlavinka - 2.6.0-1 +- nut updated to 2.6.0 +- fixed reading reports than 8 bytes + * Fri Nov 26 2010 Michal Hlavinka - 2.4.3-9 - use %%ghost for /var/run/nut (#656645)