summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobby Workman <rworkman@slackbuilds.org>2012-09-07 21:37:29 -0500
committerRobby Workman <rworkman@slackbuilds.org>2012-09-07 21:37:29 -0500
commitf828e6ed502aeb0234d7bed789ad8c338545a064 (patch)
treea92b729cdc6019dac9a71da52427548f4ae83740
parent62d708f8c37415b496821f1a53daaae659941967 (diff)
downloadslackbuilds-f828e6ed502aeb0234d7bed789ad8c338545a064.tar.gz
system/apcupsd: Updated for version 3.14.10.
This commit also enables gapcmon in configure. Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
-rw-r--r--system/apcupsd/README2
-rw-r--r--system/apcupsd/apcupsd.SlackBuild32
-rw-r--r--system/apcupsd/apcupsd.info6
-rw-r--r--system/apcupsd/create_lockdir_in_init_script.diff11
4 files changed, 29 insertions, 22 deletions
diff --git a/system/apcupsd/README b/system/apcupsd/README
index 1f44af956c..f8afad550b 100644
--- a/system/apcupsd/README
+++ b/system/apcupsd/README
@@ -13,6 +13,6 @@ the distribution-specific installation to prevent messing with files outside
DESTDIR; however, this does make it require some manual configuration after
installation.
-After installing, see /usr/doc/apcupsd-3.14.8/README.SLACKWARE for more
+After installing, see /usr/doc/apcupsd-3.14.10/README.SLACKWARE for more
information on how to modify rc.6 and how to start the apcupsd daemon
automatically at boot.
diff --git a/system/apcupsd/apcupsd.SlackBuild b/system/apcupsd/apcupsd.SlackBuild
index a4a5c3a017..c568edc606 100644
--- a/system/apcupsd/apcupsd.SlackBuild
+++ b/system/apcupsd/apcupsd.SlackBuild
@@ -2,7 +2,7 @@
# Slackware build script for apcupsd
-# Copyright 2006-2011 Robby Workman Northport, AL, USA
+# Copyright 2006-2012 Robby Workman Northport, AL, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -26,7 +26,7 @@
# * added log rotation
PRGNAM=apcupsd
-VERSION=3.14.9
+VERSION=${VERSION:-3.14.10}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -43,14 +43,6 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-# These can be changed in the config file after installing apcupsd,
-# so it's okay to leave them alone if you don't know what the values
-# should be yet.
-CGIPATH=${CGIPATH:-/var/www/cgi-bin} # Path for cgi executables
-DEVICE=${DEVICE:-/dev/usb/hiddev0} # Device node of UPS
-UPSTYPE=${UPSTYPE:-usb} # Type of UPS
-UPSCABLE=${UPSCABLE:-usb} # Cable type (RJ45<-->USB = USB)
-
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
@@ -76,6 +68,10 @@ cd $PRGNAM-$VERSION
chown -R root:root .
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
+
# The "--disable-install-distdir" is important - don't remove it.
# If you enable the distribution-specific install, then apcupsd will attempt
# to patch the /etc/rc.d/rc.6 script on your system. This may be acceptable
@@ -97,15 +93,19 @@ CXXFLAGS="$SLKCFLAGS -DNETSNMP_NO_LEGACY_DEFINITIONS=1" \
--sysconfdir=/etc/apcupsd \
--disable-install-distdir \
--enable-cgi \
- --with-cgi-bin=$CGIPATH \
+ --with-cgi-bin=${CGIPATH:-/var/www/cgi-bin} \
--enable-usb \
--with-libwrap \
--enable-snmp=yes \
- --with-upstype=$UPSTYPE \
- --with-upscable=$UPSCABLE \
- --with-dev=$DEVICE \
+ --enable-gapcmon \
+ --with-upstype=${UPSTYPE:-usb} \
+ --with-upscable=${UPSCABLE:-usb} \
--build=$ARCH-slackware-linux
+# Deprecated option - shouldn't be needed due to autodetection
+# --with-dev=${DEVICE:-/dev/usb/hiddev0}
+# Also, UPSCABLE refers to cable type (e.g. RJ45<-->USB = USB)
+
make
make install DESTDIR=$PKG
@@ -119,10 +119,6 @@ for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; r
install -D -m 0755 platforms/slackware/apcupsd \
$PKG/etc/rc.d/rc.apcupsd.new
-# Create the /var/lock/subsys directory
-install -d -m 0755 $PKG/var/lock/subsys
-chmod 1777 $PKG/var/lock
-
# Configure logrotate
mkdir -p $PKG/etc/logrotate.d
cat $CWD/apcupsd.logrotate > $PKG/etc/logrotate.d/apcupsd.new
diff --git a/system/apcupsd/apcupsd.info b/system/apcupsd/apcupsd.info
index 565679e395..a06b6e7a9d 100644
--- a/system/apcupsd/apcupsd.info
+++ b/system/apcupsd/apcupsd.info
@@ -1,8 +1,8 @@
PRGNAM="apcupsd"
-VERSION="3.14.9"
+VERSION="3.14.10"
HOMEPAGE="http://www.apcupsd.org"
-DOWNLOAD="http://downloads.sourceforge.net/apcupsd/apcupsd-3.14.9.tar.gz"
-MD5SUM="aa5e2c2954a81c2f07e0a356e38fe853"
+DOWNLOAD="http://downloads.sourceforge.net/apcupsd/apcupsd-3.14.10.tar.gz"
+MD5SUM="5928822d855c5cf7ac29655e3e0b8c23"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
diff --git a/system/apcupsd/create_lockdir_in_init_script.diff b/system/apcupsd/create_lockdir_in_init_script.diff
new file mode 100644
index 0000000000..06d158fb91
--- /dev/null
+++ b/system/apcupsd/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