Hello community,

here is the log from the commit of package apcupsd.1425 for 
openSUSE:12.3:Update checked in at 2013-03-20 13:45:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.3:Update/apcupsd.1425 (Old)
 and      /work/SRC/openSUSE:12.3:Update/.apcupsd.1425.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "apcupsd.1425", Maintainer is ""

Changes:
--------
New Changes file:

--- /dev/null   2013-02-26 18:15:11.936010755 +0100
+++ /work/SRC/openSUSE:12.3:Update/.apcupsd.1425.new/apcupsd.changes    
2013-03-20 13:45:58.000000000 +0100
@@ -0,0 +1,579 @@
+-------------------------------------------------------------------
+Sun Mar 10 13:07:20 UTC 2013 - dims...@opensuse.org
+
+- Update apcupsd-3.14.8-systemd.patch: apcupsd lives in /usr/sbin,
+  not in /sbin (bnc#801312).
+
+-------------------------------------------------------------------
+Fri Jan 11 16:49:03 UTC 2013 - cfarr...@suse.com
+
+- license update: GPL-2.0
+
+
+-------------------------------------------------------------------
+Fri Jan 11 09:41:28 UTC 2013 - a...@suse.de
+
+- Remove patch apcupsd-largebuf-overflow.patch, it's upstream now
+
+-------------------------------------------------------------------
+Fri Jan 11 09:12:45 UTC 2013 - co...@suse.com
+
+- fix build on factory - systemd moved to /usr
+
+-------------------------------------------------------------------
+Fri Sep 14 20:17:07 UTC 2012 - p.drou...@gmail.com
+
+- Updated to version 3.14.10:
+  * Fix missing status and spurrious incorrect status on newer BackUPS CS
+    models using USB interface.
+
+  * USB compatibility fixes for Mac OS X Lion
+
+  * USB driver support for newer Microlink models on Mac OS X Lion and Windows
+
+  * Ignore transitions to battery due to calibration (possible if user
+    initiates calibration, then exits apctest and starts apcupsd before 
+    calibration completes.
+
+  * Fix truncation of long UPS model names such as "Smart-UPS RT 5000 XL"
+
+  * Fix MODEL vs. APCMODEL confusion. Remove APCMODEL and rename old MODEL
+    aka 'mode' to DRIVER.
+    
+- Improve Systemd and logrotate support
+- Remove apcupsd-lite support : difference between apcupsd-lite and 
+  apcupsd are minimal or cpu consumption don't justify his presence
+
+-------------------------------------------------------------------
+Tue May 29 15:42:50 UTC 2012 - jeng...@inai.de
+
+- Adjust directory name to source config.guess/sub from
+  to be a /little/ more future proof.
+
+-------------------------------------------------------------------
+Thu Mar  1 20:26:01 UTC 2012 - a...@suse.de
+
+- Buildrequire xorg-x11-devel
+
+-------------------------------------------------------------------
+Wed Feb  8 11:55:48 UTC 2012 - dval...@suse.com
+
+- fix ppc64 build 
+
+-------------------------------------------------------------------
+Tue Jan 31 16:25:50 CET 2012 - sbra...@suse.cz
+
+- Mark all files in /etc/apcupsd as config files. Their editing
+  sometimes makes sense (bnc#744358).
+
+-------------------------------------------------------------------
+Tue Dec 20 11:26:20 UTC 2011 - co...@suse.com
+
+- remove call to suse_update_config (very old work around)
+
+-------------------------------------------------------------------
+Mon Oct 17 08:51:57 UTC 2011 - mkube...@suse.cz
+
+- apcupsd-3.14.8-exit-race.patch:
+  When terminating apcupsd, cancel other threads before cleanup to
+  avoid race condition and possible segfault (bnc#724487).
+- Change build requirement from sysvinit to sysvinit-init for 12.1
+
+-------------------------------------------------------------------
+Sat Sep 17 11:23:44 UTC 2011 - jeng...@medozas.de
+
+- Remove redundant tags/sections from specfile
+- Use %_smp_mflags for parallel build
+
+-------------------------------------------------------------------
+Thu Aug 25 20:02:35 CEST 2011 - sbra...@suse.cz
+
+- Implemented hibernate on power fail (bnc#703592#c39).
+
+-------------------------------------------------------------------
+Tue Aug  2 17:40:15 CEST 2011 - sbra...@suse.cz
+
+- Fixed init check to succeed with unmounted /usr (bnc#703592#c23).
+
+-------------------------------------------------------------------
+Mon Jul  4 20:36:19 CEST 2011 - sbra...@suse.cz
+
+- Updated to version 3.14.8:
+  * Implement battery calibration and self-test interval in apctest
+    for USB models.
+  * Add support for turning the UPS off completely.
+  * Updates of SNMP code.
+  * Add support for reading battery voltage from the PowerSummary.
+  * Switch time/date output format to simplified ISO.
+  * Compilation warning fixes.
+  * Other bug fixes and improvements.
+  * Documentation improvements.
+- Removed HAL support.
+
+-------------------------------------------------------------------
+Thu Mar 24 15:34:50 UTC 2011 - vci...@novell.com
+
+- fixed apcupsd-lite path in init script
+  (reported later as bnc#703592)
+
+-------------------------------------------------------------------
+Tue Jul 27 20:11:58 UTC 2010 - cristian.rodrig...@opensuse.org
+
+- avoid leaking file descriptors (use CLOEXEC, patch from Fedora) 
+
+-------------------------------------------------------------------
+Wed Mar 31 15:48:30 UTC 2010 - co...@novell.com
+
+- package requires sysvinit to build
+
+-------------------------------------------------------------------
+Mon Feb 15 20:44:32 CET 2010 - se...@opensuse.org
+
+- add missing hal directories to pass rpmlint checks
+
+-------------------------------------------------------------------
+Mon Feb 15 19:10:15 CET 2010 - se...@opensuse.org
+
+- fix build with newer net-snmp by undefining MIB
+
+-------------------------------------------------------------------
+Fri Oct 30 11:44:14 CET 2009 - sbra...@suse.cz
+
+- Require distribution-release, not dummy-release (bnc#550230).
+
+-------------------------------------------------------------------
+Mon Jun 29 17:08:30 CEST 2009 - sbra...@suse.cz
+
+- Updated to version 3.14.6:
+  * Major updates to the User Manual.
+  * New manpages for apcupsd, apcupsd.conf, apctest, apcaccess, and
+    apccontrol.
+  * Add support for turning the UPS off completely.
+  * apcsmart: Deadlock fixes during comms failures.
+  * linux-usb: Fix out-of-bounds array access.
+  * Fix build with gcc-4.4.
+  * apcsmart: Fix crash during process shutdown (SIGTERM).
+  * Several other minor fixes and improvements.
+
+-------------------------------------------------------------------
+Tue Jun  2 17:45:13 CEST 2009 - crrodrig...@suse.de
+
+- fix build 
+
+-------------------------------------------------------------------
+Thu Feb 26 00:21:40 CET 2009 - r...@suse.de
+
+- run suse_update_config in autoconf directory to fix build
+  on ppc64
+
+-------------------------------------------------------------------
+Wed Jan 28 15:49:43 CET 2009 - sbra...@suse.cz
+
+- Updated to version 3.14.5:
+  * docs: Document the /refresh switch for apctray.
+  * apctest: Do not create pid file.
+  * gapcmon: Network connect timeout fix.
+  * Fix a few unsafe uses of sprintf and strcat.
+  * gapcmon: Iconify fixes for KDE
+  * Fix LOWBATT glitch handling bug.
+  * Support shutting down apcupsd instances running in other
+    sessions.
+  * docs: PCNET username and password details.
+
+-------------------------------------------------------------------
+Fri Sep 19 14:46:25 CEST 2008 - r...@suse.de
+
+- buildreq dummy-release instead of openSUSE-release 
+
+-------------------------------------------------------------------
+Mon Jul 14 17:12:50 CEST 2008 - sbra...@suse.cz
+
+- Updated to version 3.14.4:
+  * Build system rewrite.
+  * Built-in version of libgd for multimon cgi has been removed
+  * Removal of NLS support.
+  * Powerflute has been disabled.
+  * gapcmon: Corrected the use of NOMPOWER and the calc of current
+    usage amount.
++++ 382 more lines (skipped)
++++ between /dev/null
++++ and /work/SRC/openSUSE:12.3:Update/.apcupsd.1425.new/apcupsd.changes

New:
----
  README.SUSE
  apcupsd-3.14.1-cloexec.patch
  apcupsd-3.14.10.tar.bz2
  apcupsd-3.14.6-undef-MIB-for-new-net-snmp.diff
  apcupsd-3.14.8-cxxld.patch
  apcupsd-3.14.8-systemd.patch
  apcupsd-3.14.9-fixgui.patch
  apcupsd-early-powerdown.init
  apcupsd-gpp.patch
  apcupsd-hibernate.patch
  apcupsd-httpd.conf
  apcupsd-powersave.patch
  apcupsd-suse.patch
  apcupsd.changes
  apcupsd.hibernate
  apcupsd.init
  apcupsd.logrotate
  apcupsd.spec
  apcupsd.sysconfig
  fix-fsf-adress.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ apcupsd.spec ++++++
#
# spec file for package apcupsd
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           apcupsd
BuildRequires:  apache2-devel
BuildRequires:  automake
BuildRequires:  distribution-release
BuildRequires:  dos2unix
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  gconf2-devel
BuildRequires:  gd-devel
BuildRequires:  gnome-vfs2-devel
BuildRequires:  gtk2-devel
BuildRequires:  mailx
BuildRequires:  ncurses-devel
BuildRequires:  net-snmp-devel
BuildRequires:  pm-utils
BuildRequires:  tcpd-devel
BuildRequires:  update-desktop-files
BuildRequires:  xorg-x11-devel
%if 0%{?suse_version} <= 1140
BuildRequires:  sysvinit
%else
%if 0%{?suse_version} >= 1220
BuildRequires:  systemd-sysvinit
%else
BuildRequires:  sysvinit-init
%endif
%endif
Summary:        APC UPS Daemon (Powerful Daemon for APC UPSs)
License:        GPL-2.0
Group:          Hardware/UPS
Version:        3.14.10
Release:        0
Url:            http://www.apcupsd.com/
Source:         apcupsd-%{version}.tar.bz2
Source1:        apcupsd.init
Source2:        README.SUSE
Source3:        apcupsd-early-powerdown.init
Source4:        apcupsd.hibernate
Source5:        apcupsd.sysconfig
Source6:        apcupsd.logrotate 
Source7:        apcupsd-httpd.conf
# PATCH-FIX-OPENSUSE apcupsd-suse.patch sbra...@suse.cz -- Do not perform halt 
script alternation on install.
Patch:          apcupsd-suse.patch
# PATCH-FIX-OPENSUSE apcupsd-gpp.patch sbra...@suse.cz -- Build against C++ 
unfriendly system tcpd.h. See below.
Patch1:         apcupsd-gpp.patch
# PATCH-FEATURE-OPENSUSE apcupsd-hibernate.patch sbra...@suse.cz -- Support for 
hibernation on powerfail.
Patch2:         apcupsd-hibernate.patch
# PATCH-FEATURE-OPENSUSE apcupsd-powersave.patch sbra...@suse.cz -- Call 
powersave-notify in distros where it is available.
Patch3:         apcupsd-powersave.patch
# PATCH-FIX-OPENSUSE apcupsd-3.14.6-undef-MIB-for-new-net-snmp.diff 
se...@opensuse.org -- Fix build with newer net-snmp by undefining MIB.
Patch9:         apcupsd-3.14.6-undef-MIB-for-new-net-snmp.diff
Patch10:        apcupsd-3.14.1-cloexec.patch
# systemd support
Patch11:        apcupsd-3.14.8-systemd.patch
#fix FTBFS, c++ linking needs -lstdc++ explicitly
Patch12:        apcupsd-3.14.8-cxxld.patch
# fix crash in gui, rhbz#578276
Patch13:        apcupsd-3.14.9-fixgui.patch
# FSF adress is incorrect
Patch14:        fix-fsf-adress.patch
%if 0%{?suse_version} < 1220
PreReq:         %fillup_prereq %insserv_prereq /usr/bin/sed /usr/bin/grep
%endif
Requires:       /usr/bin/mail
%if 0%{?suse_version} >= 1220
%{?systemd_requires}
%endif
Suggests:       logrotate
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%define apache_serverroot %(/usr/sbin/apxs2 -q datadir 2>/dev/null || 
/usr/sbin/apxs -q PREFIX)

%description
Controls and monitors the status of an APC UPS under Linux. Allows your
computer or server to run for a specified length of time on UPS power
then executes a controlled shutdown in the case of an extended power
failure. Find APC on the Internet at http://www.apc.com/.

APC also made their PowerChute plus available for download at
http://www.apc.com/tools/download/.

%package cgi
Summary:        Web interface for apcupsd
Group:          Hardware/UPS
Requires:       %{name} = %{version}

%description cgi
A CGI interface to the APC UPS monitoring daemon.

%package gui

Summary:        APC UPS Monitor GUI (for APC UPSs)
Group:          Hardware/UPS
Requires:       %{name} = %{version}

%description gui
Controls and monitors the status of an APC UPS under Linux. Allows your
computer or server to run for a specified length of time on UPS power
then executes a controlled shutdown in the case of an extended power
failure. Find APC on the Internet at http://www.apc.com/.

APC also made their PowerChute plus available for download at
http://www.apc.com/tools/download/.

%prep
%setup -q
#This is needed as apcupsd doesn't recognize ppc64 correctly
cp /usr/share/automake*/config.{guess,sub} autoconf/ 
cp -a %{S:1} platforms/suse/apcupsd.in
cp -a %{S:2} %{S:4} %{S:5} .
cp -a %{S:3} apcupsd-early-powerdown
chmod +x apcupsd-early-powerdown
%patch
# To be surely in sync with tcpd API, build against system header. It requires 
a patch.
rm include/tcpd.h
%patch1
%patch2
%patch3
chmod -x kernstodo
%patch9
%patch10 -p1
%patch11 -p1 -b .systemd
%patch12 -p1 -b .cxxld
%patch13 -p1 -b .fixgui
%patch14 -p1

sed -i '/^#!/d' %{SOURCE1}

%build
%configure\
        --sysconfdir=%{_sysconfdir}/%{name}\
        --with-libwrap\
        --enable-all\
        --enable-nls\
        --with-cgi-bin=%{apache_serverroot}/cgi-bin
make %{?_smp_mflags}

%install
%makeinstall
install -m744 platforms/apccontrol \
              $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/apccontrol
%if 0%{?suse_version} < 1220
mkdir -p $RPM_BUILD_ROOT%{_initrddir}
ln -sf ../../etc/init.d/%{name} $RPM_BUILD_ROOT/%{_sbindir}/rc%{name}
%endif
%suse_update_desktop_file gapcmon
chmod 644 $RPM_BUILD_ROOT/%{_datadir}/pixmaps/*.png
# Cleanup for later doc macro processing
chmod -x examples/*.c
rm examples/*.in
find examples users_guide -type f | xargs chmod 644
# fix end-of-line encoding
dos2unix -o examples/status/SmartUPS-vs-650.status examples/snoopdecode.c 
examples/rpt/Smart-UPS-1500.rpt \
        examples/rpt/Back-UPS-ES-550.rpt examples/rpt/Back-UPS-CS-650.rpt 
examples/rpt/Back-UPS-BR-800.rpt
# hid-ups.rpt is duplicate by BackUPS.rpt
%fdupes -s examples/rpt/

rm -r $RPM_BUILD_ROOT/%{_datadir}/hal
mkdir -p $RPM_BUILD_ROOT/etc/pm/sleep.d
sed "s:@PWRFAILDIR@:%{_sysconfdir}/%{name}:g" <%{name}.hibernate 
>$RPM_BUILD_ROOT/etc/pm/sleep.d/99apcupsd
chmod +x $RPM_BUILD_ROOT/etc/pm/sleep.d/99%{name}
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
cp %{name}.sysconfig $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.%{name}

# systemd support and remove initd support for opensuse 12.2 and higher
%if 0%{?suse_version} >= 1220
install -p -D -m644 %{name}.service $RPM_BUILD_ROOT%{_unitdir}/%{name}.service
install -p -D -m755 %{name}_shutdown 
$RPM_BUILD_ROOT/usr/lib/systemd/system-shutdown/%{name}_shutdown
rm $RPM_BUILD_ROOT/etc/init.d/%{name}
%endif

install -d %{buildroot}%{_sysconfdir}/logrotate.d
install -m0644 %{SOURCE6} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
install -d %{buildroot}%{_sysconfdir}/apache2/conf.d/
install -m0644 %{SOURCE7} %{buildroot}%{_sysconfdir}/apache2/conf.d/%{name}.conf

%post
%if 0%{?suse_version} >= 1220
%service_add_post %{name}.service
%else
# HALT_POWERDOWN_INSERT is supported since SuSE Linux 10.1, SLES 10.
# Install HALT_POWERDOWN_INSERT
if usr/bin/grep -q '^HALT_POWERDOWN_INSERT="\(/etc/%{name}/apccontrol 
killpower\|/etc/init\.d/%{name} try-powerdown\|\)"' etc/sysconfig/shutdown ; 
then
  usr/bin/sed -i 
's:^\(HALT_POWERDOWN_INSERT="\).*"[[:space:]]*:\1/etc/init.d/%{name} 
try-powerdown":' etc/sysconfig/shutdown
else
  echo >&2 "apcupsd: WARNING: Unknown value of HALT_POWERDOWN_INSERT in 
/etc/sysconfig/shutdown."
  echo >&2 "         Keeping unchanged. Should be:"
  echo >&2 "HALT_POWERDOWN_INSERT=\"/etc/init.d/apcupsd try-powerdown\""
fi
# NOTE: Up to SuSE Linux 10.0, SLES 9 installation modified 
/etc/init.d/halt.local.
# Now it is obsolete and should be removed.
if [ -f etc/init.d/halt.local ]
then
    if usr/bin/grep -q "XXX APCUPSD - DO NOT EDIT XXX" etc/init.d/halt.local ; 
then
# NOTE: SuSE Linux 8.2, SLES 8 and older have had a bug: Last "fi"
# command was not commented by $MAGICWORD and was not replaced during
# update. This script tries to detect such orphan "fi".
        usr/bin/sed -i ':1;/XXX APCUPSD - DO NOT EDIT XXX/,+1s/^fi$/& # XXX 
APCUPSD - DO NOT EDIT XXX/;t1;/XXX APCUPSD - DO NOT EDIT XXX/d' 
etc/init.d/halt.local
    fi
fi
%endif

%preun
%if 0%{?suse_version} >= 1220
%service_del_preun %{name}.service
%else
%{stop_on_removal apcupsd}
%endif

%postun
%if 0%{?suse_version} >= 1220
%service_del_postun %{name}.service
%else
# Remove HALT_POWERDOWN_INSERT
if test $1 -eq 0 -a ! -f /etc/init.d/%{name} ; then
  if usr/bin/grep -q '^HALT_POWERDOWN_INSERT="\(/etc/init\.d/%{name} 
try-powerdown\)"' etc/sysconfig/shutdown ; then
    usr/bin/sed -i 's:^\(HALT_POWERDOWN_INSERT="\)\(/etc/init\.d/%{name} 
try-powerdown\)":\1":' etc/sysconfig/shutdown
  else
    echo >&2 "%{name}: WARNING: Unknown value of HALT_POWERDOWN_INSERT in 
/etc/sysconfig/shutdown."
    echo >&2 "         Keeping unchanged. Should be:"
    echo >&2 "HALT_POWERDOWN_INSERT=\"\""
  fi
  if test -f etc/init.d/%{name}-early-powerdown ; then
    echo >&2 "%{name}: WARNING: You may want to remove your 
/etc/init.d/%{name}-early-powerdown."
  fi
fi
%{restart_on_update apcupsd}
%{insserv_cleanup}
%endif

%files
%defattr(-,root,root)
%doc COPYING ChangeLog examples ReleaseNotes README.SUSE
%{_sbindir}/%{name}
%{_sbindir}/apcaccess
%{_sbindir}/apctest
%{_sbindir}/smtp
%if 0%{?suse_version} < 1220
%{_initrddir}/%{name}
%{_sbindir}/rc%{name}
%else
%{_unitdir}/%{name}.service
/usr/lib/systemd/system-shutdown/%{name}_shutdown
%endif
/etc/pm/sleep.d/99%{name}
%dir %{_sysconfdir}/%{name}/
%config(noreplace) %{_sysconfdir}/%{name}/changeme
%config(noreplace) %{_sysconfdir}/%{name}/commfailure
%config(noreplace) %{_sysconfdir}/%{name}/commok
%config(noreplace) %{_sysconfdir}/%{name}/onbattery
%config(noreplace) %{_sysconfdir}/%{name}/offbattery
%config(noreplace) %{_sysconfdir}/logrotate.d/apcupsd
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
%attr(0755,root,root) %{_sysconfdir}/apcupsd/apccontrol
%{apache_serverroot}/cgi-bin/multimon.cgi
%{apache_serverroot}/cgi-bin/upsfstats.cgi
%{apache_serverroot}/cgi-bin/upsstats.cgi
%{apache_serverroot}/cgi-bin/upsimage.cgi
%doc %{_mandir}/man?/*.*
/var/adm/fillup-templates/sysconfig.*

%files gui
%defattr(-,root,root)
%{_bindir}/gapcmon
%{_datadir}/applications/gapcmon.desktop
%{_datadir}/pixmaps/*.png

%files cgi
%defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/apache2/conf.d/%{name}.conf
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.css
%config(noreplace) %{_sysconfdir}/%{name}/hosts.conf
%config(noreplace) %{_sysconfdir}/%{name}/multimon.conf

%changelog
++++++ README.SUSE ++++++
Advanced apcupsd configuration


Suspend to disk

If you want to configure nut to do suspend to disk instead of shutdown
you should:

- You need pm-utils package installed.
- Verify, that suspend to disk works correctly on your machine,
  e. g. by pm-hibernate
  (You can lose your unsaved data, if your computer does not hibernate
  correctly.)
- Verify, that your UPS provides reasonable grace period to complete
  hibernation in all situations.
- Use YaST Sysconfig editor and set
  Hardware->UPS->APCUPSD_POWERFAIL_BEHAVIOR to "hibernate".


Environment with possible service timeouts

In some environments, there is no guarantee, that the machine will
correctly shut down, either because other machines providing critical
services are already down or because some services (e. g. squid) are
stopping too long and battery power is not sufficient. In this case,
you can prefer incorrect but fast shutdown.

To fix this problem, you need to do:

- Copy apcupsd-early-powerdown script to your /etc/init.d/ directory.

- Edit following lines:

  Replace "FIXME scripts which should not stop before powerdown" by an
  appropriate init script list.

  Replace "FIXME scripts which should stop before powerdown" by an
  appropriate init script list.

- Start YaST Runlevel Editor and enable this meta-service in
  runlevels, where you want to apply early shutdown.
++++++ apcupsd-3.14.1-cloexec.patch ++++++
--- apcupsd-3.14.1/src/apcnis.c.cloexec 2006-08-13 11:00:15.000000000 -0600
+++ apcupsd-3.14.1/src/apcnis.c 2007-08-01 16:26:35.000000000 -0600
@@ -155,6 +155,9 @@
       sleep(5 * 60);
    }
 
+   /* Close the socket on exec - avoid leaked file descriptors */
+   fcntl(sockfd, F_SETFD, FD_CLOEXEC);
+
    /* Reuse old sockets */
 #ifndef HAVE_MINGW
    if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (void*)&turnon, 
sizeof(turnon)) < 0) {
--- apcupsd-3.14.1/src/apcupsd.c.cloexec        2006-09-23 11:42:47.000000000 
-0600
+++ apcupsd-3.14.1/src/apcupsd.c        2007-08-01 16:27:14.000000000 -0600
@@ -280,6 +280,9 @@
       if (ups->event_fd < 0) {
          log_event(ups, LOG_WARNING, "Could not open events file %s: %s\n",
             ups->eventfile, strerror(errno));
+      } else {
+         /* Close the file on exec - avoid leaked file descriptors */
+         fcntl(ups->event_fd, F_SETFD, FD_CLOEXEC);
       }
    }
 
--- apcupsd-3.14.1/src/drivers/usb/linux/linux-usb.c.cloexec    2007-08-01 
16:30:28.000000000 -0600
+++ apcupsd-3.14.1/src/drivers/usb/linux/linux-usb.c    2007-08-01 
16:42:55.000000000 -0600
@@ -182,8 +182,11 @@
    /* Retry 10 times */
    for (i = 0; i < 10; i++) {
       my_data->fd = open_device(ups->device, ups);
-      if (my_data->fd != -1)
+      if (my_data->fd != -1) {
+         /* Close the device on exec - avoid leaked file descriptors */
+         fcntl(my_data->fd, F_SETFD, FD_CLOEXEC);
          return 1;
+      }
       sleep(1);
    }
 
@@ -206,6 +209,8 @@
             asnprintf(devname, sizeof(devname), "%s%d", hiddev[j], k);
             my_data->fd = open_device(devname, ups);
             if (my_data->fd != -1) {
+               /* Close the device on exec - avoid leaked file descriptors */
+               fcntl(my_data->fd, F_SETFD, FD_CLOEXEC);
                /* Successful open, save device name and return */
                astrncpy(ups->device, devname, sizeof(ups->device));
                return 1;
++++++ apcupsd-3.14.6-undef-MIB-for-new-net-snmp.diff ++++++
Index: src/drivers/snmp/snmp.h
===================================================================
--- src/drivers/snmp/snmp.h.orig
+++ src/drivers/snmp/snmp.h
@@ -46,10 +46,18 @@
 #  include <net-snmp/library/snmp_client.h>
 # endif
 
 #endif
 
+/* net-snmp now defines MIB:
+ net-snmp/library/mib.h:#define NETSNMP_MIB2_OID 1, 3, 6, 1, 2, 1
+ net-snmp/library/mib.h:#define MIB NETSNMP_MIB2_OID
+ */
+#ifdef MIB
+#undef MIB
+#endif
+
 #include "powernet-mib.h"
 #include "rfc1628-mib.h"
 
 #include <sys/param.h>   /* for MIN() */
 
++++++ apcupsd-3.14.8-cxxld.patch ++++++
diff -up apcupsd-3.14.8/src/Makefile.cxxld apcupsd-3.14.8/src/Makefile
--- apcupsd-3.14.8/src/Makefile.cxxld   2009-09-30 01:20:45.000000000 +0200
+++ apcupsd-3.14.8/src/Makefile 2010-09-22 11:18:03.550601657 +0200
@@ -26,10 +26,10 @@ SRCS = $(common_srcs) $(apcupsd_srcs) $(
 all-targets: apcupsd apcaccess apctest smtp 
 
 apcupsd: $(common_obj) $(apcupsd_obj) $(APCDRVLIBS) $(APCLIBS)
-       $(LINK) $(DRVLIBS)
+       $(LINK) -lstdc++ $(DRVLIBS)
 
 apctest: $(common_obj) $(apctest_obj) $(APCDRVLIBS) $(APCLIBS)
-       $(LINK) $(DRVLIBS)
+       $(LINK) -lstdc++ $(DRVLIBS)
 
 apcaccess: $(apcaccess_obj) $(APCLIBS)
        $(LINK)
++++++ apcupsd-3.14.8-systemd.patch ++++++
diff -up apcupsd-3.14.8/apcupsd.service.systemd apcupsd-3.14.8/apcupsd.service
--- apcupsd-3.14.8/apcupsd.service.systemd      2011-06-16 10:33:02.335889489 
+0200
+++ apcupsd-3.14.8/apcupsd.service      2011-06-16 09:59:02.616138047 +0200
@@ -0,0 +1,11 @@
+[Unit]
+Description=APC UPS Power Control Daemon for Linux
+After=syslog.target
+After=network.target
+
+[Service]
+ExecStartPre=-/bin/rm -f /etc/apcupsd/powerfail
+ExecStart=/usr/sbin/apcupsd -b -f /etc/apcupsd/apcupsd.conf
+
+[Install]
+WantedBy=multi-user.target
diff -up apcupsd-3.14.8/apcupsd_shutdown.systemd apcupsd-3.14.8/apcupsd_shutdown
--- apcupsd-3.14.8/apcupsd_shutdown.systemd     2011-06-16 10:33:08.831934420 
+0200
+++ apcupsd-3.14.8/apcupsd_shutdown     2011-06-16 10:10:20.948796784 +0200
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# See if this is a powerfail situation.
+if [ -f /etc/apcupsd/powerfail ]; then
+  echo
+  echo "APCUPSD will now power off the UPS"
+  echo
+  /etc/apcupsd/apccontrol killpower
+fi
++++++ apcupsd-3.14.9-fixgui.patch ++++++
--- apcupsd-3.14.9/src/gapcmon/gapcmon.c.timeout        2008-09-16 
06:58:20.000000000 +0200
+++ apcupsd-3.14.9/src/gapcmon/gapcmon.c        2011-10-12 20:10:52.986362156 
+0200
@@ -179,6 +179,54 @@ struct hostent * gethostname_re
 */
 static gboolean lg_graph_debug = FALSE;
 
+static GSList *timeout_list = NULL;
+
+static inline timeout_t * new_timeout(guint id, timeout_type_t type, void 
*data) {
+    timeout_t *timeout = (timeout_t *) malloc(sizeof(timeout_t));
+
+    timeout->id   = id;
+    timeout->type = type;
+    timeout->data = data;
+    return timeout;
+}
+
+/* callback will check if timeout is associated with window
+ * which is about to be destroyed and it will call g_source_remove 
+ * in order to prevent the callback associated with timeout to be executed 
+ */ 
+static void remove_timeout(gpointer tmo, gpointer data) {
+    timeout_t * timeout = (timeout_t *) tmo;
+    PGAPC_MONITOR monitor = (PGAPC_MONITOR) data;
+    int delete_timeout  = 0;
+
+    if (timeout == NULL) {
+        return;
+    }
+
+    switch (timeout->type) {
+    case GRAPH:
+        if (timeout->data == (void *) monitor->phs.plg) {
+            delete_timeout = 1;
+        }
+        break;
+    case MONITOR:
+        if (timeout->data == (void *) monitor) {
+            delete_timeout = 1;
+        }
+        break;
+
+    case HISTORY:
+        if (timeout->data == (void *) &(monitor->phs)) {
+            delete_timeout = 1;
+        }
+        break;
+    }
+    
+    if (delete_timeout) {
+        g_source_remove(timeout->id);
+        timeout_list = g_slist_remove(timeout_list, (gconstpointer) timeout);
+    }
+}
 
 /* ************************************************************************* */
 
@@ -1376,8 +1424,8 @@ static gint lg_graph_configure_event_cb 
     plg->x_range.i_minor_inc = plg->plot_box.width / plg->x_range.i_num_minor;
     plg->x_range.i_major_inc = plg->plot_box.width / plg->x_range.i_num_major;
 
-    g_timeout_add (250, (GSourceFunc) lg_graph_draw, plg);
-
+    guint tid = g_timeout_add (250, (GSourceFunc) lg_graph_draw, plg);
+    timeout_list = g_slist_append(timeout_list, new_timeout(tid, GRAPH, (void 
*) plg));
     return TRUE;
 }
 
@@ -1745,7 +1793,8 @@ static gboolean cb_monitor_automatic_ref
       return FALSE;                /* stop timers */
 
    if (pm->b_timer_control) {
-      g_timeout_add(100, (GSourceFunc) cb_monitor_refresh_control, pm);
+      guint tid = g_timeout_add(100, (GSourceFunc) cb_monitor_refresh_control, 
pm);
+      timeout_list = g_slist_append(timeout_list, new_timeout(tid, MONITOR, 
(void *) pm));
       return FALSE;
    }
 
@@ -4543,9 +4592,9 @@ static void cb_monitor_interface_button_
    }
 
    g_async_queue_push(pm->q_network, pm);
-   g_timeout_add(GAPC_REFRESH_FACTOR_ONE_TIME,
+   guint tid = g_timeout_add(GAPC_REFRESH_FACTOR_ONE_TIME,
       (GSourceFunc) cb_monitor_dedicated_one_time_refresh, pm);
-
+   timeout_list = g_slist_append(timeout_list, new_timeout(tid, MONITOR, (void 
*) pm));
    return;
 }
 
@@ -5174,6 +5223,9 @@ static void cb_monitor_interface_destroy
       g_source_remove(pm->tid_automatic_refresh);
    }
 
+   /* iterate through list of timers and remove all timers associated with 
this monitor */
+   g_slist_foreach(timeout_list, remove_timeout, (gpointer) pm);
+
    if (pm->tid_thread_qwork != NULL) {
       pm->b_thread_stop = TRUE;
       g_async_queue_push(pm->q_network, pm);
@@ -5537,9 +5589,9 @@ static gint gapc_monitor_history_page(PG
 
    /* collect one right away */
    pphs->b_startup = TRUE;
-   g_timeout_add((guint) (pm->d_refresh * GAPC_REFRESH_FACTOR_1K + 75),
+   guint tid = g_timeout_add((guint) (pm->d_refresh * GAPC_REFRESH_FACTOR_1K + 
75),
       (GSourceFunc) cb_util_line_chart_refresh, pphs);
-
+   timeout_list = g_slist_append(timeout_list, new_timeout(tid, HISTORY, (void 
*) pphs));
    return i_page;
 }
 
@@ -5565,7 +5617,8 @@ static gboolean cb_util_line_chart_refre
       return FALSE;
 
    if (pm->b_graph_control) {
-      g_timeout_add(100, (GSourceFunc) cb_util_line_chart_refresh_control, pm);
+      guint tid = g_timeout_add(100, (GSourceFunc) 
cb_util_line_chart_refresh_control, pm);
+      timeout_list = g_slist_append(timeout_list, new_timeout(tid, MONITOR, 
(void *) pm));
       return FALSE;
    }
 
@@ -6392,6 +6445,7 @@ extern int main(int argc, char *argv[])
    PGAPC_CONFIG pcfg = NULL;
    GtkWidget *window = NULL;
 
+   timeout_list = g_slist_alloc();
    /*
     * Initialize GLib thread support, and GTK
     */
@@ -6435,5 +6489,6 @@ extern int main(int argc, char *argv[])
    gdk_flush();
    gdk_threads_leave();
 
+   g_slist_free(timeout_list);
    return (0);
 }
--- apcupsd-3.14.9/src/gapcmon/gapcmon.h        2011-10-12 20:12:54.584317583 
+0200
+++ apcupsd-3.14.9/src/gapcmon/gapcmon.h.timeout        2011-10-12 
20:14:10.965669911 +0200
@@ -403,6 +403,18 @@ typedef struct _System_Control_Data {
 
 } GAPC_CONFIG, *PGAPC_CONFIG;
 
+typedef enum {
+    GRAPH,
+    MONITOR,
+    HISTORY
+} timeout_type_t;
+
+typedef struct {
+    guint id;
+    timeout_type_t type;
+    void *data;
+} timeout_t;
+
 /* ************************************************************************* */
 
 #define GAPC_GLOSSARY  "<span size=\"xx-large\"><b>GAPCMON</b></span>\n \
++++++ apcupsd-early-powerdown.init ++++++
#! /bin/sh
#
# Sample script for early powerdown. Edit and copy to /etc/init.d/. See
# /usr/share/doc/packages/nut/README.SUSE for more.
#
# Copyright (c) 2006  SUSE / Novell Inc.
# All rights reserved.
#
# Author: Stanislav Brabec, 2006
# Please send feedback to http://www.suse.de/feedback/
#
# /etc/init.d/apcupsd-early-powerdown
#
#    This program is free software; you can redistribute it and/or modify 
#    it under the terms of the GNU General Public License as published by 
#    the Free Software Foundation; either version 2 of the License, or 
#    (at your option) any later version. 
# 
#    This program is distributed in the hope that it will be useful, 
#    but WITHOUT ANY WARRANTY; without even the implied warranty of 
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
#    GNU General Public License for more details. 
# 
#    You should have received a copy of the GNU General Public License 
#    along with this program; if not, write to the Free Software 
#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# System startup script for NUT UPS daemon
#
# LSB compatible service control script; see http://www.linuxbase.org/spec/
# 
### BEGIN INIT INFO
# Provides:          apcupsd-early-powerdown
# Required-Start:    
# Should-Start:      FIXME scripts which should not stop before powerdown
# Required-Stop:     apcupsd
# Should-Stop:       FIXME scripts which should stop before powerdown
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: Early UPS powerdown
# Description:       Script for early, quick but incorrect power down
#       while going out of batteries. You need it only if you run slowly
#       stopping services and UPS battery power fails before stopping of
#       these services.
### END INIT INFO
#
# Note on runlevels:
# 0 - halt/poweroff                     6 - reboot
# 1 - single user                       2 - multiuser without network exported
# 3 - multiuser w/ network (text mode)  5 - multiuser w/ network and X11 (xdm)
# 

# Check for existence of needed config files
UPSMON_CONFIG=/etc/ups/upsmon.conf
test -r $UPSMON_CONFIG || { echo "$UPSMON_CONFIG not existing";
        if [ "$1" = "stop" ]; then exit 0; else exit 6; fi;
}
# If this file exists, power is failing.
POWERDOWNFLAG=/etc/apcupsd/powerfail

# Shell functions sourced from /etc/rc.status:
#      rc_check         check and set local and overall rc status
#      rc_status        check and set local and overall rc status
#      rc_status -v     be verbose in local rc status and clear it afterwards
#      rc_status -v -r  ditto and clear both the local and overall rc status
#      rc_status -s     display "skipped" and exit with status 3
#      rc_status -u     display "unused" and exit with status 3
#      rc_failed        set local and overall rc status to failed
#      rc_failed <num>  set local and overall rc status to <num>
#      rc_reset         clear both the local and overall rc status
#      rc_exit          exit appropriate to overall rc status
#      rc_active        checks whether a service is activated by symlinks
. /etc/rc.status

# Reset status of this service
rc_reset

# Return values acc. to LSB for all commands but status:
# 0       - success
# 1       - generic or unspecified error
# 2       - invalid or excess argument(s)
# 3       - unimplemented feature (e.g. "reload")
# 4       - user had insufficient privileges
# 5       - program is not installed
# 6       - program is not configured
# 7       - program is not running
# 8--199  - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)
# 
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signaling is not supported) are
# considered a success.

case "$1" in
    start|probe)
        ## Start silently. No action.
        ;;
    stop)
        # If power is failing and shutdown is running, shutdown as fast as 
possible.
        if test "$RUNLEVEL" = "0" -a -n "$POWERDOWNFLAG " -a -f 
"$POWERDOWNFLAG" ; then
            echo "Initiating early UPS power down..."
            echo "Power is failing. Running fast shutdown."
            echo "Sending all processes the TERM signal..."
            killall5 -15
            sleep 3
            echo "Sending all processes the KILL signal..."
            killall5 -9
            echo "Remounting filesystems read-only."
            mounts=/etc/fstab
            test -r /proc/mounts && mounts=/proc/mounts
            while read des fs rest; do
                mount -v -n -o remount,ro $fs
            done < $mounts
            /etc/apcupsd/apccontrol killpower
        fi
        ;;
    restart|try-restart|condrestart|force-reload|reload)
        # Unimplemented.
        rc_failed 3
        rc_status -v
        ;;
    status)
        # Service status unknown.
        rc_failed 4
        rc_status -v
        ;;
    *)
        echo "Usage: $0 
{start|stop|status|try-restart|restart|force-reload|reload|probe}"
        exit 1
        ;;
