From f8a74dc14eb716747b3e0f0bcd33e5f0194b831044acf7a31667a66dcf00cfc7 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Mon, 10 Aug 2009 16:20:29 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/nut?expand=0&rev=22 --- nut-2.2.2.tar.bz2 | 3 -- nut-2.4.1.tar.bz2 | 3 ++ nut-hal.patch | 47 +++++++--------- nut-intptr.patch | 22 -------- nut-libtool.patch | 129 -------------------------------------------- nut-preconfig.patch | 8 +-- nut.changes | 38 +++++++++++++ nut.spec | 25 ++++----- 8 files changed, 76 insertions(+), 199 deletions(-) delete mode 100644 nut-2.2.2.tar.bz2 create mode 100644 nut-2.4.1.tar.bz2 delete mode 100644 nut-intptr.patch delete mode 100644 nut-libtool.patch diff --git a/nut-2.2.2.tar.bz2 b/nut-2.2.2.tar.bz2 deleted file mode 100644 index e885728..0000000 --- a/nut-2.2.2.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d2a2d9ed1acd8b49f6898daf7c720199478111443708794c0b8e856d83a7f1f0 -size 887444 diff --git a/nut-2.4.1.tar.bz2 b/nut-2.4.1.tar.bz2 new file mode 100644 index 0000000..39de4a4 --- /dev/null +++ b/nut-2.4.1.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cee0802b21d2fe5222115182fcaa94acbd87e96863e9ae60203f4ae168a3ea9c +size 878389 diff --git a/nut-hal.patch b/nut-hal.patch index 6af7802..6487656 100644 --- a/nut-hal.patch +++ b/nut-hal.patch @@ -1,33 +1,22 @@ ---- scripts/hal/ups-nut-device.fdi -+++ scripts/hal/ups-nut-device.fdi -@@ -1,7 +1,7 @@ - - - -- -+ - - - ---- configure -+++ configure -@@ -9738,7 +9738,7 @@ echo $ECHO_N "checking for libhal Callou - if (test -d "/usr/lib/hal" || test -d "/usr/lib64/hal") - then - # For Debian -- HAL_CALLOUTS_PATH="${libdir}/hal" -+ HAL_CALLOUTS_PATH="${prefix}/lib/hal" - { echo "$as_me:$LINENO: result: ${HAL_CALLOUTS_PATH}" >&5 - echo "${ECHO_T}${HAL_CALLOUTS_PATH}" >&6; } - else # For RedHat --- m4/nut_check_libhal.m4 +++ m4/nut_check_libhal.m4 -@@ -66,7 +66,7 @@ if test -z "${nut_have_libhal_seen}"; th - if (test -d "/usr/lib/hal" || test -d "/usr/lib64/hal") +@@ -79,6 +79,11 @@ + if (test -z "$HAL_CALLOUTS_PATH") then - # For Debian -- HAL_CALLOUTS_PATH="${libdir}/hal" -+ HAL_CALLOUTS_PATH="${prefix}/lib/hal" + # fallback to detecting the right path ++ if (test -d "${prefix}/lib/hal") ++ then ++ HAL_CALLOUTS_PATH="${prefix}/lib/hal" ++ AC_MSG_RESULT(${HAL_CALLOUTS_PATH}) ++ else + if (test -d "${libdir}/hal") + then + # For Debian +@@ -95,6 +100,7 @@ + AC_MSG_RESULT(using default (${HAL_CALLOUTS_PATH})) + fi + fi ++ fi + else AC_MSG_RESULT(${HAL_CALLOUTS_PATH}) - else # For RedHat - if (test -d "/usr/libexec") + fi diff --git a/nut-intptr.patch b/nut-intptr.patch deleted file mode 100644 index 8f74c57..0000000 --- a/nut-intptr.patch +++ /dev/null @@ -1,22 +0,0 @@ -main-hal.c: In function 'dbus_filter_function': -main-hal.c:553: warning: passing argument 4 of 'dbus_send_reply' makes pointer from integer without a cast -main-hal.c:559: warning: passing argument 4 of 'dbus_send_reply' makes pointer from integer without a cast -================================================================================ ---- drivers/main-hal.c -+++ drivers/main-hal.c -@@ -550,13 +550,13 @@ - - if (b_enable==TRUE) { - if (upsh.instcmd("beeper.enable", NULL) != STAT_INSTCMD_HANDLED) { -- dbus_send_reply(connection, message, DBUS_TYPE_INT32, -1); -+ dbus_send_reply(connection, message, DBUS_TYPE_INT32, (void *)(-1)); - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - } - } - else { - if (upsh.instcmd("beeper.disable", NULL) != STAT_INSTCMD_HANDLED) { -- dbus_send_reply(connection, message, DBUS_TYPE_INT32, -1); -+ dbus_send_reply(connection, message, DBUS_TYPE_INT32, (void *)(-1)); - return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; - } - } diff --git a/nut-libtool.patch b/nut-libtool.patch deleted file mode 100644 index 733aa03..0000000 --- a/nut-libtool.patch +++ /dev/null @@ -1,129 +0,0 @@ ---- clients/Makefile.am -+++ clients/Makefile.am -@@ -35,7 +35,7 @@ - upsmon_SOURCES = upsmon.c upsmon.h upsclient.h - - upssched_SOURCES = upssched.c upssched.h --upssched_LDADD = ../common/libcommon.a $(NETLIBS) ../common/parseconf.o -+upssched_LDADD = ../common/libcommon.a ../common/libparseconf.la $(NETLIBS) - - upsimage_cgi_SOURCES = upsimage.c upsclient.h upsimagearg.h cgilib.c cgilib.h - upsimage_cgi_LDADD = $(LDADD) $(LIBGD_LDFLAGS) -@@ -46,17 +46,5 @@ - - # not LDADD. - libupsclient_la_SOURCES = upsclient.c upsclient.h --libupsclient_la_LIBADD = ../common/parseconf.lo -+libupsclient_la_LIBADD = ../common/libparseconf.la - libupsclient_la_LDFLAGS = -version-info 1:0:0 -- --# rules for cross-directory targets --../common/libcommon.a: FORCE -- (cd ../common/ && $(MAKE) $(AM_MAKEFLAGS) libcommon.a) -- --../common/parseconf.o: -- (cd ../common/ && $(MAKE) $(AM_MAKEFLAGS) parseconf.o) -- --../common/parseconf.lo: -- (cd ../common/ && $(MAKE) $(AM_MAKEFLAGS) parseconf.lo) -- --FORCE: ---- common/Makefile.am -+++ common/Makefile.am -@@ -3,17 +3,8 @@ - AM_CFLAGS = -I$(top_srcdir)/include - - noinst_LIBRARIES = libcommon.a --libcommon_a_SOURCES = common.c ../include/nut_version.h --libcommon_a_LIBADD = $(LIBOBJS) $(ALLOCA) -+libcommon_a_SOURCES = common.c state.c upsconf.c ../include/nut_version.h -+libcommon_a_LIBADD = libparseconf.la - --all: libcommon.a upsconf.o parseconf.o state.o parseconf.lo -- --# Define a dummy library so that Automake builds rules for the --# corresponding object files. This library is not actually built, --EXTRA_LIBRARIES = libdummy.a --libdummy_a_SOURCES = parseconf.c state.c upsconf.c -- --../include/nut_version.h: FORCE -- (cd ../include/ && $(MAKE) $(AM_MAKEFLAGS) nut_version.h) -- --FORCE: -+noinst_LTLIBRARIES = libparseconf.la -+libparseconf_la_SOURCES = parseconf.c ---- drivers/Makefile.am -+++ drivers/Makefile.am -@@ -2,9 +2,8 @@ - - # by default, link programs in this directory with libcommon.a - #FIXME: SERLIBS is only useful for LDADD_DRIVERS_SERIAL not for LDADD_COMMON --LDADD_COMMON = ../common/libcommon.a --LDADD_DRIVERS = $(LDADD_COMMON) ../common/upsconf.o \ -- ../common/parseconf.o ../common/state.o main.o dstate.o -+LDADD_COMMON = ../common/libcommon.a ../common/libparseconf.la -+LDADD_DRIVERS = $(LDADD_COMMON) main.o dstate.o - LDADD_HAL_DRIVERS = $(LDADD_COMMON) libnuthalmain.a - LDADD_DRIVERS_SERIAL = $(LDADD_DRIVERS) $(SERLIBS) serial.o - -@@ -86,7 +85,7 @@ - - # upsdrvctl: the all-singing all-dancing driver control program - upsdrvctl_SOURCES = upsdrvctl.c --upsdrvctl_LDADD = $(LDADD_COMMON) ../common/upsconf.o ../common/parseconf.o -+upsdrvctl_LDADD = $(LDADD_COMMON) - - # serial drivers: all of them use standard LDADD and CFLAGS - al175_SOURCES = al175.c -@@ -226,18 +225,3 @@ - libnuthalmain_a_SOURCES = main-hal.c dstate-hal.c - - MOSTLYCLEANFILES = libnuthalmain.a -- --# rules for cross-directory targets --../common/libcommon.a: FORCE -- (cd ../common/ && $(MAKE) $(AM_MAKEFLAGS) libcommon.a) -- --../common/upsconf.o: -- (cd ../common/ && $(MAKE) $(AM_MAKEFLAGS) upsconf.o) -- --../common/parseconf.o: -- (cd ../common/ && $(MAKE) $(AM_MAKEFLAGS) parseconf.o) -- --../common/state.o: -- (cd ../common/ && $(MAKE) $(AM_MAKEFLAGS) state.o) -- --FORCE: ---- server/Makefile.am -+++ server/Makefile.am -@@ -7,8 +7,7 @@ - if WITH_SSL - AM_CFLAGS += $(LIBSSL_CFLAGS) - endif --LDADD = ../common/libcommon.a ../common/state.o ../common/upsconf.o \ -- ../common/parseconf.o $(NETLIBS) -+LDADD = ../common/libcommon.a ../common/libparseconf.la $(NETLIBS) - if WITH_SSL - LDADD += $(LIBSSL_LDFLAGS) - endif -@@ -22,19 +21,4 @@ - netlist.h netmisc.h netset.h netuser.h ssl.h sstate.h stype.h upsd.h \ - upstype.h user-data.h user.h - --sockdebug_SOURCES = sockdebug.c -- --# rules for cross-directory targets --../common/libcommon.a: FORCE -- (cd ../common/ && $(MAKE) $(AM_MAKEFLAGS) libcommon.a) -- --../common/upsconf.o: -- (cd ../common/ && $(MAKE) $(AM_MAKEFLAGS) upsconf.o) -- --../common/parseconf.o: -- (cd ../common/ && $(MAKE) $(AM_MAKEFLAGS) parseconf.o) -- --../common/state.o: -- (cd ../common/ && $(MAKE) $(AM_MAKEFLAGS) state.o) -- --FORCE: -+sockdebug_SOURCES = sockdebug.c diff --git a/nut-preconfig.patch b/nut-preconfig.patch index 8bd03ac..7b72b23 100644 --- a/nut-preconfig.patch +++ b/nut-preconfig.patch @@ -19,10 +19,10 @@ + desc = "Local UPS" --- conf/upsd.users.sample +++ conf/upsd.users.sample -@@ -68,3 +68,13 @@ +@@ -62,3 +62,13 @@ # The matching MONITOR line in your upsmon.conf would look like this: # - # MONITOR myups@myhost 1 monuser pass master (or slave) + # MONITOR myups@localhost 1 upsmon pass master (or slave) + +[upsmaster] + password = @UPSD_INITIAL_MASTER_PASSWORD@ @@ -51,9 +51,9 @@ # -------------------------------------------------------------------------- # MONITOR ("master"|"slave") -@@ -83,6 +83,8 @@ - # MONITOR myups@bigserver 1 monmaster blah master +@@ -84,6 +84,8 @@ # MONITOR su700@server.example.com 1 upsmon secretpass slave + # MONITOR myups@localhost 1 upsmon pass master (or slave) +MONITOR myups@localhost 1 upsmaster @UPSD_INITIAL_MASTER_PASSWORD@ master + diff --git a/nut.changes b/nut.changes index b8fa818..b5bc8a8 100644 --- a/nut.changes +++ b/nut.changes @@ -1,3 +1,41 @@ +------------------------------------------------------------------- +Fri Aug 7 15:13:55 CEST 2009 - sbrabec@suse.cz + +- Updated to version 2.4.1: + * Support for new devices: MicroDowell Enterprise B8, B10, N8, + N11, N15, N20, N22, N30, N40, N50, N60 and HiBox ST. + * NUT-Monitor now better handles the ups.status field. + * Support for Power Distribution Units (PDUs), including: Eaton + ePDUs (Managed and Monitored), some Aphel models, some Raritan + PDUs, and the whole list of Powerman supported devices, + Chloride Desk Power 650, Cyber Power Systems Value + 400E/600E/800E (USB models), Delta GES602N, Digitus DN-170020, + the whole Eaton ranges (mostly composed of MGE Office + Protection Systems and Powerware units) including BladeUPS, + Forza Power Technologies SL-1001, HP PowerTrust 2997A, HP R/T + 2200 G2, Infosec XP 1000 and XP 500, Ippon Back Power Pro + (serial and USB), Kebo 1200D/D Series, Liebert PowerSure + Personal XT, MGE Office Protection Systems Protection Station, + Neus 400va and 600va, Phasak 400VA and 600VA, Plexus 500VA, + Powercom Black Knight PRO / King PRO and Imperial, + PowerKinetics BlackOut Buster, Sweex 1000 USB, UNITEK Alpha + 500, WinPower CPM-800. + * NUT now embeds Python client support through the PyNUTClient + module and the NUT-Monitor application. + * The dummy-ups driver now support a "repeater" mode. + * tcp-wrappers support has been added to the upsd server. + * The nut.conf file has been introduced. + * NUT now ships a bash completion function for 'upsc' command. + * Many internal changes to improve maintenability: + * the USB information automatic extraction to generate the + various USB helper files, + * the upsdrv_info_t structure to track more driver + information, and remove the need for the upsdrv_banner() + function, + * common USB code refactoring, as it is done for the serial + functions. + * Tons of bugfixes, cleanup and improvements. + ------------------------------------------------------------------- Tue Jul 14 10:03:39 CEST 2009 - coolo@novell.com diff --git a/nut.spec b/nut.spec index f888ff6..356c6fb 100644 --- a/nut.spec +++ b/nut.spec @@ -1,5 +1,5 @@ # -# spec file for package nut (Version 2.2.2) +# spec file for package nut (Version 2.4.1) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -18,7 +18,7 @@ Name: nut -BuildRequires: apache2-devel dbus-1-devel gd-devel hal-devel libneon-devel libopenssl-devel libusb-devel net-snmp-devel openssl-devel pkg-config tcpd-devel +BuildRequires: apache2-devel dbus-1-devel gd-devel hal-devel libneon-devel libopenssl-devel libusb-devel net-snmp-devel openssl-devel pkg-config powerman-devel tcpd-devel # for directory ownership: BuildRequires: pm-utils License: GPL v2 or later @@ -27,8 +27,8 @@ Provides: smartups Obsoletes: smartups Conflicts: apcupsd Summary: Network UPS Tools Core (Unbreakable Power Supply Monitoring) -Version: 2.2.2 -Release: 71 +Version: 2.4.1 +Release: 1 Url: http://www.networkupstools.org/ Source: %{name}-%{version}.tar.bz2 Source1: upsd.init @@ -41,8 +41,6 @@ Patch: nut-preconfig.patch Patch3: nut-notifyflag.patch Patch4: nut-powersave.patch Patch6: nut-udev.patch -Patch8: nut-libtool.patch -Patch11: nut-intptr.patch Patch12: nut-hal.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build PreReq: pwdutils /bin/chown @@ -60,11 +58,12 @@ Requires: nut-package = %{version} %define QUOTE " %define BACKSLASH \\ # Collect all devices listed in ups-nut-device.fdi: -%define USBDRIVERS %(set -x ; bunzip2 <%{S:0} | fgrep -a -A4 usb_device.vendor_id | tr '%{BACKSLASH}n' '-' | tr 'a-z' 'A-Z' | sed 's/--/%{BACKSLASH}n/g' | sed 's/^.*USB_DEVICE%{BACKSLASH}.VENDOR_ID%{QUOTE} INT=%{QUOTE}0X%{BACKSLASH}%{LBRACE}[^%{QUOTE}]*%{BACKSLASH}%{RBRACE}%{QUOTE}.*USB_DEVICE%{BACKSLASH}.PRODUCT_ID%{QUOTE} INT=%{QUOTE}0X%{BACKSLASH}%{LBRACE}[^%{QUOTE}]*%{BACKSLASH}%{RBRACE}%{QUOTE}.*INFO%{BACKSLASH}.ADDONS%{QUOTE} TYPE=%{QUOTE}STRLIST%{QUOTE}>%{BACKSLASH}%{LBRACE}[^<]*%{BACKSLASH}%{RBRACE}<.*$/%{BACKSLASH}3=modalias%{LBRACE}usb:v%{BACKSLASH}1p%{BACKSLASH}2d*dc*dsc*dp*ic*isc*ip*%{RBRACE}/') +%define USBHIDDRIVERS %(set -x ; bunzip2 <%{S:0} | tr a-z A-Z | fgrep -a -A1 USBHID-UPS | sed -n 's/.*SYSFS{IDVENDOR}==%{QUOTE}%{BACKSLASH}%{LBRACE}[^%{QUOTE}]*%{BACKSLASH}%{RBRACE}%{QUOTE}, SYSFS{IDPRODUCT}==%{QUOTE}%{BACKSLASH}%{LBRACE}[^%{QUOTE}]*%{BACKSLASH}%{RBRACE}%{QUOTE}, MODE=.*/modalias%{LBRACE}usb:v%{BACKSLASH}1p%{BACKSLASH}2d*dc*dsc*dp*ic*isc*ip*%{RBRACE}/p' | tr '%{BACKSLASH}n' ' ') +%define USBNONHIDDRIVERS %(set -x ; bunzip2 <%{S:0} | tr a-z A-Z | fgrep -a -A1 _USB | sed -n 's/.*SYSFS{IDVENDOR}==%{QUOTE}%{BACKSLASH}%{LBRACE}[^%{QUOTE}]*%{BACKSLASH}%{RBRACE}%{QUOTE}, SYSFS{IDPRODUCT}==%{QUOTE}%{BACKSLASH}%{LBRACE}[^%{QUOTE}]*%{BACKSLASH}%{RBRACE}%{QUOTE}, MODE=.*/modalias%{LBRACE}usb:v%{BACKSLASH}1p%{BACKSLASH}2d*dc*dsc*dp*ic*isc*ip*%{RBRACE}/p' | tr '%{BACKSLASH}n' ' ') # Package provides driver for USB HID UPSes, but people can live with hal addon: -Enhances: %(set -x ; echo %{QUOTE}%{USBDRIVERS}%{QUOTE} | sed -n s/^HALD-ADDON-USBHID-UPS=//p | tr '%{BACKSLASH}n' ' ') +Enhances: %USBHIDDRIVERS # Package provides the only avalailable driver for other USB UPSes: -Supplements: %(set -x ; echo %{QUOTE}%{USBDRIVERS}%{QUOTE} | sed '/^HALD-ADDON-USBHID-UPS=/d;s/^.*=//' | tr '%{BACKSLASH}n' ' ') +Supplements: %USBNONHIDDRIVERS %description Core package of Network UPS Tools. @@ -227,9 +226,7 @@ mv upsd-early-powerdown.init upsd-early-powerdown %if %suse_version < 1030 %patch6 -R %endif -%patch8 sed -i "s/@UPSD_USER@/%{USER}/g" upsd.init conf/upsmon.conf.sample -%patch11 %if %suse_version > 1030 %patch12 %endif @@ -240,7 +237,7 @@ sed -i s:/usr/local/ups/bin:/bin: conf/upssched.conf.sample.in %build autoreconf -f -i -%configure --disable-static --with-pic --libexecdir=%_prefix/lib \ +%configure --disable-static --with-pic --libexecdir=%_prefix/lib\ --sysconfdir=%{CONFPATH}\ --datadir=%{_datadir}/nut\ --with-all\ @@ -294,6 +291,8 @@ mkdir $RPM_BUILD_ROOT%{HTMLPATH}/nut $RPM_BUILD_ROOT%{CGIPATH}/nut mv $RPM_BUILD_ROOT%{HTMLPATH}/*.{html,png} $RPM_BUILD_ROOT%{HTMLPATH}/nut/ mv $RPM_BUILD_ROOT%{CGIPATH}/*.cgi $RPM_BUILD_ROOT%{CGIPATH}/nut %{__rm} -f %{buildroot}%{_libdir}/*.la +mkdir -p $RPM_BUILD_ROOT/etc/bash_completion.d +install -m0644 scripts/misc/nut.bash_completion $RPM_BUILD_ROOT/etc/bash_completion.d/ %pre usr/sbin/useradd -r -o -g %{GROUP} -s /bin/false \ @@ -406,6 +405,7 @@ rm -rf $RPM_BUILD_ROOT %config(noreplace) %attr(600,%{USER},root) %{CONFPATH}/upsd.users %config(noreplace) %attr(600,%{USER},root) %{CONFPATH}/upsmon.conf %dir %{CONFPATH} +%config(noreplace) %{CONFPATH}/nut.conf %config(noreplace) %{CONFPATH}/ups.conf %config(noreplace) %{CONFPATH}/upsset.conf %config(noreplace) %{CONFPATH}/upssched.conf @@ -429,6 +429,7 @@ rm -rf $RPM_BUILD_ROOT %dir %{_sysconfdir}/udev %dir %{_sysconfdir}/udev/rules.d %{_sysconfdir}/udev/rules.d/*.rules +/etc/bash_completion.d/ %files cgi %defattr(-,root,root)