summaryrefslogtreecommitdiff
path: root/system/apcupsd/apcupsd.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'system/apcupsd/apcupsd.SlackBuild')
-rw-r--r--system/apcupsd/apcupsd.SlackBuild25
1 files changed, 15 insertions, 10 deletions
diff --git a/system/apcupsd/apcupsd.SlackBuild b/system/apcupsd/apcupsd.SlackBuild
index eff23168bb..36c362d980 100644
--- a/system/apcupsd/apcupsd.SlackBuild
+++ b/system/apcupsd/apcupsd.SlackBuild
@@ -2,7 +2,7 @@
# Slackware build script for apcupsd
-# Copyright 2006-2009 Robby Workman Northport, AL, USA
+# Copyright 2006-2010 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.5
+VERSION=3.14.8
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -46,10 +46,13 @@ UPSCABLE=${UPSCABLE:-usb} # Cable type (RJ45<-->USB == USB)
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
fi
set -e
@@ -63,16 +66,21 @@ cd $PRGNAM-$VERSION
chown -R root:root .
chmod -R a-s,u+w,go+r-w .
-# The "--disable-install-distdir" is important - don't remove it
+# 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
# from a single-user standpoint, but for packagers, it's not worth a crap.
# If I'd wanted the Makefile tampering with things outside DESTDIR, I wouldn't
# have used the DESTDIR flag - why is this so difficult to comprehend?
-CFLAGS="$SLKCFLAGS" \
-CXXFLAGS="$SLKCFLAGS" \
+#
+# Don't use legacy defines in the netsnmp headers
+# http://www.linuxquestions.org/questions/slackware-14/cannot-build-apcups-on-slack64-current-775065/
+#
+CFLAGS="$SLKCFLAGS -DNETSNMP_NO_LEGACY_DEFINITIONS=1" \
+CXXFLAGS="$SLKCFLAGS -DNETSNMP_NO_LEGACY_DEFINITIONS=1" \
./configure \
--prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
--sbindir=/sbin \
--mandir=/usr/man \
--localstatedir=/var \
@@ -95,7 +103,7 @@ make install DESTDIR=$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
+ xargs strip --strip-unneeded 2> /dev/null || true
)
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
@@ -108,9 +116,6 @@ 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
-
# Install the apcupsd init script
install -D -m 0755 platforms/slackware/apcupsd \
$PKG/etc/rc.d/rc.apcupsd.new
@@ -139,4 +144,4 @@ sed s/@VERSION@/$VERSION/ $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
-/sbin/makepkg -l y -c n -p $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz
+/sbin/makepkg -l y -c n -p $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}