aboutsummaryrefslogtreecommitdiff
path: root/system/apcupsd/apcupsd.SlackBuild
diff options
context:
space:
mode:
authorRobby Workman <rw@rlworkman.net>2010-05-11 22:26:19 +0200
committerDavid Somero <xgizzmo@slackbuilds.org>2010-05-11 22:26:19 +0200
commit21dba75362eda35fe6c706d68262e521dd2f91c1 (patch)
tree5ee1324ed3a38ca8a26f7cd97551e5c4b595d497 /system/apcupsd/apcupsd.SlackBuild
parent91ba3afda8a427d68e25738ca649abb38a8dfe3f (diff)
system/apcupsd: Updated for version 3.14.4
Diffstat (limited to 'system/apcupsd/apcupsd.SlackBuild')
-rw-r--r--system/apcupsd/apcupsd.SlackBuild31
1 files changed, 18 insertions, 13 deletions
diff --git a/system/apcupsd/apcupsd.SlackBuild b/system/apcupsd/apcupsd.SlackBuild
index b0c7ff7b02924..af4edb58ae741 100644
--- a/system/apcupsd/apcupsd.SlackBuild
+++ b/system/apcupsd/apcupsd.SlackBuild
@@ -2,7 +2,7 @@
# Slackware build script for apcupsd
-# Copyright 2006-2008 Robby Workman (http://rlworkman.net)
+# Copyright 2006-2008 Robby Workman Northport, Alabama, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -23,9 +23,9 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=apcupsd
-VERSION=3.14.3
+VERSION=3.14.4
ARCH=${ARCH:-i486}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
CWD=$(pwd)
@@ -36,6 +36,7 @@ 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:-/etc/apcupsd} # 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)
@@ -44,6 +45,8 @@ if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
fi
set -e
@@ -73,27 +76,30 @@ CXXFLAGS="$SLKCFLAGS" \
--sysconfdir=/etc/apcupsd \
--disable-install-distdir \
--enable-cgi \
- --with-cgi-bin=/etc/apcupsd \
+ --with-cgi-bin=$CGIPATH \
--enable-usb \
- --enable-powerflute \
--with-libwrap \
--enable-nls \
--enable-snmp=yes \
--with-upstype=$UPSTYPE \
--with-upscable=$UPSCABLE \
- --with-dev=$DEVICE
+ --with-dev=$DEVICE \
+ --build=$ARCH-slackware-linux
make
-make install-strip DESTDIR=$PKG
+make install DESTDIR=$PKG
+
+find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a \
- ABOUT-NLS COPYING ChangeLog* DISCLAIMER Developers INSTALL ReleaseNotes \
- VERIFYING examples doc/* $CWD/README-SLACKWARE $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a COPYING ChangeLog DISCLAIMER Developers INSTALL ReleaseNotes VERIFYING \
+ examples doc/* $CWD/README-SLACKWARE $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
find $PKG/usr/doc/$PRGNAM-$VERSION -type f -exec chmod 644 {} \;
find $PKG/usr/doc/$PRGNAM-$VERSION -name "Makefile*" -exec rm {} \;
find $PKG/usr/doc/$PRGNAM-$VERSION -name "*.man" -exec rm {} \;
+chown -R root:root $PKG/usr/doc
# Install the apctest man page - it's not done automatically for some reason
install -m 0644 doc/apctest.man $PKG/usr/man/man8/apctest.8
@@ -107,9 +113,8 @@ install -d -m 0755 $PKG/var/lock/subsys
chmod 1777 $PKG/var/lock
# Rename config files to *.new so custom changes aren't clobberred
-for i in apccontrol apcupsd.conf apcupsd.css changeme \
- commfailure commok hosts.conf multimon.cgi multimon.conf \
- offbattery onbattery upsfstats.cgi upsimage.cgi upsstats.cgi ; do
+for i in apccontrol apcupsd.conf apcupsd.css changeme commfailure \
+ commok hosts.conf multimon.conf offbattery onbattery ; do
mv $PKG/etc/apcupsd/$i $PKG/etc/apcupsd/$i.new;
done