esac
rc_exit
++++++ apcupsd-gpp.patch ++++++
This patch is required to work correctly with system tcpd.h, i. e. with
"rm include/tcpd.h".
================================================================================
Index: include/apc.h
===================================================================
--- include/apc.h.orig
+++ include/apc.h
@@ -154,7 +154,9 @@
 
 /* Pull in our local copy because the library does not have correct protos */
 #ifdef HAVE_LIBWRAP
+extern "C" {
 # include "tcpd.h"
+}
 #endif
 
 /* Solaris doesn't define this */
++++++ apcupsd-hibernate.patch ++++++
--- platforms/apccontrol.in
+++ platforms/apccontrol.in
@@ -20,6 +20,7 @@
 
 APCPID=@PIDDIR@/apcupsd.pid
 APCUPSD=@sbindir@/apcupsd
+HIBERNATE=/usr/sbin/pm-hibernate
 SHUTDOWN=@SHUTDOWN@
 SCRIPTSHELL=@SCRIPTSHELL@
 SCRIPTDIR=@sysconfdir@
@@ -103,8 +104,14 @@ case "$1" in
        ${SHUTDOWN} -r now "apcupsd UPS ${2} initiated reboot"
     ;;
     doshutdown)
-       echo "UPS ${2} initiated Shutdown Sequence" | ${WALL}
-       ${SHUTDOWN} -h now "apcupsd UPS ${2} initiated shutdown"
+       . /etc/sysconfig/apcupsd
+       if test "$APCUPSD_POWERFAIL_BEHAVIOR" = "hibernate" ; then
+               echo "UPS ${2} initiated hibernation" | ${WALL}
+               $HIBERNATE
+       else
+               echo "UPS ${2} initiated Shutdown Sequence" | ${WALL}
+               ${SHUTDOWN} -h now "apcupsd UPS ${2} initiated shutdown"
+       fi
     ;;
     annoyme)
        echo "Power problems with UPS ${2}. Please logoff." | ${WALL}
