From 699843a16912442788d9c2b762ba049d50af7ecb Mon Sep 17 00:00:00 2001 From: Robby Workman Date: Wed, 15 May 2013 13:11:49 -0500 Subject: system/apcupsd: Fix lockdir definition and usage Signed-off-by: Robby Workman --- system/apcupsd/apcupsd.SlackBuild | 12 +++++++++--- system/apcupsd/create_lockdir_in_init_script.diff | 11 ----------- system/apcupsd/patches/create_lockdir_in_init_script.diff | 11 +++++++++++ system/apcupsd/patches/fix_lockdir_in_config_file.diff | 12 ++++++++++++ 4 files changed, 32 insertions(+), 14 deletions(-) delete mode 100644 system/apcupsd/create_lockdir_in_init_script.diff create mode 100644 system/apcupsd/patches/create_lockdir_in_init_script.diff create mode 100644 system/apcupsd/patches/fix_lockdir_in_config_file.diff (limited to 'system/apcupsd') diff --git a/system/apcupsd/apcupsd.SlackBuild b/system/apcupsd/apcupsd.SlackBuild index 95cbc123be..0e1993fb86 100644 --- a/system/apcupsd/apcupsd.SlackBuild +++ b/system/apcupsd/apcupsd.SlackBuild @@ -2,7 +2,7 @@ # Slackware build script for apcupsd -# Copyright 2006-2012 Robby Workman Northport, AL, USA +# Copyright 2006-2013 Robby Workman Northport, AL, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -27,7 +27,7 @@ PRGNAM=apcupsd VERSION=${VERSION:-3.14.10} -BUILD=${BUILD:-2} +BUILD=${BUILD:-3} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -70,7 +70,10 @@ chmod -R a-s,u+w,go+r-w . # Create /var/lock/subsys in the init script (rc.apcupsd) # These days, /var/lock may be on a tmpfs, so we can't assume the dir is there -patch -p1 < $CWD/create_lockdir_in_init_script.diff +patch -p1 < $CWD/patches/create_lockdir_in_init_script.diff + +# Use /var/lock/subsys as the LOCKDIR in apcupsd.conf +patch -p1 < $CWD/patches/fix_lockdir_in_config_file.diff # The "--disable-install-distdir" is important - don't remove it. # If you enable the distribution-specific install, then apcupsd will attempt @@ -129,6 +132,9 @@ for i in apccontrol apcupsd.conf apcupsd.css changeme commfailure \ mv $PKG/etc/apcupsd/$i $PKG/etc/apcupsd/$i.new; done +# Remove obsolete HAL stuff +rm -rf $PKG/usr/share/hal + mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a \ COPYING ChangeLog DISCLAIMER Developers INSTALL ReleaseNotes \ diff --git a/system/apcupsd/create_lockdir_in_init_script.diff b/system/apcupsd/create_lockdir_in_init_script.diff deleted file mode 100644 index 06d158fb91..0000000000 --- a/system/apcupsd/create_lockdir_in_init_script.diff +++ /dev/null @@ -1,11 +0,0 @@ -diff -Nur apcupsd-3.14.10.orig/platforms/slackware/apcupsd.in apcupsd-3.14.10/platforms/slackware/apcupsd.in ---- apcupsd-3.14.10.orig/platforms/slackware/apcupsd.in 2005-03-03 11:18:09.000000000 -0600 -+++ apcupsd-3.14.10/platforms/slackware/apcupsd.in 2012-09-07 21:31:27.347857464 -0500 -@@ -20,6 +20,7 @@ - if [ -f ${APCPID} ]; then - return=" Already running." - else -+ mkdir -p @LOCKDIR@/subsys - @sbindir@/apcupsd && touch @LOCKDIR@/subsys/apcupsd \ - || return=" Failed." - fi diff --git a/system/apcupsd/patches/create_lockdir_in_init_script.diff b/system/apcupsd/patches/create_lockdir_in_init_script.diff new file mode 100644 index 0000000000..06d158fb91 --- /dev/null +++ b/system/apcupsd/patches/create_lockdir_in_init_script.diff @@ -0,0 +1,11 @@ +diff -Nur apcupsd-3.14.10.orig/platforms/slackware/apcupsd.in apcupsd-3.14.10/platforms/slackware/apcupsd.in +--- apcupsd-3.14.10.orig/platforms/slackware/apcupsd.in 2005-03-03 11:18:09.000000000 -0600 ++++ apcupsd-3.14.10/platforms/slackware/apcupsd.in 2012-09-07 21:31:27.347857464 -0500 +@@ -20,6 +20,7 @@ + if [ -f ${APCPID} ]; then + return=" Already running." + else ++ mkdir -p @LOCKDIR@/subsys + @sbindir@/apcupsd && touch @LOCKDIR@/subsys/apcupsd \ + || return=" Failed." + fi diff --git a/system/apcupsd/patches/fix_lockdir_in_config_file.diff b/system/apcupsd/patches/fix_lockdir_in_config_file.diff new file mode 100644 index 0000000000..d260abd579 --- /dev/null +++ b/system/apcupsd/patches/fix_lockdir_in_config_file.diff @@ -0,0 +1,12 @@ +diff -Nur apcupsd-3.14.10.orig/platforms/etc/apcupsd.conf.in apcupsd-3.14.10/platforms/etc/apcupsd.conf.in +--- apcupsd-3.14.10.orig/platforms/etc/apcupsd.conf.in 2011-05-19 17:55:25.000000000 -0500 ++++ apcupsd-3.14.10/platforms/etc/apcupsd.conf.in 2013-05-15 12:44:25.497885953 -0500 +@@ -90,7 +90,7 @@ + + # LOCKFILE + # Path for device lock file. Not used on Win32. +-LOCKFILE @LOCKDIR@ ++LOCKFILE @LOCKDIR@/subsys + + # SCRIPTDIR + # Directory in which apccontrol and event scripts are located. -- cgit v1.2.3