Hello community,

here is the log from the commit of package apcupsd for openSUSE:Factory checked 
in at 2014-05-17 21:43:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/apcupsd (Old)
 and      /work/SRC/openSUSE:Factory/.apcupsd.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "apcupsd"

Changes:
--------
--- /work/SRC/openSUSE:Factory/apcupsd/apcupsd.changes  2014-02-19 
18:56:04.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.apcupsd.new/apcupsd.changes     2014-05-17 
21:43:15.000000000 +0200
@@ -1,0 +2,15 @@
+Wed May 14 14:15:04 UTC 2014 - meiss...@suse.com
+
+- %service_add_pre in  %pre section missing, added.
+
+-------------------------------------------------------------------
+Fri Feb 14 19:42:38 CET 2014 - sbra...@suse.cz
+
+- Replace pm-utils support by systemd (FATE#316824).
+  add: apcupsd-pm-utils.patch (for old products only)
+  replace: apcupsd.hibernate
+  update: apcupsd-hibernate.patch, README.SUSE
+- Fix init script references to apcupsd-lite.
+  update: apcupsd.init
+
+-------------------------------------------------------------------

New:
----
  apcupsd-pm-utils.patch

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

Other differences:
------------------
++++++ apcupsd.spec ++++++
--- /var/tmp/diff_new_pack.gk4rTP/_old  2014-05-17 21:43:17.000000000 +0200
+++ /var/tmp/diff_new_pack.gk4rTP/_new  2014-05-17 21:43:17.000000000 +0200
@@ -30,7 +30,6 @@
 BuildRequires:  mailx
 BuildRequires:  ncurses-devel
 BuildRequires:  net-snmp-devel
-BuildRequires:  pm-utils
 BuildRequires:  tcpd-devel
 BuildRequires:  update-desktop-files
 BuildRequires:  xorg-x11-devel
@@ -46,6 +45,11 @@
 BuildRequires:  sysvinit-init
 %endif
 %endif
+%if %suse_version >= 1310
+BuildRequires:  systemd
+%else
+BuildRequires:  pm-utils
+%endif
 Summary:        APC UPS Daemon (Powerful Daemon for APC UPSs)
 License:        GPL-2.0
 Group:          Hardware/UPS
@@ -81,6 +85,8 @@
 Patch13:        apcupsd-3.14.9-fixgui.patch
 # PATCH-FIX-OPENSUSE fix-fsf-adress.patch p.drou...@gmail.com -- FSF adress is 
incorrect
 Patch14:        fix-fsf-adress.patch
+# PATCH-FEATURE-OPENSUSE apcupsd-pm-utils.patch sbra...@suse.cz -- Use 
pm-utils in openSUSE < 13.1 and SLE < 12
+Patch15:        apcupsd-pm-utils.patch
 Requires:       /usr/bin/mail
 Requires(post):  %fillup_prereq
 # sed and grep are still prerequred to finish upgrade from sysvinit scripts:
@@ -150,8 +156,10 @@
 %patch12 -p1
 %patch13 -p1
 %patch14 -p1
-
 sed -i '/^#!/d' %{SOURCE1}
+%if %suse_version < 1310
+%patch15
+%endif
 
 %build
 %configure\
@@ -166,7 +174,9 @@
 %makeinstall
 install -m744 platforms/apccontrol \
               $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/apccontrol
-%if 0%{?suse_version} <= 1220
+%if 0%{?suse_version} > 1220
+ln -sf /usr/sbin/service $RPM_BUILD_ROOT/%{_sbindir}/rc%{name}
+%else
 mkdir -p $RPM_BUILD_ROOT%{_initrddir}
 ln -sf ../../etc/init.d/%{name} $RPM_BUILD_ROOT/%{_sbindir}/rc%{name}
 %endif
@@ -183,9 +193,15 @@
 %fdupes -s examples/rpt/
 
 rm -r $RPM_BUILD_ROOT/%{_datadir}/hal
+%if %suse_version >= 1310
+mkdir -p $RPM_BUILD_ROOT/usr/lib/systemd/system-sleep
+sed "s:@PWRFAILDIR@:%{_sysconfdir}/%{name}:g" <%{name}.hibernate 
>$RPM_BUILD_ROOT/usr/lib/systemd/system-sleep/apcupsd.sh
+chmod +x $RPM_BUILD_ROOT/usr/lib/systemd/system-sleep/apcupsd.sh
+%else
 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}
+%endif
 mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
 cp %{name}.sysconfig $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.%{name}
 
@@ -201,6 +217,11 @@
 install -d %{buildroot}%{_sysconfdir}/apache2/conf.d/
 install -m0644 %{SOURCE7} 
%{buildroot}%{_sysconfdir}/apache2/conf.d/%{name}.conf
 
+%pre
+%if 0%{?suse_version} > 1220
+%service_add_pre %{name}.service
+%endif
+
 %post
 %if 0%{?suse_version} > 1220
 %{fillup_only}
@@ -263,15 +284,19 @@
 %{_sbindir}/apcaccess
 %{_sbindir}/apctest
 %{_sbindir}/smtp
+%{_sbindir}/rc%{name}
 %if 0%{?suse_version} <= 1220
 %{_initrddir}/%{name}
-%{_sbindir}/rc%{name}
 %else
 %{_unitdir}/%{name}.service
 /usr/lib/systemd/system-shutdown/%{name}_shutdown
 %endif
+%if %suse_version >= 1310
+/usr/lib/systemd/system-sleep/%{name}.sh
+%else
 /etc/pm/sleep.d/99%{name}
