1
0
forked from ports/contrib

nut: 2.2.2 -> 2.4.3

This commit is contained in:
Danny Rawlins 2010-06-30 22:53:20 +10:00
parent f07fab88ce
commit e00270dd1c
6 changed files with 111 additions and 65 deletions

View File

@ -1,53 +1,58 @@
drwxr-xr-x root/root etc/
drwxr-xr-x root/root etc/hotplug/
drwxr-xr-x root/root etc/hotplug/usb/
-rw-r--r-- root/root etc/hotplug/usb/libhid.usermap
-rwxr-xr-x root/root etc/hotplug/usb/libhidups
drwxr-xr-x root/root etc/nut/
-rw-r--r-- root/root etc/nut/ups.conf.sample
-rw-r--r-- root/root etc/nut/upsd.conf.sample
-rw-r--r-- root/root etc/nut/upsd.users.sample
-rw-r--r-- root/root etc/nut/upsmon.conf.sample
-rw-r--r-- root/root etc/nut/upssched.conf.sample
-rw-r--r-- root/nut etc/nut/nut.conf.sample
-rw-r--r-- root/nut etc/nut/ups.conf.sample
-rw-r--r-- root/nut etc/nut/upsd.conf.sample
-rw-r--r-- root/nut etc/nut/upsd.users.sample
-rw-r--r-- root/nut etc/nut/upsmon.conf.sample
-rw-r--r-- root/nut etc/nut/upssched.conf.sample
drwxr-xr-x root/root etc/rc.d/
-rwxr-xr-x root/root etc/rc.d/upsd
-rwxr-xr-- root/root etc/rc.d/upsd
drwxr-xr-x root/root etc/udev/
drwxr-xr-x root/root etc/udev/rules.d/
-rw-r--r-- root/root etc/udev/rules.d/52_nut-usbups.rules
drwxr-xr-x root/root lib/
drwxr-xr-x root/root lib/udev/
drwxr-xr-x root/root lib/udev/rules.d/
-rw-r--r-- root/root lib/udev/rules.d/52-nut-usbups.rules
drwxr-xr-x root/root usr/
drwxr-xr-x root/root usr/bin/
-rwxr-xr-x root/root usr/bin/al175
-rwxr-xr-x root/root usr/bin/apcsmart
-rwxr-xr-x root/root usr/bin/bcmxcp
-rwxr-xr-x root/root usr/bin/bcmxcp_usb
-rwxr-xr-x root/root usr/bin/belkin
-rwxr-xr-x root/root usr/bin/belkinunv
-rwxr-xr-x root/root usr/bin/bestfcom
-rwxr-xr-x root/root usr/bin/bestfortress
-rwxr-xr-x root/root usr/bin/bestuferrups
-rwxr-xr-x root/root usr/bin/bestups
-rwxr-xr-x root/root usr/bin/cpsups
-rwxr-xr-x root/root usr/bin/cyberpower
-rwxr-xr-x root/root usr/bin/blazer_ser
-rwxr-xr-x root/root usr/bin/blazer_usb
-rwxr-xr-x root/root usr/bin/clone
-rwxr-xr-x root/root usr/bin/clone-outlet
-rwxr-xr-x root/root usr/bin/dummy-ups
-rwxr-xr-x root/root usr/bin/energizerups
-rwxr-xr-x root/root usr/bin/etapro
-rwxr-xr-x root/root usr/bin/everups
-rwxr-xr-x root/root usr/bin/gamatronic
-rwxr-xr-x root/root usr/bin/genericups
-rwxr-xr-x root/root usr/bin/isbmex
-rwxr-xr-x root/root usr/bin/ivtscd
-rwxr-xr-x root/root usr/bin/liebert
-rwxr-xr-x root/root usr/bin/liebertgxt2
-rwxr-xr-x root/root usr/bin/masterguard
-rwxr-xr-x root/root usr/bin/megatec
-rwxr-xr-x root/root usr/bin/megatec_usb
-rwxr-xr-x root/root usr/bin/metasys
-rwxr-xr-x root/root usr/bin/mge-shut
-rwxr-xr-x root/root usr/bin/mge-utalk
-rwxr-xr-x root/root usr/bin/microdowell
-rwxr-xr-x root/root usr/bin/netxml-ups
-rwxr-xr-x root/root usr/bin/newmge-shut
-rwxr-xr-x root/root usr/bin/nitram
-rwxr-xr-x root/root usr/bin/oneac
-rwxr-xr-x root/root usr/bin/optiups
-rwxr-xr-x root/root usr/bin/powercom
-rwxr-xr-x root/root usr/bin/powerpanel
-rwxr-xr-x root/root usr/bin/rhino
-rwxr-xr-x root/root usr/bin/richcomm_usb
-rwxr-xr-x root/root usr/bin/safenet
-rwxr-xr-x root/root usr/bin/skel
-rwxr-xr-x root/root usr/bin/solis
@ -72,44 +77,48 @@ drwxr-xr-x root/root usr/man/
drwxr-xr-x root/root usr/man/man1/
drwxr-xr-x root/root usr/man/man3/
drwxr-xr-x root/root usr/man/man5/
-rw-r--r-- root/root usr/man/man5/nut.conf.5.gz
-rw-r--r-- root/root usr/man/man5/ups.conf.5.gz
-rw-r--r-- root/root usr/man/man5/upsd.conf.5.gz
-rw-r--r-- root/root usr/man/man5/upsd.users.5.gz
-rw-r--r-- root/root usr/man/man5/upsmon.conf.5.gz
-rw-r--r-- root/root usr/man/man5/upssched.conf.5.gz
drwxr-xr-x root/root usr/man/man8/
-rw-r--r-- root/root usr/man/man8/al175.8.gz
-rw-r--r-- root/root usr/man/man8/apcsmart.8.gz
-rw-r--r-- root/root usr/man/man8/bcmxcp.8.gz
-rw-r--r-- root/root usr/man/man8/bcmxcp_usb.8.gz
-rw-r--r-- root/root usr/man/man8/belkin.8.gz
-rw-r--r-- root/root usr/man/man8/belkinunv.8.gz
-rw-r--r-- root/root usr/man/man8/bestfcom.8.gz
-rw-r--r-- root/root usr/man/man8/bestfortress.8.gz
-rw-r--r-- root/root usr/man/man8/bestuferrups.8.gz
-rw-r--r-- root/root usr/man/man8/bestups.8.gz
-rw-r--r-- root/root usr/man/man8/cpsups.8.gz
-rw-r--r-- root/root usr/man/man8/cyberpower.8.gz
-rw-r--r-- root/root usr/man/man8/blazer.8.gz
-rw-r--r-- root/root usr/man/man8/clone.8.gz
-rw-r--r-- root/root usr/man/man8/dummy-ups.8.gz
-rw-r--r-- root/root usr/man/man8/energizerups.8.gz
-rw-r--r-- root/root usr/man/man8/etapro.8.gz
-rw-r--r-- root/root usr/man/man8/everups.8.gz
-rw-r--r-- root/root usr/man/man8/gamatronic.8.gz
-rw-r--r-- root/root usr/man/man8/genericups.8.gz
-rw-r--r-- root/root usr/man/man8/isbmex.8.gz
-rw-r--r-- root/root usr/man/man8/ivtscd.8.gz
-rw-r--r-- root/root usr/man/man8/liebert.8.gz
-rw-r--r-- root/root usr/man/man8/liebertgxt2.8.gz
-rw-r--r-- root/root usr/man/man8/masterguard.8.gz
-rw-r--r-- root/root usr/man/man8/megatec.8.gz
-rw-r--r-- root/root usr/man/man8/megatec_usb.8.gz
-rw-r--r-- root/root usr/man/man8/metasys.8.gz
-rw-r--r-- root/root usr/man/man8/mge-shut.8.gz
-rw-r--r-- root/root usr/man/man8/mge-utalk.8.gz
-rw-r--r-- root/root usr/man/man8/nitram.8.gz
-rw-r--r-- root/root usr/man/man8/microdowell.8.gz
-rw-r--r-- root/root usr/man/man8/netxml-ups.8.gz
-rw-r--r-- root/root usr/man/man8/nutupsdrv.8.gz
-rw-r--r-- root/root usr/man/man8/oneac.8.gz
-rw-r--r-- root/root usr/man/man8/optiups.8.gz
-rw-r--r-- root/root usr/man/man8/powercom.8.gz
-rw-r--r-- root/root usr/man/man8/powerpanel.8.gz
-rw-r--r-- root/root usr/man/man8/rhino.8.gz
-rw-r--r-- root/root usr/man/man8/richcomm_usb.8.gz
-rw-r--r-- root/root usr/man/man8/safenet.8.gz
-rw-r--r-- root/root usr/man/man8/solis.8.gz
-rw-r--r-- root/root usr/man/man8/tripplite.8.gz

