summaryrefslogtreecommitdiff
path: root/system/apcupsd
diff options
context:
space:
mode:
authorRobby Workman <rworkman@slackbuilds.org>2010-05-18 11:01:42 -0500
committerRobby Workman <rworkman@slackbuilds.org>2010-05-18 11:01:42 -0500
commitc8393130084ef9e17a0820c3b70173678dde3360 (patch)
tree128e4932323c3386a42c52c2c688131978f7cde9 /system/apcupsd
parent164b90eedbd38f235811cd0990e532fec5da38b9 (diff)
downloadslackbuilds-c8393130084ef9e17a0820c3b70173678dde3360.tar.gz
system/apcupsd: Miscellaneous script cleanups.
Diffstat (limited to 'system/apcupsd')
-rw-r--r--system/apcupsd/apcupsd.SlackBuild46
-rw-r--r--system/apcupsd/slack-desc8
2 files changed, 30 insertions, 24 deletions
diff --git a/system/apcupsd/apcupsd.SlackBuild b/system/apcupsd/apcupsd.SlackBuild
index 36c362d980..eccd49b02c 100644
--- a/system/apcupsd/apcupsd.SlackBuild
+++ b/system/apcupsd/apcupsd.SlackBuild
@@ -27,10 +27,19 @@
PRGNAM=apcupsd
VERSION=3.14.8
-ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i486 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
+
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
@@ -53,6 +62,9 @@ elif [ "$ARCH" = "i686" ]; then
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
set -e
@@ -99,22 +111,11 @@ CXXFLAGS="$SLKCFLAGS -DNETSNMP_NO_LEGACY_DEFINITIONS=1" \
make
make install DESTDIR=$PKG
-( cd $PKG
- find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | \
- xargs strip --strip-unneeded 2> /dev/null || true
- find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | \
- xargs strip --strip-unneeded 2> /dev/null || true
-)
+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 \
- COPYING ChangeLog DISCLAIMER Developers INSTALL ReleaseNotes \
- VERIFYING examples doc/* $CWD/README.SLACKWARE $CWD/$PRGNAM.SlackBuild \
- $PKG/usr/doc/$PRGNAM-$VERSION
-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
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
# Install the apcupsd init script
install -D -m 0755 platforms/slackware/apcupsd \
@@ -134,10 +135,15 @@ for i in apccontrol apcupsd.conf apcupsd.css changeme commfailure \
mv $PKG/etc/apcupsd/$i $PKG/etc/apcupsd/$i.new;
done
-( cd $PKG/usr/man
- find . -type f -exec gzip -9 {} \;
- for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
-)
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a \
+ COPYING ChangeLog DISCLAIMER Developers INSTALL ReleaseNotes \
+ VERIFYING examples doc/* $CWD/README.SLACKWARE $CWD/$PRGNAM.SlackBuild \
+ $PKG/usr/doc/$PRGNAM-$VERSION
+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
mkdir -p $PKG/install
sed s/@VERSION@/$VERSION/ $CWD/slack-desc > $PKG/install/slack-desc
diff --git a/system/apcupsd/slack-desc b/system/apcupsd/slack-desc
index 8e7ee00dcb..68cec1d5b3 100644
--- a/system/apcupsd/slack-desc
+++ b/system/apcupsd/slack-desc
@@ -12,8 +12,8 @@ apcupsd: Apcupsd can be used for power mangement and controlling most of APC's
apcupsd: UPS models on Unix and Windows machines. Apcupsd works with most of
apcupsd: APC's Smart-UPS models as well as most simple signalling models such
apcupsd: as Back-UPS, and BackUPS-Office.
-apcupsd:
+apcupsd:
apcupsd: See /usr/doc/apcupsd-@VERSION@/README.SLACKWARE
-apcupsd:
-apcupsd:
-apcupsd:
+apcupsd:
+apcupsd:
+apcupsd: