summaryrefslogtreecommitdiffstats
path: root/system/nut
diff options
context:
space:
mode:
Diffstat (limited to 'system/nut')
-rw-r--r--system/nut/README12
-rw-r--r--system/nut/nut.SlackBuild32
-rw-r--r--system/nut/rc.ups3
3 files changed, 31 insertions, 16 deletions
diff --git a/system/nut/README b/system/nut/README
index 2d5a3b11d1..bf5ba069e1 100644
--- a/system/nut/README
+++ b/system/nut/README
@@ -1,8 +1,8 @@
-The Network UPS Tools is a collection of programs which provide a common
-interface for monitoring and administering UPS hardware. It uses a
-layered apporoach to connect all the components. Drivers are provided
-for a wide assortment of equipment. The primary goal of the NUT project
-is to provide reliable monitoring of UPS hardware and ensure safe
-shutdowns of the systems which are connected.
+The Network UPS Tools is a collection of programs which provide a
+common interface for monitoring and administering UPS hardware. It
+uses a layered apporoach to connect all the components. Drivers are
+provided for a wide assortment of equipment. The primary goal of the
+NUT project is to provide reliable monitoring of UPS hardware and
+ensure safe shutdowns of the systems which are connected.
See README.SLACKWARE for configuration hints.
diff --git a/system/nut/nut.SlackBuild b/system/nut/nut.SlackBuild
index 53ae8f2dfc..d4b19e36ee 100644
--- a/system/nut/nut.SlackBuild
+++ b/system/nut/nut.SlackBuild
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for nut (Network UPS Tools)
@@ -22,10 +22,13 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=nut
VERSION=${VERSION:-2.7.4}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
NUTUSER=${NUTUSER:-nut}
NUTGROUP=${NUTGROUP:-nut}
@@ -45,19 +48,26 @@ fi
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) ARCH=i486 ;;
+ i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
-CWD=$(pwd)
+# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
+# the name of the created package would be, and then exit. This information
+# could be useful to other scripts.
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
@@ -86,7 +96,7 @@ find -L . \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
CFLAGS="$SLKCFLAGS" \
-CXXFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS -std=c++14" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
@@ -120,8 +130,8 @@ 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 bash_completion script
-install -d $PKG/etc/bash_completion.d
-install -m 755 scripts/misc/nut.bash_completion $PKG/etc/bash_completion.d/nut
+install -d $PKG/usr/share/bash-completion/completions
+install -m 755 scripts/misc/nut.bash_completion $PKG/usr/share/bash-completion/completions/nut
# Install the startup script
install -d $PKG/etc/rc.d
@@ -143,9 +153,11 @@ rm $PKG/usr/doc/$PRGNAM-$VERSION/docs/Makefile*
cat $CWD/README.SLACKWARE > $PKG/usr/doc/$PRGNAM-$VERSION/README.SLACKWARE
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+rm -f $PKG/usr/lib*/*.la
+
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/system/nut/rc.ups b/system/nut/rc.ups
index 0d9f4bc769..37916951bd 100644
--- a/system/nut/rc.ups
+++ b/system/nut/rc.ups
@@ -49,6 +49,9 @@ stop() {
case "$1" in
start) # starts everything (for a ups server box)
+ mkdir -p /var/run/nut
+ chown $NUTUSER:$NUTGROUP /var/run/nut
+ chmod 0770 /var/run/nut
start_driver
start_upsd
start_upsmon