-%dir %{_sysconfdir}/%{name}/
+%endif
+%dir %{_sysconfdir}/%{name}
 %config(noreplace) %{_sysconfdir}/%{name}/changeme
 %config(noreplace) %{_sysconfdir}/%{name}/commfailure
 %config(noreplace) %{_sysconfdir}/%{name}/commok

++++++ README.SUSE ++++++
--- /var/tmp/diff_new_pack.gk4rTP/_old  2014-05-17 21:43:17.000000000 +0200
+++ /var/tmp/diff_new_pack.gk4rTP/_new  2014-05-17 21:43:17.000000000 +0200
@@ -1,14 +1,22 @@
 Advanced apcupsd configuration
 
 
+WARNING for hybrid sleep (suspend to both)
+
+Hybrid sleep works properly only on human operated desktop systems.
+
+Do not use hybrid sleep on machines that need to automatically turn on
+after power outage! If the power returns while the computer sleeps but
+before battery goes out of power, the UPS has no way to wake the device.
+
+
 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
+  e. g. by systemctl hibernate
   (You can lose your unsaved data, if your computer does not hibernate
   correctly.)
 - Verify, that your UPS provides reasonable grace period to complete


++++++ apcupsd-hibernate.patch ++++++
--- /var/tmp/diff_new_pack.gk4rTP/_old  2014-05-17 21:43:17.000000000 +0200
+++ /var/tmp/diff_new_pack.gk4rTP/_new  2014-05-17 21:43:17.000000000 +0200
@@ -4,7 +4,7 @@
  
  APCPID=@PIDDIR@/apcupsd.pid
  APCUPSD=@sbindir@/apcupsd
-+HIBERNATE=/usr/sbin/pm-hibernate
++HIBERNATE=/usr/bin/systemctl hibernate
  SHUTDOWN=@SHUTDOWN@
  SCRIPTSHELL=@SCRIPTSHELL@
  SCRIPTDIR=@sysconfdir@

++++++ apcupsd-pm-utils.patch ++++++
--- platforms/apccontrol.in
+++ platforms/apccontrol.in
@@ -20,7 +20,7 @@
 
 APCPID=@PIDDIR@/apcupsd.pid
 APCUPSD=@sbindir@/apcupsd
-HIBERNATE=/usr/bin/systemctl hibernate
+HIBERNATE=/usr/sbin/pm-hibernate
 SHUTDOWN=@SHUTDOWN@
 SCRIPTSHELL=@SCRIPTSHELL@
 SCRIPTDIR=@sysconfdir@
--- README.SUSE
+++ README.SUSE
@@ -1,22 +1,14 @@
 Advanced apcupsd configuration
 
 
-WARNING for hybrid sleep (suspend to both)
-
-Hybrid sleep works properly only on human operated desktop systems.
-
-Do not use hybrid sleep on machines that need to automatically turn on
-after power outage! If the power returns while the computer sleeps but
-before battery goes out of power, the UPS has no way to wake the device.
-
-
 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 systemctl hibernate
+  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
--- apcupsd.hibernate
+++ apcupsd.hibernate
@@ -1,15 +1,24 @@
 #!/bin/bash
 
+. $PM_UTILS_LIBDIR/functions
 
-# Always stop apcupsd before sleep, but do not initiate powerdown for 
hybrid-sleep.
-if [ "$1" = pre ] && ( [ "$2" = hibernate ] || [ "$2" = hybrid-sleep ] ) ; then
-       /sbin/service apcupsd.service stop
-fi
-if [ "$1" = pre ] && [ "$2" = hibernate ] ; then
-       # FIXME: All hibernate quirks are called in parallel. To be on a safest 
side, we should initiate powerdown grace period when they terminate.
-       sleep 5
-       /etc/apcupsd/apccontrol killpower
-fi
-if [ "$1" = post ] && ( [ "$2" = hibernate ] || [ "$2" = hybrid-sleep ] ) ; 
then
-       /sbin/service apcupsd.service start
-fi
+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.hibernate ++++++
--- /var/tmp/diff_new_pack.gk4rTP/_old  2014-05-17 21:43:17.000000000 +0200
+++ /var/tmp/diff_new_pack.gk4rTP/_new  2014-05-17 21:43:17.000000000 +0200
@@ -1,24 +1,15 @@
 #!/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
+# Always stop apcupsd before sleep, but do not initiate powerdown for 
hybrid-sleep.
+if [ "$1" = pre ] && ( [ "$2" = hibernate ] || [ "$2" = hybrid-sleep ] ) ; then
+       /sbin/service apcupsd.service stop
+fi
+if [ "$1" = pre ] && [ "$2" = hibernate ] ; then
+       # FIXME: All hibernate quirks are called in parallel. To be on a safest 
side, we should initiate powerdown grace period when they terminate.
+       sleep 5
+       /etc/apcupsd/apccontrol killpower
+fi
+if [ "$1" = post ] && ( [ "$2" = hibernate ] || [ "$2" = hybrid-sleep ] ) ; 
then
+       /sbin/service apcupsd.service start
+fi

++++++ apcupsd.init ++++++
--- /var/tmp/diff_new_pack.gk4rTP/_old  2014-05-17 21:43:17.000000000 +0200
+++ /var/tmp/diff_new_pack.gk4rTP/_new  2014-05-17 21:43:17.000000000 +0200
@@ -25,7 +25,7 @@
 ### END INIT INFO
 
 APCUPSD=@sbindir@/apcupsd
-APCUPSD_LITE=/sbin/apcupsd-lite
+APCUPSD_LITE=@sbindir@/apcupsd
 test -r @sysconfdir@/apcupsd.conf -a -x $APCUPSD_LITE || exit 5
 
 # Shell functions sourced from /etc/rc.status:

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to