summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Herbert <stuart@gentoo.org>2004-08-15 15:19:10 +0000
committerStuart Herbert <stuart@gentoo.org>2004-08-15 15:19:10 +0000
commit4911765fd1b25a2f5aecad386d1ddf060e80e2b5 (patch)
treedd7b3369e1d258134d64b2a8acacb74536b8dbca /www-apps/nut
parentMoved from net-www/mythweb to www-apps/mythweb (diff)
downloadgentoo-2-4911765fd1b25a2f5aecad386d1ddf060e80e2b5.tar.gz
gentoo-2-4911765fd1b25a2f5aecad386d1ddf060e80e2b5.tar.bz2
gentoo-2-4911765fd1b25a2f5aecad386d1ddf060e80e2b5.zip
Moved from net-misc/nut to www-apps/nut.
Diffstat (limited to 'www-apps/nut')
-rw-r--r--www-apps/nut/ChangeLog163
-rw-r--r--www-apps/nut/Manifest15
-rw-r--r--www-apps/nut/files/digest-nut-1.2.21
-rw-r--r--www-apps/nut/files/digest-nut-1.4.11
-rw-r--r--www-apps/nut/files/digest-nut-1.5.121
-rw-r--r--www-apps/nut/files/digest-nut-2.0.01
-rw-r--r--www-apps/nut/files/upsd-init25
-rw-r--r--www-apps/nut/files/upsd.rc626
-rw-r--r--www-apps/nut/files/upsdrv.rc621
-rw-r--r--www-apps/nut/files/upsmon-init20
-rw-r--r--www-apps/nut/files/upsmon.rc620
-rw-r--r--www-apps/nut/metadata.xml8
-rw-r--r--www-apps/nut/nut-1.2.2.ebuild128
-rw-r--r--www-apps/nut/nut-1.4.1.ebuild91
-rw-r--r--www-apps/nut/nut-1.5.12.ebuild117
-rw-r--r--www-apps/nut/nut-2.0.0.ebuild123
16 files changed, 761 insertions, 0 deletions
diff --git a/www-apps/nut/ChangeLog b/www-apps/nut/ChangeLog
new file mode 100644
index 000000000000..a96ac6b7b393
--- /dev/null
+++ b/www-apps/nut/ChangeLog
@@ -0,0 +1,163 @@
+# ChangeLog for net-misc/nut
+# Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/www-apps/nut/ChangeLog,v 1.1 2004/08/15 15:19:10 stuart Exp $
+
+*nut-1.2.2 (15 Aug 2004)
+
+ 15 Aug 2004; Stuart Herbert <stuart@gentoo.org> +metadata.xml,
+ +files/upsd-init, +files/upsd.rc6, +files/upsdrv.rc6, +files/upsmon-init,
+ +files/upsmon.rc6, +nut-1.2.2.ebuild, +nut-1.4.1.ebuild, +nut-1.5.12.ebuild,
+ +nut-2.0.0.ebuild:
+ Moved from net-misc/nut to www-apps/nut.
+
+ 18 May 2004; Robin Johnson,,604-339-5621,604-298-8414 <robbat2@gentoo.org>
+ nut-2.0.0.ebuild:
+ stable now on x86. upgrade with care!
+
+ 26 Apr 2004; Aron Griffis <agriffis@gentoo.org> nut-1.4.1.ebuild,
+ nut-1.5.12.ebuild, nut-2.0.0.ebuild:
+ Add die following econf for bug 48950
+
+ 25 Apr 2004; Jon Hood <squinky86@gentoo.org> nut-1.4.1.ebuild,
+ nut-1.5.12.ebuild:
+ added "die"
+
+ 07 Apr 2004; Robin Johnson,,604-339-5621,604-298-8414 <robbat2@gentoo.org>
+ nut-1.0.0.ebuild, nut-1.2.1-r1.ebuild, nut-1.2.1.ebuild, nut-1.2.2.ebuild,
+ nut-1.3.6.ebuild, nut-1.4.0-r3.ebuild, nut-1.4.0.ebuild, nut-1.5.1.ebuild,
+ nut-1.5.6-r2.ebuild, nut-1.5.7.ebuild, nut-1.5.8-r1.ebuild,
+ nut-1.5.8.ebuild:
+ remove a pile of old ebuilds, keeping just the stable heads of recent trees.
+
+*nut-2.0.0 (31 Mar 2004)
+
+ 31 Mar 2004; Robin H. Johnson <robbat2@gentoo.org> nut-2.0.0.ebuild,
+ files/upsmon.rc6:
+ fix bug #46079. add in new version 2.0.0 from upstream, bug #45928.
+
+ 15 Mar 2004; Max Kalika <max@gentoo.org> nut-1.4.1.ebuild:
+ Bump to stable x86.
+
+*nut-1.4.1 (08 Mar 2004)
+*nut-1.5.12 (08 Mar 2004)
+
+ 08 Mar 2004; Robin H. Johnson <robbat2@gentoo.org> files/upsd.rc6:
+ bug #42883, nut snmp-ups support. bug #42195, version bump. bug #43551, catch
+ nut problems with leftover pidfile.
+
+ 05 Dec 2003; Robin H. Johnson <robbat2@gentoo.org> nut-1.2.1-r1.ebuild,
+ nut-1.2.1.ebuild, nut-1.2.2.ebuild, nut-1.3.6.ebuild, nut-1.4.0.ebuild,
+ nut-1.5.1.ebuild:
+ fix chown . to : as per bug #35127
+
+*nut-1.5.8-r1 (23 Nov 2003)
+
+ 23 Nov 2003; Robin H. Johnson <robbat2@gentoo.org> nut-1.5.8-r1.ebuild:
+ fix bugs from #34174, partially based on submitted patch
+
+*nut-1.5.8 (20 Nov 2003)
+
+ 20 Nov 2003; Robin H. Johnson <robbat2@gentoo.org> nut-1.5.8.ebuild:
+ version bump
+
+*nut-1.5.7 (29 Oct 2003)
+*nut-1.5.6-r2 (29 Oct 2003)
+*nut-1.4.0-r3 (29 Oct 2003)
+
+ 29 Oct 2003; Max Kalika <max@gentoo.org> nut-1.4.0-r1.ebuild,
+ nut-1.4.0-r2.ebuild, nut-1.4.0-r3.ebuild, nut-1.5.6-r1.ebuild,
+ nut-1.5.6-r2.ebuild, nut-1.5.6.ebuild, nut-1.5.7.ebuild, files/upsd.rc6,
+ files/upsdrv.rc6, files/upsmon.rc6:
+ Bump to version 1.5.7. Cleanup Move drivers to /lib/nut and link control to
+ /sbin for halt.sh to work properly. Fix pid file handling in startup scripts.
+ Fixes all of bug 31665.
+
+ 21 Oct 2003; Max Kalika <max@gentoo.org> files/upsd.rc6:
+ Fix pid path.
+
+*nut-1.5.6-r1 (20 Oct 2003)
+*nut-1.4.0-r2 (20 Oct 2003)
+
+ 20 Oct 2003; Robin H. Johnson <robbat2@gentoo.org> nut-1.4.0-r2.ebuild,
+ nut-1.5.6-r1.ebuild, files/upsd.rc6, files/upsdrv.rc6, files/upsmon.rc6:
+ add seperate upsdrv init script, make sure it gets called properly, fixes bug
+ #31572
+
+*nut-1.5.6 (17 Oct 2003)
+
+ 17 Oct 2003; Preston A. Elder <prez@gentoo.org> nut-1.5.6.ebuild :
+ New development tree version.
+
+*nut-1.4.0-r1 (16 Oct 2003)
+
+ 16 Oct 2003; Max Kalika <max@gentoo.org> metadata.xml, nut-1.4.0-r1.ebuild,
+ files/upsd.rc6, files/upsmon.rc6:
+ Major cleanup.
+
+*nut-1.5.1 (10 Aug 2003)
+
+ 10 Aug 2003; Preston A. Elder <prez@gentoo.org> nut-1.5.1.ebuild :
+ New development tree version.
+
+*nut-1.4.0 (29 Jul 2003)
+
+ 29 Jul 2003; Robin Johnson <robbat2@gentoo.org> nut-1.4.0.ebuild:
+ Version bump as 1.4 is now the stable series.
+
+*nut-1.3.6 (09 May 2003)
+
+ 09 May 2003; Robin Johnson <robbat2@gentoo.org> nut-1.3.6.ebuild :
+ Added in apache2 support instead of just apache1.
+ Add this new version for the insane folk that want to try it out.
+ In unstable only.
+
+*nut-1.2.2 (20 Apr 2003)
+
+ 28 Apr 2003; Preston A. Elder <prez@gentoo.org> nut-1.2.2.ebuild :
+ Used better way to add cgi-bin depenancy, and unmasked.
+
+ 20 Apr 2003; Preston A. Elder <prez@gentoo.org> nut-1.2.2.ebuild :
+ New stable version
+
+*nut-1.2.1-r1 (24 Feb 2003)
+
+ 24 Feb 2003; Jared Hudson <jhhudso@gentoo.org> : Added hiddev driver support.
+ Used by several USB based UPSs.
+
+*nut-1.2.1 (27 Jan 2003)
+
+ 27 Jan 2003; Donny Davies <woodchip@gentoo.org> : New testing release.
+ Fixed SRC_URI, half-of #12947, (the other half is commited to rc-scripts
+ CVS). Fixed #10745. Thanks btowe@gbis.com, and
+ tdickenson@geminidataloggers.com.
+
+ 06 Dec 2002; Rodney Rees <manson@gentoo.org> : changed sparc ~sparc keywords
+
+*nut-1.0.0 (26 Aug 2002)
+
+ 12 Oct 2002; Donny Davies <woodchip@gentoo.org> nut-1.0.0.ebuild :
+ Added sparc sparc64 KEYWORDS. Old ebuilds have busted SRC_URI's.
+
+ 26 Aug 2002; Donny Davies <woodchip@gentoo.org> nut-1.0.0.ebuild :
+ Glorious timing; nut went 1.0 and as of baselayout-1.8.2, halt.sh
+ support is merged.
+
+*nut-0.50.1 (3 Aug 2002)
+
+ 3 Aug 2002; Donny Davies <woodchip@gentoo.org> nut-0.50.1.ebuild,
+ upsd-init, upsmon-init :
+ This release adds proper initscripts, the USE cgi-bin option
+ for building the web monitoring programs, and proper shutdown
+ sequence merged into the baselayout halt.sh shutdown script.
+ Pending release of a new baselayout, this package is masked.
+
+*nut-0.44.1-r1 (12 Apr 2002)
+
+ 11 Aug 2002; phoen][x <phoenix@gentoo.org> nut-0.44.1-r1.ebuild :
+ Fixed src_install() (This closes bug 5827)
+
+ 09 Jul 2002; phoen][x <phoenix@gentoo.org> nut-0.44.1-r1.ebuild :
+ Added KEYWORDS, LICENSE, SLOT.
+
+ 12 Apr 2002; Spider <spider@gentoo.org>
+ libpng update, remove RPEND tag, unnecessary. (or typo;)
diff --git a/www-apps/nut/Manifest b/www-apps/nut/Manifest
new file mode 100644
index 000000000000..c7175b7a0a66
--- /dev/null
+++ b/www-apps/nut/Manifest
@@ -0,0 +1,15 @@
+MD5 583c0bd5063220e87154229b1108ca59 nut-2.0.0.ebuild 3070
+MD5 1969a0f72b023c619b1facc92fd05337 nut-1.5.12.ebuild 3300
+MD5 1ad752545fa2e6e001fc1b9a9ce62d41 nut-1.4.1.ebuild 2312
+MD5 0977e8d4434dbb7846d542dbfc050949 nut-1.2.2.ebuild 3375
+MD5 d970f096e6d10b5bda32fdec691246af ChangeLog 5436
+MD5 91a159b983332d5ed0fb985cc1fe1b80 metadata.xml 330
+MD5 ab96c8181bf3780dae5e3377987b05c2 files/digest-nut-1.2.2 61
+MD5 af157fac0a88e11c79527d952fce75ec files/digest-nut-1.4.1 61
+MD5 891b50cff5827a4e77573ee8f2f40e48 files/digest-nut-2.0.0 61
+MD5 3991086b9dd6c95fe463cb21ead5e0bd files/upsmon-init 474
+MD5 7b76eef352ad93b1369096360bbc3a11 files/digest-nut-1.5.12 62
+MD5 3a425305da409ff659235b4d219f8821 files/upsd.rc6 587
+MD5 59a02122c76aa6364c99e032db372c41 files/upsdrv.rc6 479
+MD5 2019e9c320d038dd72aba624016b0ae1 files/upsmon.rc6 473
+MD5 45f63e627825348055c082a0a94c55fd files/upsd-init 579
diff --git a/www-apps/nut/files/digest-nut-1.2.2 b/www-apps/nut/files/digest-nut-1.2.2
new file mode 100644
index 000000000000..648c7b4538d2
--- /dev/null
+++ b/www-apps/nut/files/digest-nut-1.2.2
@@ -0,0 +1 @@
+MD5 77523931f32fc1dffcfbe2f8de37df15 nut-1.2.2.tar.gz 459992
diff --git a/www-apps/nut/files/digest-nut-1.4.1 b/www-apps/nut/files/digest-nut-1.4.1
new file mode 100644
index 000000000000..ab239bb29e00
--- /dev/null
+++ b/www-apps/nut/files/digest-nut-1.4.1
@@ -0,0 +1 @@
+MD5 ae91ea3d643d7665bda0a95ce62957a0 nut-1.4.1.tar.gz 550238
diff --git a/www-apps/nut/files/digest-nut-1.5.12 b/www-apps/nut/files/digest-nut-1.5.12
new file mode 100644
index 000000000000..0e168a873a54
--- /dev/null
+++ b/www-apps/nut/files/digest-nut-1.5.12
@@ -0,0 +1 @@
+MD5 26eefc05469d500130b84ab9bc2aa738 nut-1.5.12.tar.gz 510378
diff --git a/www-apps/nut/files/digest-nut-2.0.0 b/www-apps/nut/files/digest-nut-2.0.0
new file mode 100644
index 000000000000..21263cf7a3cc
--- /dev/null
+++ b/www-apps/nut/files/digest-nut-2.0.0
@@ -0,0 +1 @@
+MD5 84649ad95809737b5ffc19efdd9e9952 nut-2.0.0.tar.gz 530492
diff --git a/www-apps/nut/files/upsd-init b/www-apps/nut/files/upsd-init
new file mode 100644
index 000000000000..d76f19c9e424
--- /dev/null
+++ b/www-apps/nut/files/upsd-init
@@ -0,0 +1,25 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-apps/nut/files/upsd-init,v 1.1 2004/08/15 15:19:10 stuart Exp $
+
+depend() {
+ need net
+ before upsmon
+}
+
+start() {
+ ebegin "Starting upsd"
+ /sbin/upsdrvctl start
+ start-stop-daemon --start --quiet --startas /usr/sbin/upsd \
+ --pidfile=/var/state/nut/upsd.pid
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping upsd"
+ start-stop-daemon --stop --quiet --pidfile=/var/state/nut/upsd.pid
+ rc=$?
+ /sbin/upsdrvctl stop
+ eend $rc
+}
diff --git a/www-apps/nut/files/upsd.rc6 b/www-apps/nut/files/upsd.rc6
new file mode 100644
index 000000000000..1f2f1330abf1
--- /dev/null
+++ b/www-apps/nut/files/upsd.rc6
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-apps/nut/files/upsd.rc6,v 1.1 2004/08/15 15:19:10 stuart Exp $
+
+depend() {
+ need net upsdrv
+ before upsmon
+}
+
+start() {
+ ebegin "Starting upsd"
+ # clean up first
+ pkill -u root -x upsd
+ sleep 1s
+ rm -f /var/state/nut/upsd.pid
+ # now start up
+ start-stop-daemon --start --quiet --exec /usr/sbin/upsd
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping upsd"
+ start-stop-daemon --stop --quiet --pidfile /var/lib/nut/upsd.pid
+ eend $?
+}
diff --git a/www-apps/nut/files/upsdrv.rc6 b/www-apps/nut/files/upsdrv.rc6
new file mode 100644
index 000000000000..2da25447b8f7
--- /dev/null
+++ b/www-apps/nut/files/upsdrv.rc6
@@ -0,0 +1,21 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-apps/nut/files/upsdrv.rc6,v 1.1 2004/08/15 15:19:10 stuart Exp $
+
+depend() {
+ need net
+ before upsd
+}
+
+start() {
+ ebegin "Starting UPS drivers"
+ /sbin/upsdrvctl start
+ eend $? "Failed to start UPS drivers!"
+}
+
+stop() {
+ ebegin "Stopping UPS drivers"
+ /sbin/upsdrvctl stop
+ eend $? "Failed to stop UPS drivers!"
+}
diff --git a/www-apps/nut/files/upsmon-init b/www-apps/nut/files/upsmon-init
new file mode 100644
index 000000000000..a8db61a945b4
--- /dev/null
+++ b/www-apps/nut/files/upsmon-init
@@ -0,0 +1,20 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-apps/nut/files/upsmon-init,v 1.1 2004/08/15 15:19:10 stuart Exp $
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting upsmon"
+ start-stop-daemon --start --quiet --exec /usr/sbin/upsmon
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping upsmon"
+ start-stop-daemon --stop --quiet --pidfile=/var/run/upsmon.pid
+ eend $?
+}
diff --git a/www-apps/nut/files/upsmon.rc6 b/www-apps/nut/files/upsmon.rc6
new file mode 100644
index 000000000000..8b89dc0ad714
--- /dev/null
+++ b/www-apps/nut/files/upsmon.rc6
@@ -0,0 +1,20 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-apps/nut/files/upsmon.rc6,v 1.1 2004/08/15 15:19:10 stuart Exp $
+
+depend() {
+ need net
+}
+
+start() {
+ ebegin "Starting upsmon"
+ start-stop-daemon --start --quiet --exec /usr/sbin/upsmon
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping upsmon"
+ start-stop-daemon --stop --quiet --pidfile /var/run/upsmon.pid
+ eend $?
+}
diff --git a/www-apps/nut/metadata.xml b/www-apps/nut/metadata.xml
new file mode 100644
index 000000000000..8cd3f6b2face
--- /dev/null
+++ b/www-apps/nut/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>no-herd</herd>
+<maintainer><email>robbat2@gentoo.org</email></maintainer>
+<maintainer><email>prez@gentoo.org</email></maintainer>
+<maintainer><email>max@gentoo.org</email></maintainer>
+</pkgmetadata>
diff --git a/www-apps/nut/nut-1.2.2.ebuild b/www-apps/nut/nut-1.2.2.ebuild
new file mode 100644
index 000000000000..2957a2b84855
--- /dev/null
+++ b/www-apps/nut/nut-1.2.2.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-apps/nut/nut-1.2.2.ebuild,v 1.1 2004/08/15 15:19:10 stuart Exp $
+
+DESCRIPTION="Network-UPS Tools"
+HOMEPAGE="http://www.exploits.org/nut/"
+SRC_URI="http://www.exploits.org/nut/release/${PV%.*}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="x86 sparc"
+IUSE=""
+
+DEPEND=""
+RDEPEND=">=sys-apps/baselayout-1.8.2"
+
+APACHE=""
+function setapache() {
+ APACHE="`which apache 2>/dev/null`"
+ if [ -z "${APACHE}" -a -x /usr/sbin/apache ]; then
+ APACHE=/usr/sbin/apache
+ fi
+}
+
+if [ -n "${APACHE}" ]; then
+ DEPEND="${DEPEND} =sys-libs/zlib-1* =media-libs/gd-1* =media-libs/libpng-1.2*"
+ RDEPEND="${RDEPEND} net-www/apache"
+fi
+RDEPEND="${RDEPEND} ${DEPEND}"
+DEPEND="$DEPEND >=sys-devel/autoconf-2.58"
+
+src_unpack() {
+ unpack ${A} || die
+ cd ${S} || die
+ cp configure.in configure.in.orig
+ sed -e "s:GD_LIBS.*=.*-L/usr/X11R6/lib \(.*\) -lXpm -lX11:GD_LIBS=\"\1:" \
+ configure.in.orig >configure.in
+ WANT_AUTOCONF=2.5 autoconf || die
+}
+
+src_compile() {
+ local myconf
+ setapache
+ [ -n "${APACHE}" ] && myconf="--with-cgi --with-cgipath=/home/httpd/cgi-bin"
+ [ -n "${APACHE}" ] || myconf="--without-cgi"
+
+ #default is to build all drivers; but the following is common:
+ #--with-drivers=apcsmart,hidups
+ ./configure \
+ --prefix=/usr \
+ --with-user=nut \
+ --with-group=nut \
+ --with-port=3493 \
+ --with-drvpath=/sbin \
+ --sysconfdir=/etc/nut \
+ --mandir=/usr/share/man \
+ --with-pidpath=/var/run \
+ --with-logfacility=LOG_DAEMON \
+ --with-statepath=/var/state/nut \
+ --with-altpidpath=/var/state/nut \
+ --with-linux-hiddev \
+ --host=${CHOST} ${myconf} || die
+
+ cp ${S}/drivers/Makefile ${S}/drivers/Makefile.orig
+ sed -e "s:= bestups:= hidups bestups:" ${S}/drivers/Makefile.orig \
+ > ${S}/drivers/Makefile
+ cp ${S}/man/Makefile ${S}/man/Makefile.orig
+ sed -e "s:= powercom.8:= hidups.8 powercom.8:" \
+ ${S}/man/Makefile.orig > ${S}/man/Makefile
+
+ emake || die
+
+ if [ -n "${APACHE}" ]
+ then
+ emake cgi || die
+ fi
+}
+
+src_install() {
+ setapache
+ # Makefile: user/group nut might not exist until after
+ # pkg_preinst() runs; so use root for now, and fix it
+ # up in pkg_postinst().
+ make DESTDIR=${D} RUNUID=root RUNGID=root install || die
+
+ if [ -n "${APACHE}" ]
+ then
+ make DESTDIR=${D} install-cgi || die
+ fi
+ # see above note...
+ rm -rf ${D}/var/state/nut
+
+ dodoc CHANGES COPYING CREDITS INSTALL NEWS README \
+ UPGRADING docs/{FAQ,*.txt,driver.list}
+ docinto cables ; dodoc docs/cables/*
+ docinto drivers ; dodoc docs/drivers/*
+
+ # clean up /etc/nut/*.sample files
+ cd ${D}/etc/nut
+ for i in *.sample
+ do
+ mv $i ${i/.sample/}
+ done
+
+ exeinto /etc/init.d
+ newexe ${FILESDIR}/upsd-init upsd
+ newexe ${FILESDIR}/upsmon-init upsmon
+}
+
+pkg_preinst() {
+ if ! groupmod nut ; then
+ groupadd -g 84 nut || die "problem adding group nut"
+ fi
+
+ # usermod returns 2 on user-exists-but-no-flags-given
+ usermod nut &>/dev/null
+ if [ $? != 2 ] ; then
+ useradd -u 84 -g nut -s /bin/false -c "nut" \
+ -d /var/state/nut nut || die "problem adding user nut"
+ fi
+}
+
+pkg_postinst() {
+ install -m0700 -o nut -g nut -d ${ROOT}/var/state/nut
+ chown root:nut ${ROOT}/etc/nut/{upsd.conf,upsd.users,upsmon.conf}
+ chmod 640 ${ROOT}/etc/nut/{upsd.conf,upsd.users,upsmon.conf}
+ ewarn "Dont forget to merge any changes in /etc/init.d/._cfgXXXX_halt.sh"
+}
diff --git a/www-apps/nut/nut-1.4.1.ebuild b/www-apps/nut/nut-1.4.1.ebuild
new file mode 100644
index 000000000000..5182498d8415
--- /dev/null
+++ b/www-apps/nut/nut-1.4.1.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-apps/nut/nut-1.4.1.ebuild,v 1.1 2004/08/15 15:19:10 stuart Exp $
+
+DESCRIPTION="Network-UPS Tools."
+HOMEPAGE="http://www.networkupstools.org/"
+SRC_URI="mirror://nut/source/${PV%.*}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="x86 ~sparc"
+IUSE="cgi"
+
+RDEPEND="cgi? ( =media-libs/gd-1* )"
+DEPEND="$RDEPEND
+ >=sys-apps/sed-4
+ >=sys-devel/autoconf-2.58"
+
+src_unpack() {
+ unpack ${A} && cd "${S}"
+
+ sed -e "s:GD_LIBS.*=.*-L/usr/X11R6/lib \(.*\) -lXpm -lX11:GD_LIBS=\"\1:" \
+ -i configure.in || die "sed failed"
+
+ ebegin "Recreating configure"
+ WANT_AUTOCONF=2.5 autoconf || die "autoconf failed"
+ eend $?
+}
+
+src_compile() {
+ local myconf
+ myconf="${myconf} `use_with cgi` `use_with cgi cgipath /usr/share/nut`"
+
+ econf \
+ --with-user=nut \
+ --with-group=nut \
+ --with-drvpath=/lib/nut \
+ --sysconfdir=/etc/nut \
+ --with-logfacility=LOG_DAEMON \
+ --with-statepath=/var/lib/nut \
+ --with-linux-hiddev \
+ ${myconf} || die "econf failed"
+
+ sed -e "s:= bestups:= hidups bestups:" \
+ -i drivers/Makefile || die "sed failed"
+ sed -e "s:= powercom.8:= hidups.8 powercom.8:" \
+ -i man/Makefile || die "sed failed"
+
+ emake || die "compile problem"
+
+ if use cgi ; then
+ emake cgi || die "compile cgi problem"
+ fi
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die "make install failed"
+
+ dodir /sbin
+ dosym /lib/nut/upsdrvctl /sbin/upsdrvctl
+
+ for i in "${D}"/etc/nut/*.sample ; do
+ mv "${i}" "${i/.sample/}"
+ done
+
+ if use cgi ; then
+ make DESTDIR="${D}" install-cgi || die "make install-cgi failed"
+ einfo "CGI monitoring scripts are installed in /usr/share/nut,"
+ einfo "copy them to your web server's ScriptPath to activate."
+ fi
+
+ dodoc CHANGES COPYING CREDITS INSTALL MAINTAINERS NEWS README UPGRADING \
+ docs/{FAQ,*.txt,driver.list}
+
+ docinto cables
+ dodoc docs/cables/*
+
+ exeinto /etc/init.d
+ newexe "${FILESDIR}/upsd.rc6" upsd
+ newexe "${FILESDIR}/upsdrv.rc6" upsdrv
+ newexe "${FILESDIR}/upsmon.rc6" upsmon
+
+ keepdir /var/lib/nut
+}
+
+pkg_postinst() {
+ chown nut:nut ${ROOT}/var/lib/nut
+ chmod 0700 ${ROOT}/var/lib/nut
+ chown root:nut ${ROOT}/etc/nut/{upsd.conf,upsd.users,upsmon.conf}
+ chmod 0640 ${ROOT}/etc/nut/{upsd.conf,upsd.users,upsmon.conf}
+}
diff --git a/www-apps/nut/nut-1.5.12.ebuild b/www-apps/nut/nut-1.5.12.ebuild
new file mode 100644
index 000000000000..0ddaba42e1e6
--- /dev/null
+++ b/www-apps/nut/nut-1.5.12.ebuild
@@ -0,0 +1,117 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-apps/nut/nut-1.5.12.ebuild,v 1.1 2004/08/15 15:19:10 stuart Exp $
+
+inherit fixheadtails
+
+DESCRIPTION="Network-UPS Tools"
+HOMEPAGE="http://www.networkupstools.org/"
+SRC_URI="mirror://nut/source/${PV%.*}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~sparc"
+IUSE="cgi snmp"
+
+RDEPEND="cgi? ( =media-libs/gd-1* )
+ snmp? ( virtual/snmp )"
+DEPEND="$RDEPEND
+ >=sys-apps/sed-4
+ >=sys-devel/autoconf-2.58"
+
+src_unpack() {
+ unpack ${A} && cd "${S}"
+
+ sed -e "s/install: install-dirs/install: install-dirs install-conf/" \
+ -i Makefile.in || die "sed failed"
+
+ ht_fix_file configure.in config.guess
+
+ sed -e "s:GD_LIBS.*=.*-L/usr/X11R6/lib \(.*\) -lXpm -lX11:GD_LIBS=\"\1:" \
+ -i configure.in || die "sed failed"
+
+ ebegin "Recreating configure"
+ WANT_AUTOCONF=2.5 autoconf || die "autoconf failed"
+ eend $?
+}
+
+src_compile() {
+ local myconf
+ myconf="${myconf} `use_with cgi` `use_with cgi cgipath /usr/share/nut`"
+ if [ -z "${NUT_DRIVERS}" ]; then
+ NUT_DRIVERS="${NUT_DRIVERS} bestups fentonups apcsmart everups belkin masterguard \
+ powercom cyberpower tripplite victronups genericups mge-utalk bestuferrups \
+ isbmex etapro liebert sms esupssmart tripplitesu blazer safenet belkinunv \
+ oneac ippon cyberpower1100"
+ if use snmp; then
+ NUT_DRIVERS="${NUT_DRIVERS} snmp-ups"
+ fi
+ fi
+ NUT_DRIVERS="`echo ${NUT_DRIVERS} | xargs`"
+ myconf="${myconf} --with-drivers=${NUT_DRIVERS// /,}"
+
+ econf \
+ --with-user=nut \
+ --with-group=nut \
+ --with-drvpath=/lib/nut \
+ --sysconfdir=/etc/nut \
+ --with-logfacility=LOG_DAEMON \
+ --with-statepath=/var/lib/nut \
+ --with-linux-hiddev \
+ ${myconf} || die "econf failed"
+
+ sed -e "s:= bestups:= hidups bestups:" \
+ -i drivers/Makefile || die "sed failed"
+ sed -e "s:= powercom.8:= hidups.8 powercom.8:" \
+ -i man/Makefile || die "sed failed"
+
+ emake || die "compile problem"
+
+ if use cgi; then
+ emake cgi || die "compile cgi problem"
+ fi
+}
+
+src_install() {
+ make DESTDIR="${D}" install || die "make install failed"
+
+ dodir /sbin
+ dosym /lib/nut/upsdrvctl /sbin/upsdrvctl
+
+ for i in "${D}"/etc/nut/*.sample ; do
+ mv "${i}" "${i/.sample/}"
+ done
+
+ if use cgi; then
+ make DESTDIR="${D}" install-cgi || die "make install-cgi failed"
+ einfo "CGI monitoring scripts are installed in /usr/share/nut,"
+ einfo "copy them to your web server's ScriptPath to activate."
+ fi
+
+ dodoc CHANGES COPYING CREDITS INSTALL MAINTAINERS NEWS README UPGRADING \
+ docs/{FAQ,*.txt}
+
+ docinto cables
+ dodoc docs/cables/*
+
+ exeinto /etc/init.d
+ newexe "${FILESDIR}/upsd.rc6" upsd
+ newexe "${FILESDIR}/upsdrv.rc6" upsdrv
+ newexe "${FILESDIR}/upsmon.rc6" upsmon
+
+ keepdir /var/lib/nut
+
+ fperms 0700 /var/lib/nut
+ fperms 0640 /etc/nut/{upsd.conf,upsd.users,upsmon.conf}
+ fowners nut:nut /var/lib/nut
+ fowners root:nut /etc/nut/{upsd.conf,upsd.users,upsmon.conf}
+}
+
+pkg_postinst() {
+ # this is to ensure that everybody that installed old versions still has correct
+ # permissions
+ chown nut:nut ${ROOT}/var/lib/nut 2>/dev/null
+ chmod 0700 ${ROOT}/var/lib/nut 2>/dev/null
+ chown root:nut ${ROOT}/etc/nut/{upsd.conf,upsd.users,upsmon.conf} 2>/dev/null
+ chmod 0640 ${ROOT}/etc/nut/{upsd.conf,upsd.users,upsmon.conf} 2>/dev/null
+}
diff --git a/www-apps/nut/nut-2.0.0.ebuild b/www-apps/nut/nut-2.0.0.ebuild
new file mode 100644
index 000000000000..ff3a2d42706d
--- /dev/null
+++ b/www-apps/nut/nut-2.0.0.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-apps/nut/nut-2.0.0.ebuild,v 1.1 2004/08/15 15:19:10 stuart Exp $
+
+inherit fixheadtails
+
+DESCRIPTION="Network-UPS Tools"
+HOMEPAGE="http://www.networkupstools.org/"
+SRC_URI="mirror://nut/source/${PV%.*}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="x86 ~sparc"
+IUSE="cgi snmp usb"
+
+RDEPEND="cgi? ( =media-libs/gd-1* )
+ snmp? ( virtual/snmp )"
+DEPEND="$RDEPEND
+ >=sys-apps/sed-4
+ >=sys-devel/autoconf-2.58"
+
+src_unpack() {
+ unpack ${A} && cd "${S}"
+
+ sed -e "s/install: install-dirs/install: install-dirs install-conf/" \
+ -i Makefile.in || die "sed failed"
+
+ ht_fix_file configure.in
+
+ sed -e "s:GD_LIBS.*=.*-L/usr/X11R6/lib \(.*\) -lXpm -lX11:GD_LIBS=\"\1:" \
+ -i configure.in || die "sed failed"
+
+ ebegin "Recreating configure"
+ WANT_AUTOCONF=2.5 autoconf || die "autoconf failed"
+ eend $?
+}
+
+src_compile() {
+ local myconf
+ myconf="${myconf} `use_with cgi` `use_with cgi cgipath /usr/share/nut`"
+
+ if [ -n "${NUT_DRIVERS}" ]; then
+ myconf="${myconf} --with-drivers=${NUT_DRIVERS// /,}"
+ fi
+
+ econf \
+ --with-user=nut \
+ --with-group=nut \
+ --with-drvpath=/lib/nut \
+ --sysconfdir=/etc/nut \
+ --with-logfacility=LOG_DAEMON \
+ --with-statepath=/var/lib/nut \
+ ${myconf} || die "econf failed"
+
+ emake || die "compile problem"
+
+ if use snmp; then
+ emake snmp || die "snmp compile problem"
+ fi
+
+ if use usb; then
+ emake usb || die "snmp compile problem"
+ fi
+
+ if use cgi; then
+ emake cgi || die "compile cgi problem"
+ fi
+}
+
+src_install() {
+ make DESTDIR="${D}" install install-lib || die "make install failed"
+
+ dodir /sbin
+ dosym /lib/nut/upsdrvctl /sbin/upsdrvctl
+
+ for i in "${D}"/etc/nut/*.sample ; do
+ mv "${i}" "${i/.sample/}"
+ done
+
+ if use snmp; then
+ make DESTDIR="${D}" install-snmp || die "make install-snmp failed"
+ fi
+
+ if use usb; then
+ make DESTDIR="${D}" install-usb || die "make install-usb failed"
+ fi
+
+ if use cgi; then
+ make DESTDIR="${D}" install-cgi || die "make install-cgi failed"
+ einfo "CGI monitoring scripts are installed in /usr/share/nut,"
+ einfo "copy them to your web server's ScriptPath to activate."
+ fi
+
+ dodoc CHANGES COPYING CREDITS INSTALL MAINTAINERS NEWS README UPGRADING \
+ docs/{FAQ,*.txt}
+
+ newdoc lib/README README.lib
+
+ docinto cables
+ dodoc docs/cables/*
+
+
+ exeinto /etc/init.d
+ newexe "${FILESDIR}/upsd.rc6" upsd
+ newexe "${FILESDIR}/upsdrv.rc6" upsdrv
+ newexe "${FILESDIR}/upsmon.rc6" upsmon
+
+ keepdir /var/lib/nut
+
+ fperms 0700 /var/lib/nut
+ fperms 0640 /etc/nut/{upsd.conf,upsd.users,upsmon.conf}
+ fowners nut:nut /var/lib/nut
+ fowners root:nut /etc/nut/{upsd.conf,upsd.users,upsmon.conf}
+}
+
+pkg_postinst() {
+ # this is to ensure that everybody that installed old versions still has correct
+ # permissions
+ chown nut:nut ${ROOT}/var/lib/nut 2>/dev/null
+ chmod 0700 ${ROOT}/var/lib/nut 2>/dev/null
+ chown root:nut ${ROOT}/etc/nut/{upsd.conf,upsd.users,upsmon.conf} 2>/dev/null
+ chmod 0640 ${ROOT}/etc/nut/{upsd.conf,upsd.users,upsmon.conf} 2>/dev/null
+}