summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2008-06-25 02:29:04 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2008-06-25 02:29:04 +0000
commit692ed164c319acecbfe4dfbeb4d1fa980916f5dd (patch)
tree853f98bd4b30a1cf7d856c2984ae26e39357c00b /sys-power
parentAdd warning about shell expansions. Drop ~ppc64 again because they have still... (diff)
downloadhistorical-692ed164c319acecbfe4dfbeb4d1fa980916f5dd.tar.gz
historical-692ed164c319acecbfe4dfbeb4d1fa980916f5dd.tar.bz2
historical-692ed164c319acecbfe4dfbeb4d1fa980916f5dd.zip
Version bump per bug #226157. Fix bugs #177887, #211505 for baselayout2. Provide better support for multiple UPS per bug #149687. Please read the postinst about upsdrv!.
Package-Manager: portage-2.2_rc1/cvs/Linux 2.6.26-rc4-00103-g1beee8d x86_64
Diffstat (limited to 'sys-power')
-rw-r--r--sys-power/nut/ChangeLog11
-rw-r--r--sys-power/nut/Manifest7
-rwxr-xr-xsys-power/nut/files/nut-2.2.2-init.d-upsd37
-rwxr-xr-xsys-power/nut/files/nut-2.2.2-init.d-upsdrv43
-rwxr-xr-xsys-power/nut/files/nut-2.2.2-init.d-upsmon29
-rw-r--r--sys-power/nut/nut-2.2.2.ebuild204
6 files changed, 329 insertions, 2 deletions
diff --git a/sys-power/nut/ChangeLog b/sys-power/nut/ChangeLog
index 502778578811..2d85056b0d67 100644
--- a/sys-power/nut/ChangeLog
+++ b/sys-power/nut/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for sys-power/nut
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/nut/ChangeLog,v 1.53 2008/06/25 01:19:47 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-power/nut/ChangeLog,v 1.54 2008/06/25 02:29:03 robbat2 Exp $
+
+*nut-2.2.2 (25 Jun 2008)
+
+ 25 Jun 2008; Robin H. Johnson <robbat2@gentoo.org>
+ +files/nut-2.2.2-init.d-upsd, +files/nut-2.2.2-init.d-upsdrv,
+ +files/nut-2.2.2-init.d-upsmon, +nut-2.2.2.ebuild:
+ Version bump per bug #226157. Fix bugs #177887, #211505 for baselayout2.
+ Provide better support for multiple UPS per bug #149687. Please read the
+ postinst about upsdrv!.
25 Jun 2008; Robin H. Johnson <robbat2@gentoo.org> nut-2.2.1.ebuild:
Add warning about shell expansions.
diff --git a/sys-power/nut/Manifest b/sys-power/nut/Manifest
index a4c942cf236d..974a5e650483 100644
--- a/sys-power/nut/Manifest
+++ b/sys-power/nut/Manifest
@@ -1,6 +1,9 @@
AUX lighttpd_nut.conf 961 RMD160 636b45860713453dc88d7ed0392862735e329099 SHA1 1cde03638637f3b2e302ae939605f2f2b7f464fd SHA256 5604058313d3cfeba426c69a756944bc7cc3ddb3813db68582e69dff1a00f7cb
AUX lighttpd_nut.conf-2.2.0 971 RMD160 745f65fac2b33e0f2baef7213c2d745c4ebb3dd5 SHA1 62f0bc9d331728023382befb3fc395dc71db032d SHA256 f0b1b3e574766557dbf92704eb4cf81b166bb4db68ddecee581cb8b0b6638f65
AUX nut-2.0.5-bcmxcp-3phase.patch 2983 RMD160 f27271648742d96952902e27b83e4b5ed39067e7 SHA1 5c87466ddfed6455989871c14d77c488a4e75a58 SHA256 1ce3938251c834e8ea31850635c085ff7f4785d268d2257f4e1c05e8732056ee
+AUX nut-2.2.2-init.d-upsd 770 RMD160 339bdc9e9f338c6560155cb51986e5210693cfe2 SHA1 918b6955f2799eaedd08bf277b234c82e2b4cf7a SHA256 5cabebe42add66c88ec3f75b94faab21730c2828f7e2a390c90cc80cd765a0f6
+AUX nut-2.2.2-init.d-upsdrv 978 RMD160 249292e9338ae68b956c5858db7588447c3f41d7 SHA1 753bc85f2c521074bad8a2cec206a4c8bc50f68e SHA256 19d16a28347868e380a08c1d0aed542ac7c37afaf0afe85d6e5c974796dfc138
+AUX nut-2.2.2-init.d-upsmon 674 RMD160 10ede96ccfaabb2a5f915d11007843d1c70db331 SHA1 5d5788b21a8205ce281952d81beb219a1c0bcc78 SHA256 f40dab33daa185677c93cbeb7a301dc4e678915a73ff90c7a886e49302301dd7
AUX upsd.rc6 733 RMD160 e95d9885a27059b16f17c6f124a43f158fef3b19 SHA1 7ffcd039a7a2e58f1608a7fe29898c13b3c4a762 SHA256 f78f9ef953e4f9b17f40eb36fe404118a39bb0baba9ccde0fb4ea0274440bb93
AUX upsdrv.rc6-r1 490 RMD160 b13a0dcc1facd1d857d15838da65a5bc360daa83 SHA1 ffbcc64d07317e6a3275156bbdcbbb08497415aa SHA256 4b2f21251cdf789ebe0688ad27ad699940f5cfb0ddaa4d9c5d22f8343ccbfd84
AUX upsmon.rc6 473 RMD160 6ad1ce54be6199d3399e77d008229acb2f02bc43 SHA1 bde917f09b74a9efc563d91b9dd74a4e8b793e3f SHA256 f338e5955c6f1e601cb0b90b95c00cbde47ef3dc56e970d8f42bb335203fbcc7
@@ -8,8 +11,10 @@ AUX upsstats-upsset-link-2.0.5.patch 625 RMD160 69253155db06c10ea4f8c5b0dd4c6638
DIST nut-2.0.5.tar.gz 809006 RMD160 e5f90a73932e038d3dfee8cb32faf097d99a7e0b SHA1 d2c07adeac524b8463677c756a90f2f22084f35e SHA256 5e1bfecfca528104db7025050c81258ee20620df7497ab5988ad461d951c8203
DIST nut-2.2.0.tar.gz 1173801 RMD160 d4e0e50239ba2b020060445869b6d364a56092f4 SHA1 b8017300d41c0a7a946034cf0bdb92ad8b7367a9 SHA256 e670ff7b51a652fd61472aa5fa5a1ed4730b5411671068be456551ea46094120
DIST nut-2.2.1.tar.gz 1192538 RMD160 5ad5e486b391bd0d1a3f6fe521043f45ee98c2e9 SHA1 a51c0aae6b94f6cf55b2719b4a499d8c31e62862 SHA256 9aad15d8cdd8694839b54342c8b4c26ddce508f6fb29ff4bee3abbe1555771f4
+DIST nut-2.2.2.tar.gz 1184406 RMD160 4dc1d2b729fc0e02c0475008c44bc62e1901f705 SHA1 f54cc909b229931fb91b4a360f0447b539d4ea6b SHA256 599d0024bcc116137a3eb65030d3dbc7132a64f30a7717f76a8254d8543422eb
EBUILD nut-2.0.5-r2.ebuild 5256 RMD160 e2cbd3290c9d0e1ce08632571e5bf0ea2e22c24f SHA1 990e4f2cbe79933edc40108740fc38bdccff377b SHA256 2e4c21ea14b154d96fa8a864e1c958e8baa5d4a7f0da6357c9a697865f916ba9
EBUILD nut-2.2.0.ebuild 5571 RMD160 c33ecc31fb43183cb756f6220b41f772da4dc61d SHA1 7c38071303ffaaeefbe6c8540ebcfc4b63e05c3c SHA256 4a2add25611a7f3689c62bbaee92b0445f45abcb4d179d5192f0c893bc513766
EBUILD nut-2.2.1.ebuild 5875 RMD160 05852fcbf41fa9f865a501eaab1a95fb2003d0a8 SHA1 3d093f2dbbe65888137abbfd508473289e2d9a13 SHA256 12355204b83d33f420905d28454d80f6c85d361060ad49d9a3d058ebbd7f6652
-MISC ChangeLog 14905 RMD160 17be9a6f7087ea0315f105fefe10e04fa10f80e7 SHA1 19cfaf00da92d338fd343b5e40a35d9fe280b03c SHA256 9732dfa5483a24f5180a82322de39ca969a7db478f69cc48e7b2bc3017663b4e
+EBUILD nut-2.2.2.ebuild 6107 RMD160 8500d3c7eeb0db07d1495efdcc86b826c279ae91 SHA1 e518fe502e297ab718de1ef97c7b0ed294364721 SHA256 0d2101c4751d1ead81aeeff18a4dc031823c9edcd32636d5e36f612cc08c57a0
+MISC ChangeLog 15278 RMD160 0d80a57e8c192ba9c1550627925fb6ce44d7663f SHA1 056af3c6a2bd495ab5c0bee25ca1921e8f5cf330 SHA256 2c0d7080687a85d0dc584ecdd90eedc3f5bad877fd1e5027ae45f673442d53eb
MISC metadata.xml 219 RMD160 7737543ce33cd412792e332121aa1c6ed452adfc SHA1 6c360930b80d6f4168ba1a486a25ad176505ea63 SHA256 8b2ef93d0d6f03a1ad115651dc46a7752e7775a62a32a7046c3294e50b14725b
diff --git a/sys-power/nut/files/nut-2.2.2-init.d-upsd b/sys-power/nut/files/nut-2.2.2-init.d-upsd
new file mode 100755
index 000000000000..4678b3e2cf33
--- /dev/null
+++ b/sys-power/nut/files/nut-2.2.2-init.d-upsd
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/nut/files/nut-2.2.2-init.d-upsd,v 1.1 2008/06/25 02:29:04 robbat2 Exp $
+
+opts="reload"
+pidfile=/var/lib/nut/upsd.pid
+bin=/usr/sbin/upsd
+
+depend() {
+ need net
+ before upsmon
+ after upsdrv
+}
+
+start() {
+ ebegin "Starting upsd"
+ # clean up first
+ pkill -u root,nut -x ${bin}
+ sleep 1s
+ rm -f ${pidfile}
+ # now start up
+ start-stop-daemon --start --quiet --exec ${bin}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping upsd"
+ start-stop-daemon --stop --quiet --pidfile ${pidfile}
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading upsd"
+ start-stop-daemon --stop --signal HUP --oknodo --quiet --pidfile ${pidfile}
+ eend $?
+}
diff --git a/sys-power/nut/files/nut-2.2.2-init.d-upsdrv b/sys-power/nut/files/nut-2.2.2-init.d-upsdrv
new file mode 100755
index 000000000000..3d18e5bc3db6
--- /dev/null
+++ b/sys-power/nut/files/nut-2.2.2-init.d-upsdrv
@@ -0,0 +1,43 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/nut/files/nut-2.2.2-init.d-upsdrv,v 1.1 2008/06/25 02:29:04 robbat2 Exp $
+
+opts="start stop stopall startall"
+UPSNAME=${SVCNAME#*.}
+msgtext="drivers"
+[ "${UPSNAME}" == "${SVCNAME}" ] && UPSNAME=''
+[ -n "$UPSNAME" ] && msgtext="driver for $UPSNAME"
+
+depend() {
+ before upsd
+ [ "${UPSNAME}" != '' ] && provide upsdrv
+}
+
+start() {
+ _dostart "$UPSNAME" "$msgtext"
+}
+stop() {
+ _dostop "$UPSNAME" "$msgtext"
+}
+
+startall() {
+ _dostart "" "$msgtext"
+}
+stopall() {
+ _dostop "" "$msgtext"
+}
+
+_dostart() {
+ ebegin "Starting UPS $msgtext"
+ /usr/sbin/upsdrvctl start $UPSNAME
+ eend $? "Failed to start UPS $msgtext!"
+}
+
+_dostop() {
+ # The pidfile names depend on the actual UPS name
+ # Not in our control at all
+ ebegin "Stopping UPS $msgtext"
+ /usr/sbin/upsdrvctl stop $UPSNAME
+ eend $? "Failed to stop UPS $msgtext!"
+}
diff --git a/sys-power/nut/files/nut-2.2.2-init.d-upsmon b/sys-power/nut/files/nut-2.2.2-init.d-upsmon
new file mode 100755
index 000000000000..3cb355b1ffdf
--- /dev/null
+++ b/sys-power/nut/files/nut-2.2.2-init.d-upsmon
@@ -0,0 +1,29 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/nut/files/nut-2.2.2-init.d-upsmon,v 1.1 2008/06/25 02:29:04 robbat2 Exp $
+
+opts="reload"
+pidfile=/var/run/upsmon.pid
+bin=/usr/sbin/upsmon
+
+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 $?
+}
+reload() {
+ ebegin "Reloading upsd"
+ start-stop-daemon --stop --signal HUP --oknodo --quiet --pidfile ${pidfile}
+ eend $?
+}
diff --git a/sys-power/nut/nut-2.2.2.ebuild b/sys-power/nut/nut-2.2.2.ebuild
new file mode 100644
index 000000000000..87455ed68d16
--- /dev/null
+++ b/sys-power/nut/nut-2.2.2.ebuild
@@ -0,0 +1,204 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/nut/nut-2.2.2.ebuild,v 1.1 2008/06/25 02:29:03 robbat2 Exp $
+
+inherit eutils fixheadtails autotools
+
+MY_P="${P/_/-}"
+
+DESCRIPTION="Network-UPS Tools"
+HOMEPAGE="http://www.networkupstools.org/"
+# Nut mirrors are presently broken
+SRC_URI="http://random.networkupstools.org/source/${PV%.*}/${MY_P}.tar.gz"
+
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86 ~x86-fbsd"
+IUSE="cgi snmp usb ssl hal xml"
+
+RDEPEND="cgi? ( >=media-libs/gd-2 )
+ snmp? ( net-analyzer/net-snmp )
+ usb? ( >=dev-libs/libusb-0.1.12 )
+ hal? ( >=sys-apps/hal-0.5.9.1 )
+ ssl? ( dev-libs/openssl )
+ xml? ( >=net-misc/neon-0.25.0 )
+ >=sys-fs/udev-114"
+DEPEND="$RDEPEND
+ >=sys-apps/sed-4
+ >=sys-devel/autoconf-2.58"
+
+# public files should be 644 root:root
+NUT_PUBLIC_FILES="/etc/nut/{{hosts,upsset,ups,upssched}.conf,upsstats{,-single}.html}"
+# private files should be 640 root:nut - readable by nut, writeable by root,
+NUT_PRIVATE_FILES="/etc/nut/{upsd.conf,upsd.users,upsmon.conf}"
+
+pkg_setup() {
+ if use cgi && ! built_with_use media-libs/gd png ; then
+ eerror "CGI support requested, bug GD not built with PNG support"
+ eerror "Please rebuild gd with 'USE=png'"
+ die
+ fi
+ enewgroup nut 84
+ enewuser nut 84 -1 /var/lib/nut nut,uucp
+ # As of udev-104, NUT must be in uucp and NOT in tty.
+ gpasswd -d nut tty 2>/dev/null
+ gpasswd -a nut uucp 2>/dev/null
+ use hal && gpasswd -a haldaemon nut 2>/dev/null
+ # in some cases on old systems it wasn't in the nut group either!
+ gpasswd -a nut nut 2>/dev/null
+ warningmsg ewarn
+}
+
+src_unpack() {
+ unpack ${A}
+
+ cd "${S}"
+
+ 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"
+
+ sed -e "s:52_nut-usbups.rules:70-nut-usbups.rules:" \
+ -i scripts/udev/Makefile.am || die "sed failed"
+
+ WANT_AUTOCONF=2.5 eautoreconf || die "autoconf failed"
+}
+
+src_compile() {
+ local myconf
+
+ 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 \
+ --with-htmlpath=/usr/share/nut/html \
+ --datarootdir=/usr/share/nut \
+ --datadir=/usr/share/nut \
+ --with-dev \
+ $(use_with xml neonxml) \
+ $(use_with hal) \
+ $(use_with ssl) \
+ $(use_with usb) \
+ $(use_with snmp) \
+ $(use_with cgi) \
+ $(use_with cgi cgipath /usr/share/nut/cgi) \
+ ${myconf} || die "econf failed"
+
+ emake || die "compile problem"
+
+}
+
+src_install() {
+
+ make DESTDIR="${D}" install || die "make install failed"
+
+ dodir /sbin
+ dosym /lib/nut/upsdrvctl /sbin/upsdrvctl
+ # This needs to exist for the scripts
+ dosym /lib/nut/upsdrvctl /usr/sbin/upsdrvctl
+
+ if use cgi; then
+ elog "CGI monitoring scripts are installed in /usr/share/nut/cgi."
+ elog "copy them to your web server's ScriptPath to activate (this is a"
+ elog "change from the old location)."
+ elog "If you use lighttpd, see lighttpd_nut.conf in the documentation."
+ fi
+
+ # this must be done after all of the install phases
+ for i in "${D}"/etc/nut/*.sample ; do
+ mv "${i}" "${i/.sample/}"
+ done
+
+ dodoc ChangeLog INSTALL MAINTAINERS NEWS README UPGRADING \
+ docs/{FAQ,*.txt}
+
+ newdoc lib/README README.lib
+
+ newdoc "${FILESDIR}"/lighttpd_nut.conf-2.2.0 lighttpd_nut.conf
+
+ docinto cables
+ dodoc docs/cables/*
+
+ newinitd "${FILESDIR}"/nut-2.2.2-init.d-upsd upsd
+ newinitd "${FILESDIR}"/nut-2.2.2-init.d-upsdrv upsdrv
+ newinitd "${FILESDIR}"/nut-2.2.2-init.d-upsmon upsmon
+
+ # This sets up permissions for nut to access a UPS
+ insinto /etc/udev/rules.d/
+ newins scripts/udev/nut-usbups.rules 70-nut-usbups.rules
+
+ keepdir /var/lib/nut
+
+ fperms 0700 /var/lib/nut
+ fowners nut:nut /var/lib/nut
+
+ # Do not remove eval here, because the variables contain shell expansions.
+ eval fperms 0640 ${NUT_PRIVATE_FILES}
+ eval fowners root:nut ${NUT_PRIVATE_FILES}
+
+ # Do not remove eval here, because the variables contain shell expansions.
+ eval fperms 0644 ${NUT_PUBLIC_FILES}
+ eval fowners root:root ${NUT_PUBLIC_FILES}
+
+ # this is installed for 2.4 and fbsd guys
+ if ! has_version sys-fs/udev; then
+ insinto /etc/hotplug/usb
+ insopts -m 755
+ doins scripts/hotplug/nut-usbups.hotplug
+ fi
+
+ if use hal; then
+ insinto /usr/share/hal/fdi/information/20thirdparty/
+ doins scripts/hal/20-ups-nut-device.fdi
+ insinto /usr/libexec
+ insopts -m 755
+ doins drivers/hald-addon-*
+ rm "${D}"/lib/nut/hald-addon-*
+ fi
+}
+
+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
+
+ # Do not remove eval here, because the variables contain shell expansions.
+ eval chown root:nut "${ROOT}"${NUT_PRIVATE_FILES} 2>/dev/null
+ eval chmod 0640 "${ROOT}"${NUT_PRIVATE_FILES} 2>/dev/null
+
+ # Do not remove eval here, because the variables contain shell expansions.
+ eval chown root:root "${ROOT}"${NUT_PUBLIC_FILES} 2>/dev/null
+ eval chmod 0644 "${ROOT}"${NUT_PUBLIC_FILES} 2>/dev/null
+
+ warningmsg elog
+}
+
+warningmsg() {
+ msgfunc="$1"
+ [ -z "$msgfunc" ] && die "msgfunc not specified in call to warningmsg!"
+ ${msgfunc} "Please note that NUT now runs under the 'nut' user."
+ ${msgfunc} "NUT is in the uucp group for access to RS-232 UPS."
+ ${msgfunc} "However if you use a USB UPS you may need to look at the udev or"
+ ${msgfunc} "hotplug rules that are installed, and alter them suitably."
+ echo
+ ${msgfunc} "If you use hald, you may be able to skip the normal init scripts."
+ echo
+ ${msgfunc} "You are strongly advised to read the UPGRADING file provided by upstream."
+ echo
+ ${msgfunc} "Please note that upsdrv is NOT automatically started by upsd anymore."
+ ${msgfunc} "If you have multiple UPS units, you can use their NUT names to"
+ ${msgfunc} "have a service per UPS:"
+ ${msgfunc} "ln -s /etc/init.d/upsdrv /etc/init.d/upsdrv.\$UPSNAME"
+}