++++++ apcupsd-httpd.conf ++++++
#
# apcupsd configuration file for Apache Web server
#

# files are off the documentroot of Web server
Alias /apcupsd /var/www/apcupsd
<Directory /var/www/apcupsd>
 AddHandler cgi-script cgi pl
 Options ExecCGI
</Directory>

#
# Allow only local access at default
# Change the ".example.com" to match your domain or modify
# access rights to your needs to enable remote access also.
#
<Directory "/var/www/apcupsd">
    DirectoryIndex upsstats.cgi
    AllowOverride None
    Options ExecCGI Indexes
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
    Allow from ::1
    # Allow from .example.com
</Directory>


++++++ apcupsd-powersave.patch ++++++
Index: examples/safe.apccontrol.in
===================================================================
--- examples/safe.apccontrol.in.orig
+++ examples/safe.apccontrol.in
@@ -15,96 +15,128 @@ SCRIPTDIR=@sysconfdir@
 #
 case "$1" in
         killpower)
+                /usr/lib/powersave/powersave-notify \
+"apccontrol: ${APCUPSD} --killpower would have been."
                 wall <<EOF
 apccontrol: ${APCUPSD} --killpower would have been.
 
 EOF
         ;;
         commfailure)
+                /usr/lib/powersave/powersave-notify \
+"apccontrol: Communications with UPS lost."
                 wall <<EOF
 apccontrol: Communications with UPS lost.
 
 EOF
         ;;
         commok)
