summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Matteo Bernardini2024-04-05 22:44:49 +0200
committer Matteo Bernardini2024-04-27 10:38:46 +0200
commit027b9b3abce3226c6134f7734f2393b467c5db86 (patch)
tree5ec16c2f98901d850fc6b78cac33414b63e356be
parent68ac93024440c1dcb61e579018ce241a1ab44180 (diff)
downloadslackbuilds-nut.tar.gz
system/nut: Removed (added to Slackware).nut
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
-rw-r--r--system/nut/README8
-rw-r--r--system/nut/README.SLACKWARE43
-rw-r--r--system/nut/doinst.sh21
-rw-r--r--system/nut/nut.SlackBuild163
-rw-r--r--system/nut/nut.info10
-rw-r--r--system/nut/nut_kill_inverter15
-rw-r--r--system/nut/nut_restart_udev12
-rw-r--r--system/nut/rc.ups76
-rw-r--r--system/nut/slack-desc19
9 files changed, 0 insertions, 367 deletions
diff --git a/system/nut/README b/system/nut/README
deleted file mode 100644
index bf5ba069e1..0000000000
--- a/system/nut/README
+++ /dev/null
@@ -1,8 +0,0 @@
-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/README.SLACKWARE b/system/nut/README.SLACKWARE
deleted file mode 100644
index a73275956c..0000000000
--- a/system/nut/README.SLACKWARE
+++ /dev/null
@@ -1,43 +0,0 @@
-README.SLACKWARE
-Written by V'yacheslav Stetskevych <slava18 dont_spam_me gmail com>
-
-In order to configure Network UPS tools on Slackware you need to rename
-or make copies of the sample config files in /etc/nut and edit them
-to suit your needs. See documentation in /usr/doc/nut-* for reference.
-As you make your new config files, don't forget to secure them:
- chown root:nut /etc/nut/*.conf /etc/nut/*.users
- chmod 640 /etc/nut/*.conf /etc/nut/*.users
-
-If you are using a serial-connected UPS, be sure to add the nut user to
-the 'dialout' group:
- usermod -a -G dialout nut
-
-A startup script /etc/rc.d/rc.ups is provided with this build.
-You can add these lines to /etc/rc.d/rc.local to launch it on system start:
- if [ -x /etc/rc.d/rc.ups ]; then
- /etc/rc.d/rc.ups start
- fi
-
-If you have more than one box sitting on the same UPS, you should only use
-'start' on the one box that is connected to the device using a signal cable.
-On the other boxes, start rc.ups with the 'start_upsmon' parameter to only
-monitor the power status (client mode). Configure access permissions on the
-server box accordingly.
-
-If you wish for your UPS to turn off it's power during an extended power outage
-in order not to drain it's battery completely, you should make two simple edits
-to the Slackware shutdown script /etc/rc.d/rc.6 near the end of it.
-These are only needed on the server box, one that is connected to the UPS:
-1) Insert after the rootfs has been remounted read-only:
- if [ -x /usr/libexec/nut/nut_restart_udev ]; then
- . /usr/libexec/nut/nut_restart_udev
- fi
-2) Insert after the genpowerd block and before the actual halt:
- if [ -x /usr/libexec/nut/nut_kill_inverter ]; then
- . /usr/libexec/nut/nut_kill_inverter
- fi
-
-Don't forget to set your motherboard BIOS to automatically turn the machine on
-when the power comes back.
-
-Have fun!
diff --git a/system/nut/doinst.sh b/system/nut/doinst.sh
deleted file mode 100644
index ea64d25add..0000000000
--- a/system/nut/doinst.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-config() {
- NEW="$1"
- OLD="$(dirname $NEW)/$(basename $NEW .new)"
- # If there's no config file by that name, mv it over:
- if [ ! -r $OLD ]; then
- mv $NEW $OLD
- elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
- # toss the redundant copy
- rm $NEW
- fi
- # Otherwise, we leave the .new copy for the admin to consider...
-}
-
-# Keep same perms on rc.ups.new:
-if [ -e etc/rc.d/rc.ups ]; then
- cp -a etc/rc.d/rc.ups etc/rc.d/rc.ups.new.incoming
- cat etc/rc.d/rc.ups.new > etc/rc.d/rc.ups.new.incoming
- mv etc/rc.d/rc.ups.new.incoming etc/rc.d/rc.ups.new
-fi
-
-config etc/rc.d/rc.ups.new
diff --git a/system/nut/nut.SlackBuild b/system/nut/nut.SlackBuild
deleted file mode 100644
index d4b19e36ee..0000000000
--- a/system/nut/nut.SlackBuild
+++ /dev/null
@@ -1,163 +0,0 @@
-#!/bin/bash
-
-# Slackware build script for nut (Network UPS Tools)
-
-# Copyright 2010 V'yacheslav Stetskevych <slava18 dont_spam_me gmail com>
-# All rights reserved.
-#
-# Redistribution and use of this script, with or without modification, is
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of this script must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-# 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:-2}
-TAG=${TAG:-_SBo}
-PKGTYPE=${PKGTYPE:-tgz}
-
-NUTUSER=${NUTUSER:-nut}
-NUTGROUP=${NUTGROUP:-nut}
-
-# The user and group accounts have to be created manually.
-# For slackbuilds.org, assigned nut uid/gid are 218/218.
-# See http://slackbuilds.org/uid_gid.txt
-if ! grep -q ^$NUTGROUP: /etc/group; then
- echo " You must have a \"$NUTGROUP\" group to run this script."
- echo " # groupadd -g 218 $NUTGROUP"
- exit 1
-elif ! grep -q ^$NUTUSER: /etc/passwd; then
- echo " You must have a \"$NUTUSER\" user to run this script."
- echo " # useradd -u 218 -g $NUTGROUP -s /bin/false $NUTUSER"
- exit 1
-fi
-
-if [ -z "$ARCH" ]; then
- case "$( uname -m )" in
- i?86) ARCH=i586 ;;
- arm*) ARCH=arm ;;
- *) ARCH=$( uname -m ) ;;
- esac
-fi
-
-# 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" = "i586" ]; then
- SLKCFLAGS="-O2 -march=i586 -mtune=i686"
- LIBDIRSUFFIX=""
-elif [ "$ARCH" = "i686" ]; then
- SLKCFLAGS="-O2 -march=i686 -mtune=i686"
- LIBDIRSUFFIX=""
-elif [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS="-O2 -fPIC"
- LIBDIRSUFFIX="64"
-else
- SLKCFLAGS="-O2"
- LIBDIRSUFFIX=""
-fi
-
-set -e
-
-rm -rf $PKG
-mkdir -p $TMP $PKG $OUTPUT
-cd $TMP
-rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
-cd $PRGNAM-$VERSION
-chown -R root:root .
-find -L . \
- \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
- -o -perm 511 \) -exec chmod 755 {} \; -o \
- \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-
-CFLAGS="$SLKCFLAGS" \
-CXXFLAGS="$SLKCFLAGS -std=c++14" \
-./configure \
- --prefix=/usr \
- --libdir=/usr/lib${LIBDIRSUFFIX} \
- --sysconfdir=/etc/$PRGNAM \
- --localstatedir=/var \
- --datadir=/usr/share/nut \
- --mandir=/usr/man \
- --docdir=/usr/doc/$PRGNAM-$VERSION \
- --build=$ARCH-slackware-linux \
- --enable-strip \
- --disable-static \
- --with-dev \
- --with-serial \
- --with-usb \
- --with-snmp \
- --with-neon \
- --with-wrap \
- --with-cgi\
- --with-cgipath=/var/www/cgi-bin/nut \
- --with-htmlpath=/var/www/htdocs/ups \
- --with-drvpath=/usr/libexec/nut \
- --with-statepath=/var/run/nut \
- --with-pidpath=/var/run/nut \
- --with-altpidpath=/var/run/nut \
- --with-user=nut \
- --with-group=nut
-make
-make install DESTDIR=$PKG
-
-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/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
-install -m 644 $CWD/rc.ups $PKG/etc/rc.d/rc.ups.new
-
-# Create the state and run dirs
-install -d -o root -g $NUTGROUP -m 770 $PKG/var/state/ups
-install -d -o $NUTUSER -g $NUTGROUP -m 770 $PKG/var/run/nut
-
-# Install shutdown helper files
-install -m 755 $CWD/nut_restart_udev $CWD/nut_kill_inverter $PKG/usr/libexec/nut
-
-# Install documentation
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -ar docs \
- AUTHORS COPYING ChangeLog INSTALL MAINTAINERS NEWS README UPGRADING \
- $PKG/usr/doc/$PRGNAM-$VERSION
-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
diff --git a/system/nut/nut.info b/system/nut/nut.info
deleted file mode 100644
index b6e4db3b0c..0000000000
--- a/system/nut/nut.info
+++ /dev/null
@@ -1,10 +0,0 @@
-PRGNAM="nut"
-VERSION="2.7.4"
-HOMEPAGE="http://www.networkupstools.org/"
-DOWNLOAD="http://www.networkupstools.org/source/2.7/nut-2.7.4.tar.gz"
-MD5SUM="3ba53656933d7471f95140b32a5b8d5c"
-DOWNLOAD_x86_64=""
-MD5SUM_x86_64=""
-REQUIRES=""
-MAINTAINER="V'yacheslav Stetskevych"
-EMAIL="slava18@gmail.com"
diff --git a/system/nut/nut_kill_inverter b/system/nut/nut_kill_inverter
deleted file mode 100644
index 251a047df7..0000000000
--- a/system/nut/nut_kill_inverter
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-# This file is part of Network UPS Tools build for Slackware Linux.
-# It should be sourced in /etc/rc.d/rc.0 as part of the poweroff sequence.
-# Here, we signal the UPS to shut off the power.
-# Reference: http://www.mail-archive.com/nut-upsdev@lists.alioth.debian.org/msg01099.html
-# To be sourced after the genpowerd block and before the actual halt.
-
-if [ -f /etc/killpower ]; then
- echo "----------------------------------------Shutting down UPS power!"
- /etc/rc.d/rc.ups shutdown
- sleep 40
- echo "The UPS was not shut off properly, or the power came back in the"
- echo "middle of the shutdown process, or USB communication failed."
- sleep 10
-fi
diff --git a/system/nut/nut_restart_udev b/system/nut/nut_restart_udev
deleted file mode 100644
index d289c0f87a..0000000000
--- a/system/nut/nut_restart_udev
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-# This file is part of Network UPS Tools build for Slackware Linux.
-# It should be sourced in /etc/rc.d/rc.0 as part of the poweroff sequence.
-# Here, we restart udev so that the system is able to kill off the UPS inverter.
-# Reference: http://www.mail-archive.com/nut-upsdev@lists.alioth.debian.org/msg01099.html
-# To be sourced after the rootfs has been remounted read-only.
-
-if [ -f /etc/killpower ]; then
-echo "Restarting udev to be able to shut the UPS inverter off..."
-/etc/rc.d/rc.udev start
-sleep 10
-fi
diff --git a/system/nut/rc.ups b/system/nut/rc.ups
deleted file mode 100644
index 37916951bd..0000000000
--- a/system/nut/rc.ups
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/bin/sh
-# Slackware startup script for Network UPS Tools
-# Copyright 2010 V'yacheslav Stetskevych
-
-# UPS drivers live here
-DRIVERPATH=/usr/libexec/nut
-export PATH=$DRIVERPATH:$PATH
-
-POWERDOWNFLAG=/etc/killpower
-NUTUSER=nut
-NUTGROUP=nut
-UPSDCONF=/etc/ups/upsd.conf
-UPSCONF=/etc/ups/ups.conf
-UPSMONCONF=/etc/ups/upsmon.conf
-
-# Check for existense of the nut user and group
-# For slackbuilds.org, assigned nut uid/gid are 218/218.
-# See http://slackbuilds.org/uid_gid.txt
-if ! grep -q ^$NUTGROUP: /etc/group; then
- echo " You must have a \"$NUTGROUP\" group to run this script."
- echo " # groupadd -g 218 $NUTGROUP"
- exit 1
-elif ! grep -q ^$NUTUSER: /etc/passwd; then
- echo " You must have a \"$NUTUSER\" user to run this script."
- echo " # useradd -u 218 -g $NUTGROUP -s /bin/false $NUTUSER"
- exit 1
-fi
-
-start_driver() {
- upsdrvctl -u $NUTUSER start || exit 1
-}
-
-start_upsd() {
- upsd -u $NUTUSER || exit 1
-}
-
-start_upsmon() {
- upsmon -u $NUTUSER || exit 1
-}
-
-stop() {
- echo "Stopping the UPS services... "
- if pgrep upsd 2>&1 >/dev/null; then
- upsd -c stop; fi
- if pgrep upsmon 2>&1 >/dev/null; then
- upsmon -c stop; fi
- upsdrvctl 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
- ;;
- start_upsmon) # starts upsmon only (for a ups client box)
- start_upsmon
- ;;
- stop) # stops all UPS-related daemons
- stop
- ;;
- shutdown) # shuts down the UPS
- echo "Killing inverter..."
- upsdrvctl shutdown
- ;;
- reload)
- echo "Reloading config files..."
- upsd -c reload
- upsmon -c reload
- ;;
- *)
- echo "Usage: $0 {start|start_upsmon|stop|shutdown|reload}"
-esac
diff --git a/system/nut/slack-desc b/system/nut/slack-desc
deleted file mode 100644
index c4c8a99c23..0000000000
--- a/system/nut/slack-desc
+++ /dev/null
@@ -1,19 +0,0 @@
-# HOW TO EDIT THIS FILE:
-# The "handy ruler" below makes it easier to edit a package description.
-# Line up the first '|' above the ':' following the base package name, and
-# the '|' on the right side marks the last column you can put a character in.
-# You must make exactly 11 lines for the formatting to be correct. It's also
-# customary to leave one space after the ':' except on otherwise blank lines.
-
- |-----handy-ruler------------------------------------------------------|
-nut: nut (Network UPS Tools)
-nut:
-nut: The Network UPS Tools is a collection of programs which provide a
-nut: common interface for monitoring and administering UPS hardware.
-nut: It uses a layered apporoach to connect all the components. Drivers
-nut: are provided for a wide assortment of equipment. The primary goal of
-nut: the NUT project is to provide reliable monitoring of UPS hardware
-nut: and ensure safe shutdowns of the systems which are connected.
-nut:
-nut: Homepage: http://www.networkupstools.org
-nut: