diff options
Diffstat (limited to 'system/apcupsd/apcupsd.SlackBuild')
-rw-r--r-- | system/apcupsd/apcupsd.SlackBuild | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/system/apcupsd/apcupsd.SlackBuild b/system/apcupsd/apcupsd.SlackBuild index b0c7ff7b02..af4edb58ae 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 |