+                /usr/lib/powersave/powersave-notify \
+"apccontrol: Communciations with UPS restored."
                 wall <<EOF
 apccontrol: Communciations with UPS restored.
 
 EOF
         ;;
         powerout)
+                /usr/lib/powersave/powersave-notify \
+"apccontrol: Warning power loss detected."
                 wall <<EOF
 apccontrol: Warning power loss detected.
 
 EOF
         ;;
         onbattery)
+                /usr/lib/powersave/powersave-notify \
+"apccontrol: Power failure. Running on UPS batteries."
                 wall <<EOF
 apccontrol: Power failure. Running on UPS batteries.
 
 EOF
         ;;
         offbattery)
+                /usr/lib/powersave/powersave-notify \
+"apccontrol: Off battery. Mains returned."
                 wall <<EOF
 apccontrol: Off battery. Mains returned.
 
 EOF
         ;;
         failing)
+                /usr/lib/powersave/powersave-notify \
+"apccontrol: UPS battery power exhaused. Doing shutdown."
                 wall <<EOF
 apccontrol: UPS battery power exhaused. Doing shutdown.
 
 EOF
         ;;
         timeout)
+                /usr/lib/powersave/powersave-notify \
+"apccontrol: UPS battery runtime limit exceeded. Doing shutdown."
                 wall <<EOF
 apccontrol: UPS battery runtime limit exceeded. Doing shutdown.
 
 EOF
         ;;
         loadlimit)
+                /usr/lib/powersave/powersave-notify \
+"apccontrol: UPS battery discharge limit reached. Doing shutdown."
                 wall <<EOF
 apccontrol: UPS battery discharge limit reached. Doing shutdown.
 
 EOF
         ;;
         runlimit)
+                /usr/lib/powersave/powersave-notify \
+"apccontrol: UPS battery runtime percent reached. Doing shutdown."
                 wall <<EOF
 apccontrol: UPS battery runtime percent reached. Doing shutdown.
 
 EOF
         ;;
         doreboot)
+                /usr/lib/powersave/powersave-notify \
+"apccontrol: ${SHUTDOWN} for reboot would have been called."
                 wall <EOF
 apccontrol: ${SHUTDOWN} for reboot would have been called.
 
 EOF
         ;;
         doshutdown)
+                /usr/lib/powersave/powersave-notify \
+"apccontrol: ${SHUTDOWN} for halt would have been called."
                 wall <<EOF
 apccontrol: ${SHUTDOWN} for halt would have been called.
 
 EOF
         ;;
         mainsback)
+                /usr/lib/powersave/powersave-notify \
+"apccontrol: Power has returned..."
                 wall <<EOF
 apccontrol: Power has returned...
 
 EOF
         ;;
         annoyme)
+                /usr/lib/powersave/powersave-notify \
+"apccontrol: Power problems please logoff."
                 wall <<EOF
 apccontrol: Power problems please logoff.
 
 EOF
         ;;
         emergency)