View File

@ -1,2 +1,2 @@
677a84a83e9be7bc93610413ee696375 nut-2.2.2.tar.gz
a59134dfe9c5558a615bf7237564de43 upsd
6f893b61b07915e7a139324fa3f79121 nut-2.4.3.tar.gz
f470b060555f65af23e5053a97efeb74 upsd

View File

@ -1,39 +1,41 @@
# Description: Network UPS Tools. Monitor of UPS hardware.
# URL: http://www.networkupstools.org/
# Maintainer: Victor Martinez, pitillo at ono dot com
# Maintainer: Danny Rawlins, monster dot romster at gmail dot com
# Packager: Victor Martinez, pitillo at ono dot com
# Depends on:
name=nut
version=2.2.2
version=2.4.3
release=1
source=(http://www.networkupstools.org/source/2.2/$name-$version.tar.gz \
source=(http://www.networkupstools.org/source/${version%.*}/$name-$version.tar.gz
upsd)
build() {
cd $name-$version
./configure --prefix=/usr \
--disable-nls \
--with-user=nut \
./configure \
--prefix=/usr \
--with-user=root \
--with-group=nut \
--with-usb \
--with-lib \
--mandir=/usr/man \
--sysconfdir=/etc/$name \
--sbindir=/usr/sbin/ \
--datadir=/usr/share/$name \
--localstatedir=/var/$name
make
make usb
make DESTDIR=$PKG install
make DESTDIR=$PKG/etc/nut/ install-conf
rm -r $PKG/etc/nut/etc/
rmdir $PKG/usr/{lib/pkgconfig,include}
rmdir \
$PKG/usr/lib/pkgconfig \
$PKG/usr/include \
$PKG/usr/cgi-bin \
$PKG/usr/html
#if you dont want config templates uncomment the next line
#rm $PKG/etc/nut/*
mkdir -p $PKG/etc/udev/rules.d/
install -D -m 755 $SRC/upsd $PKG/etc/rc.d/upsd
rmdir $PKG/usr/cgi-bin $PKG/usr/html
mkdir -p $PKG/var/state/ups
chmod 0770 $PKG/var/state/ups
chown root:nut $PKG/var/state/ups
find $PKG/etc/nut -type f -print0 | xargs -0 chown root:nut
install -d $PKG/etc/udev/rules.d
install -d -m 0770 -o root -g nut $PKG/var/state/ups
install -D -m 0754 $SRC/upsd $PKG/etc/rc.d/upsd
}

View File

@ -19,5 +19,3 @@ chown root:nut upsd.conf upsd.users
chmod 0640 upsd.conf upsd.users
- Remember to use man to setup nut.
Víctor Martínez <pitillo at ono dot com>

45
nut/pre-install Normal file → Executable file
View File

@ -1,5 +1,42 @@
#!/bin/bash
#!/bin/sh
# Created by Danny Rawlins, monster dot romster at gmail dot com
GROUP=nut
USER=root
USER_COMMENT="Network UPS Tools"
USER_HOME=/var/empty
USER_SHELL=/bin/sh
if [ ! $(id -u) = 0 ]; then
echo "ERROR: you need to be root to run this!"
exit 1
fi
if [ $GROUP ]; then
if ! getent group $GROUP > /dev/null; then
/usr/sbin/groupadd $GROUP
if [ $? -eq 0 ]; then
echo "Group: $GROUP added."
fi
else
echo "Group: $GROUP already exists! Skipping."
fi
fi
if ! getent passwd $USER > /dev/null; then
/usr/sbin/useradd -g $GROUP -c "$USER_COMMENT" -d $USER_HOME -s $USER_SHELL $USER
if [ $? -eq 0 ]; then
echo "User: $USER added."
/usr/bin/passwd -l $USER > /dev/null
if [ $? -eq 0 ]; then
echo "Locked: $USER account."
fi
else
echo "ERROR: unable to lock $USER account."
/usr/sbin/userdel $USER
fi
else
echo "User: $USER already exists! Skipping."
fi
getent group nut || groupadd nut
getent passwd nut || useradd -m -g nut -d /var/empty -s /bin/false nut
passwd -l nut

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# /etc/rc.d/upsd: start/stop ups daemons
# /etc/rc.d/upsd: start/stop ups daemon
#
case "$1" in
@ -17,7 +17,7 @@ case "$1" in
$0 start
;;
*)
echo "Usage: $0 [start|stop]"
echo "Usage: $0 [start|stop|restart]"
exit 1
esac