+                /usr/lib/powersave/powersave-notify \
+"apccontrol: ${SHUTDOWN} for emergency halt would have been called."
                 wall <<EOF
 apccontrol: ${SHUTDOWN} for emergency halt would have been called.
 
 EOF
         ;;
         changeme)
+                /usr/lib/powersave/powersave-notify \
+"apccontrol: Emergency! UPS batteries have failed."
                 wall <<EOF
 apccontrol: Emergency! UPS batteries have failed.
 
@@ -112,18 +144,24 @@ Change them NOW !
 EOF
         ;;
         remotedown)
+                /usr/lib/powersave/powersave-notify \
+"apccontrol: ${SHUTDOWN} for remote halt would have been called."
                 wall <<EOF
 apccontrol: ${SHUTDOWN} for remote halt would have been called.
 
 EOF
         ;;
         startselftest)
+                /usr/lib/powersave/powersave-notify \
+"apccontrol: start self test would have been called."
                 wall <<EOF
 apccontrol: start self test would have been called.
 
 EOF
         ;;
         endselftest)
+                /usr/lib/powersave/powersave-notify \
+"apccontrol: end self test would have been called."
                 wall <<EOF
 apccontrol: end self test would have been called.
 
Index: platforms/apccontrol.in
===================================================================
--- platforms/apccontrol.in.orig
+++ platforms/apccontrol.in
@@ -25,6 +25,7 @@ SHUTDOWN=@SHUTDOWN@
 SCRIPTSHELL=@SCRIPTSHELL@
 SCRIPTDIR=@sysconfdir@
 WALL=wall
+NOTIFY=/usr/lib/powersave/powersave-notify
 
 #
 # Concatenate all output from this script to the events file
@@ -57,18 +58,23 @@ then
     fi
 fi
 
+function notify() {
+    ${NOTIFY} "$1"
+    echo "$1" | ${WALL}
+}
+
 case "$1" in
     killpower)
-       echo "Apccontrol doing: ${APCUPSD} --killpower on UPS ${2}" | ${WALL}
+       notify "Apccontrol doing: ${APCUPSD} --killpower on UPS ${2}"
        sleep 10
        ${APCUPSD} --killpower
-       echo "Apccontrol has done: ${APCUPSD} --killpower on UPS ${2}" | ${WALL}
+       notify "Apccontrol has done: ${APCUPSD} --killpower on UPS ${2}"
     ;;
     commfailure)
-       echo "Warning communications lost with UPS ${2}" | ${WALL}
+       notify "Warning communications lost with UPS ${2}"
     ;;
     commok)
-       echo "Communications restored with UPS ${2}" | ${WALL}
+       notify "Communications restored with UPS ${2}"
     ;;
 #
 # powerout, onbattery, offbattery, mainsback events occur
@@ -77,53 +83,53 @@ case "$1" in
     powerout)
     ;;
     onbattery)
-       echo "Power failure on UPS ${2}. Running on batteries." | ${WALL}
+       notify "Power failure on UPS ${2}. Running on batteries."
     ;;
     offbattery)
-       echo "Power has returned on UPS ${2}..." | ${WALL}
+       notify "Power has returned on UPS ${2}..."
     ;;
     mainsback)
        if [ -f @PWRFAILDIR@/powerfail ] ; then
-          printf "Continuing with shutdown."  | ${WALL}
+          notify "Continuing with shutdown."
        fi
     ;;
     failing)
-       echo "Battery power exhaused on UPS ${2}. Doing shutdown." | ${WALL}
+       notify "Battery power exhaused on UPS ${2}. Doing shutdown."
     ;;
     timeout)
-       echo "Battery time limit exceeded on UPS ${2}. Doing shutdown." | 
${WALL}
+       notify "Battery time limit exceeded on UPS ${2}. Doing shutdown."
     ;;
     loadlimit)
-       echo "Remaining battery charge below limit on UPS ${2}. Doing 
shutdown." | ${WALL}
+       notify "Remaining battery charge below limit on UPS ${2}. Doing 
shutdown."
     ;;
     runlimit)
-       echo "Remaining battery runtime below limit on UPS ${2}. Doing 
shutdown." | ${WALL}
+       notify "Remaining battery runtime below limit on UPS ${2}. Doing 
shutdown."
     ;;
     doreboot)
-       echo "UPS ${2} initiating Reboot Sequence" | ${WALL}
+       notify "UPS ${2} initiating Reboot Sequence"
        ${SHUTDOWN} -r now "apcupsd UPS ${2} initiated reboot"
     ;;
     doshutdown)
        . /etc/sysconfig/apcupsd
        if test "$APCUPSD_POWERFAIL_BEHAVIOR" = "hibernate" ; then
-               echo "UPS ${2} initiated hibernation" | ${WALL}
+               notify "UPS ${2} initiated hibernation"
                $HIBERNATE
        else
-               echo "UPS ${2} initiated Shutdown Sequence" | ${WALL}
+               notify "UPS ${2} initiated Shutdown Sequence"
                ${SHUTDOWN} -h now "apcupsd UPS ${2} initiated shutdown"
        fi
     ;;
     annoyme)
-       echo "Power problems with UPS ${2}. Please logoff." | ${WALL}
+       notify "Power problems with UPS ${2}. Please logoff."
     ;;
     emergency)
-       echo "Emergency Shutdown. Possible battery failure on UPS ${2}." | 
${WALL}
+       notify "Emergency Shutdown. Possible battery failure on UPS ${2}."
     ;;
     changeme)
-       echo "Emergency! Batteries have failed on UPS ${2}. Change them NOW" | 
${WALL}
+       notify "Emergency! Batteries have failed on UPS ${2}. Change them NOW"
     ;;
     remotedown)
-       echo "Remote Shutdown. Beginning Shutdown Sequence." | ${WALL}
+       notify "Remote Shutdown. Beginning Shutdown Sequence."
     ;;
     startselftest)
     ;;
++++++ apcupsd-suse.patch ++++++
--- platforms/suse/Makefile
+++ platforms/suse/Makefile
@@ -11,14 +11,8 @@
    # unlink old rc script (if not doing a DESTDIR install)
        $(call CHKCFG,del,/etc/rc.d/apcupsd)
    # install new rc script
-       $(call MKDIR,/etc/rc.d)
-       $(call INSTDATA,744,apcupsd,/etc/rc.d)
-   # save old halt script
-       $(call COPY,/etc/rc.d/halt,/etc/rc.d/halt.old)
-   # insert apcupsd callout into halt script
-       @echo "  PATCH" $(DESTDIR)/etc/rc.d/halt
-       $(V)awk -f awkhaltprog $(DESTDIR)/etc/rc.d/halt.old 
>$(DESTDIR)/etc/rc.d/halt
-       $(V)chmod 744 $(DESTDIR)/etc/rc.d/halt
+       $(call MKDIR,/etc/init.d)
+       $(call INSTDATA,744,apcupsd,/etc/init.d)
    # link new rc script (if not doing a DESTDIR install)
        $(call CHKCFG,add,/etc/rc.d/apcupsd)
        @echo "================================================="
@@ -39,7 +33,5 @@
 
 uninstall-suse:
    # unlink old rc script (if not doing a DESTDIR install)
-       -$(call CHKCFG,del,/etc/rc.d/apcupsd)
-       -$(call UNINST,/etc/rc.d/apcupsd)
-       -$(call COPY,$(DESTDIR)/etc/rc.d/halt.old,/etc/rc.d/halt)
-       -$(call UNINST,/etc/rc.d/halt.old)
+       -$(call CHKCFG,del,/etc/init.d/apcupsd)
+       -$(call UNINST,/etc/init.d/apcupsd)
++++++ apcupsd.hibernate ++++++
#!/bin/bash

. $PM_UTILS_LIBDIR/functions

case "$1" in
        hibernate)
                if test -f @PWRFAILDIR@/powerfail ; then
                        /etc/init.d/apcupsd stop
                        # Stopping of daemon typically needs at least 3 sec.
                        sleep 10
                        /etc/init.d/apcupsd powerdown
                fi
                ;;
        thaw)
                # powerfail exists => apcupsd was running before hibernation
                if test -f @PWRFAILDIR@/powerfail ; then
                        /etc/init.d/apcupsd start
                fi
                ;;
        *)
                ;;
esac

exit 0
++++++ apcupsd.init ++++++
# Copyright (c) 1996 S.u.S.E. Gmbh Fuerth, Germany.  All rights reserved.
# Copyright (C) 1996-99 Andre M. Hedrick <an...@suse.com>
# Copyright (C) 1999-02 Riccardo Facchetti <ricca...@inetcosmos.org>
#
# Author: Andre Hedrick <hedr...@astro.dyer.vanderbilt.edu> 1996-99
#         Riccardo Facchetti <ricca...@inetcosmos.org> 1999-02
#
# init.d/apcupsd
#
#   and symbolic its link
#
# /sbin/rcapcupsd
#
# System startup script for the apcupsd
#
### BEGIN INIT INFO
# Provides: apcupsd
# Required-Start:    $syslog $remote_fs
# Should-Start:      setserial hotplug_usb
# Required-Stop:     $syslog $remote_fs
# Default-Start:     1 2 3 4 5
# Default-Stop:      0 6
# Short-Description: Start the apcupsd daemon
# Description:       Start the daemon for communication with APC UPS.
### END INIT INFO

APCUPSD=@sbindir@/apcupsd
APCUPSD_LITE=/sbin/apcupsd-lite
test -r @sysconfdir@/apcupsd.conf -a -x $APCUPSD_LITE || exit 5

# Shell functions sourced from /etc/rc.status:
#      rc_check         check and set local and overall rc status
#      rc_status        check and set local and overall rc status
#      rc_status -v     ditto but be verbose in local rc status
#      rc_status -v -r  ditto and clear the local rc status
#      rc_failed        set local and overall rc status to failed
#      rc_failed <num>  set local and overall rc status to <num><num>
#      rc_reset         clear local rc status (overall remains)
#      rc_exit          exit appropriate to overall rc status
. /etc/rc.status

# First reset status of this service
rc_reset

# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
# 2 - invalid or excess argument(s)
# 3 - unimplemented feature (e.g. reload)
# 4 - insufficient privilege
# 5 - program not installed
# 6 - program not configured
# 7 - program is not running
# 
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signalling is not supported) are
# considered a success.

case "$1" in
    start)
        rm -f @PWRFAILDIR@/powerfail
        if ! grep -q '^NOLOGON[[:space:]][[:space:]]*disable' 
@sysconfdir@/apcupsd.conf ; then
            rm -f @nologdir@/nologin
        fi
        echo -n "Starting apcupsd power management"
        ## Start daemon with startproc(8). If this fails
        ## the echo return value is set appropriate.

        # startproc should return 0, even if service is 
        # already running to match LSB spec.
        startproc $APCUPSD

        # Remember status and be verbose
        rc_status -v
        ;;
    stop)
        echo -n "Shutting down apcupsd power management"
        ## Stop daemon with killproc(8) and if this fails
        ## set echo the echo return value.

        killproc -TERM $APCUPSD

        # Remember status and be verbose
        rc_status -v
        ;;
    try-restart)
        ## Stop the service and if this succeeds (i.e. the 
        ## service was running before), start it again.
        $0 status >/dev/null &&  $0 restart

        # Remember status and be quiet
        rc_status
        ;;
    restart)
        ## Stop the service and regardless of whether it was
        ## running or not, start it again.
        $0 stop
        $0 start

        # Remember status and be quiet
        rc_status
        ;;
    force-reload)
        ## Signal the daemon to reload its config. Most daemons
        ## do this on signal 1 (SIGHUP).
        ## If it does not support it, restart.

        echo -n "Reload apcupsd power management"

        $0 stop  &&  $0 start
        rc_status
        ;;
    reload)
        ## Like force-reload, but if daemon does not support
        ## signalling, do nothing (!)

        # If it does not support reload:
        exit 3
        ;;
    status)
        echo -n "Checking for apcupsd power management: "
        ## Check status with checkproc(8), if process is running
        ## checkproc will return with exit status 0.

        # Status has a slightly different for the status command:
        # 0 - service running
        # 1 - service dead, but /var/run/  pid  file exists
        # 2 - service dead, but /var/lock/ lock file exists
        # 3 - service not running

        # NOTE: checkproc returns LSB compliant status values.
        checkproc $APCUPSD
        rc_status -v
        ;;
    powerdown)
        ## Special command: Instruct UPS to shutdown.
        sync &
        echo -n "Instructing UPS to powerdown "
        $APCUPSD_LITE --killpower >/dev/null 2>&1 || rc_failed
        rc_status -v
        ;;
    try-powerdown)
        ## Special command: Instruct UPS to shutdown, if halt is running
        ## and power is failing. Otherwise silently quit.
        if test "$RUNLEVEL" = "0" -a -f @PWRFAILDIR@/powerfail ; then
            exec $0 powerdown
        fi
        ;;
    *)
        echo "Usage: $0 
{start|stop|status|try-restart|restart|force-reload|reload|powerdown|try-powerdown}"
        exit 1
        ;;
esac

rc_exit
++++++ apcupsd.logrotate ++++++
/var/log/apcupsd.events {
        missingok
        copytruncate
        notifempty
}

++++++ apcupsd.sysconfig ++++++
## Path:        Hardware/UPS
## Description: Defines UPS behavior
## Type:        list(shutdown,hibernate)
## Default:     shutdown
#
# What to do if UPS goes out of power? Shutdown or hibernate.
# Read /usr/share/doc/packages/apcupsd/README.SUSE for more.
#
APCUPSD_POWERFAIL_BEHAVIOR="shutdown"
++++++ fix-fsf-adress.patch ++++++
--- a/examples/hiddev.h 2012-09-13 18:45:40.265014654 +0200
+++ b/examples/hiddev.h 2002-05-28 15:34:21.000000000 +0200
@@ -22,7 +22,7 @@
  * 
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, 02110-1301 USA
  * 
  * Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to <vojt...@suse.cz>, or by paper mail:

--------------------------------------------------------------------------------------
--- a/examples/hid-set.c        2004-08-04 22:39:27.000000000 +0200
+++ b/examples/hid-set.c        2012-09-13 18:46:46.833011908 +0200
@@ -17,7 +17,7 @@
  * 
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, 02110-1301 USA
  * 
  * Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to <hid...@wetlogic.net>.
--------------------------------------------------------------------------------------
--- a/examples/hid-ups.c        2012-09-13 18:47:26.617010268 +0200
+++ b/examples/hid-ups.c        2007-07-18 00:54:25.000000000 +0200
@@ -23,7 +23,7 @@
  * 
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  * 
  * Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to <vojt...@ucw.cz>, or by paper mail:

--------------------------------------------------------------------------------------
--- a/COPYING   2004-07-09 23:14:29.000000000 +0200
+++ b/COPYING   2012-09-13 18:52:42.488997243 +0200
@@ -2,7 +2,7 @@
                        Version 2, June 1991
 
  Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
+ 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA
 
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to