summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2009-01-15 15:21:11 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2009-01-15 15:21:11 +0000
commit78e03343f037e3b9f3e23ca254aeb62341701792 (patch)
tree342d1c8fa0bce8b71faef59fe95363a632c07937 /sys-power
parentRemoved 2 obsolete patches (diff)
downloadgentoo-2-78e03343f037e3b9f3e23ca254aeb62341701792.tar.gz
gentoo-2-78e03343f037e3b9f3e23ca254aeb62341701792.tar.bz2
gentoo-2-78e03343f037e3b9f3e23ca254aeb62341701792.zip
Version bump, finally closing bug #228011 (thanks to all for the patience). Also fix bug #240694 (thanks to Billy DeVincentis for the init script), #254242 (thanks to Gordon Pritchard for reporting), #243070 (thanks to Ryan Tandy for the patch).
(Portage version: 2.2_rc22/cvs/Linux 2.6.28-gentoo x86_64)
Diffstat (limited to 'sys-power')
-rw-r--r--sys-power/apcupsd/ChangeLog13
-rw-r--r--sys-power/apcupsd/apcupsd-3.14.5.ebuild121
-rw-r--r--sys-power/apcupsd/files/apcupsd.init.237
3 files changed, 169 insertions, 2 deletions
diff --git a/sys-power/apcupsd/ChangeLog b/sys-power/apcupsd/ChangeLog
index 31f39c1454ed..569a7cd1f0b3 100644
--- a/sys-power/apcupsd/ChangeLog
+++ b/sys-power/apcupsd/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for sys-power/apcupsd
-# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/ChangeLog,v 1.37 2008/09/03 07:25:44 opfer Exp $
+# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/ChangeLog,v 1.38 2009/01/15 15:21:11 flameeyes Exp $
+
+*apcupsd-3.14.5 (15 Jan 2009)
+
+ 15 Jan 2009; Diego E. Pettenò <flameeyes@gentoo.org>
+ +files/apcupsd.init.2, +apcupsd-3.14.5.ebuild:
+ Version bump, finally closing bug #228011 (thanks to all for the
+ patience). Also fix bug #240694 (thanks to Billy DeVincentis for the init
+ script), #254242 (thanks to Gordon Pritchard for reporting), #243070
+ (thanks to Ryan Tandy for the patch).
03 Sep 2008; Christian Faulhammer <opfer@gentoo.org>
apcupsd-3.12.3.ebuild, apcupsd-3.12.4.ebuild, apcupsd-3.14.0.ebuild,
diff --git a/sys-power/apcupsd/apcupsd-3.14.5.ebuild b/sys-power/apcupsd/apcupsd-3.14.5.ebuild
new file mode 100644
index 000000000000..376a5f490b3a
--- /dev/null
+++ b/sys-power/apcupsd/apcupsd-3.14.5.ebuild
@@ -0,0 +1,121 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/apcupsd-3.14.5.ebuild,v 1.1 2009/01/15 15:21:11 flameeyes Exp $
+
+WEBAPP_MANUAL_SLOT="yes"
+WEBAPP_OPTIONAL="yes"
+inherit eutils webapp
+
+DESCRIPTION="APC UPS daemon with integrated tcp/ip remote shutdown"
+HOMEPAGE="http://www.apcupsd.org/"
+SRC_URI="mirror://sourceforge/apcupsd/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86 ~x86-fbsd"
+IUSE="doc snmp usb cgi ncurses nls gnome"
+
+DEPEND="doc? ( virtual/latex-base dev-tex/latex2html )
+ cgi? ( >=media-libs/gd-1.8.4
+ ${WEBAPP_DEPEND} )
+ ncurses? ( sys-libs/ncurses )
+ nls? ( sys-devel/gettext )
+ snmp? ( net-analyzer/net-snmp )
+ gnome? ( >=x11-libs/gtk+-2.4.0
+ >=dev-libs/glib-2.0
+ >=gnome-base/gconf-2.0 )"
+RDEPEND="${DEPEND}
+ virtual/mailx"
+
+pkg_setup() {
+ use cgi && webapp_pkg_setup
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/3.14.3/etc.patch
+}
+
+src_compile() {
+ local myconf
+ use cgi && myconf="${myconf} --enable-cgi --with-cgi-bin=${MY_CGIBINDIR}"
+ if use usb; then
+ myconf="${myconf} --with-upstype=usb --with-upscable=usb --enable-usb --with-dev= "
+ else
+ myconf="${myconf} --with-upstype=apcsmart --with-upscable=smart --disable-usb"
+ fi
+
+ # We force the DISTNAME to gentoo so it will use gentoo's layout also
+ # when installed on non-linux systems.
+ APCUPSD_MAIL=/bin/mail econf \
+ --sbindir=/sbin \
+ --sysconfdir=/etc/apcupsd \
+ --with-pwrfail-dir=/etc/apcupsd \
+ --with-lock-dir=/var/lock \
+ --with-pid-dir=/var/run \
+ --with-log-dir=/var/log \
+ --with-nis-port=3551 \
+ --enable-net \
+ --with-distname=gentoo \
+ $(use_enable ncurses powerflute) \
+ $(use_enable snmp net-snmp) \
+ $(use_enable gnome gapcmon) \
+ ${myconf} \
+ || die
+ emake || die "emake failed"
+
+ if use doc; then
+ einfo "Building full documentation..."
+ cd "${S}"/doc/latex
+ make texcheck tex web pdf
+ fi
+}
+
+src_install() {
+ use cgi && webapp_src_preinst
+
+ emake DESTDIR="${D}" install || die "installed failed"
+ rm -f "${D}"/etc/init.d/halt
+
+ insinto /etc/apcupsd
+ newins examples/safe.apccontrol safe.apccontrol
+
+ dodoc ChangeLog* ReleaseNotes
+ mv doc/apctest.man doc/apctest.8; doman doc/apctest.8
+
+ if use doc; then
+ einfo "Installing full documentation..."
+ newdoc doc/latex/apcupsd.pdf manual.pdf
+ dohtml -r doc/latex/apcupsd/*
+ fi
+
+ if use cgi; then
+ mv "${D}"/etc/apcupsd/apcupsd.css "${D}""${MY_CGIBINDIR}"
+ webapp_src_install
+ fi
+
+ rm "${D}"/etc/init.d/apcupsd
+ newinitd "${FILESDIR}/${PN}.init.2" "${PN}"
+}
+
+pkg_postinst() {
+ if use cgi; then
+ elog "If you are upgrading from a previous version, please note"
+ elog "that the CGI interface is now installed using webapp-config."
+ elog "/var/www/apcupsd is no longer present."
+ webapp_pkg_postinst
+ fi
+
+ elog ""
+ elog "Since version 3.14.0 you can use multiple apcupsd instances to"
+ elog "control more than one UPS in a single box."
+ elog "To do this, create a link between /etc/init.d/apcupsd to a new"
+ elog "/etc/init.d/apcupsd.something, and it will then load the"
+ elog "configuration file at /etc/apcupsd/something.conf."
+ elog ""
+}
+
+pkg_prerm() {
+ use cgi && webapp_pkg_prerm
+}
diff --git a/sys-power/apcupsd/files/apcupsd.init.2 b/sys-power/apcupsd/files/apcupsd.init.2
new file mode 100644
index 000000000000..43868f75ddaf
--- /dev/null
+++ b/sys-power/apcupsd/files/apcupsd.init.2
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/files/apcupsd.init.2,v 1.1 2009/01/15 15:21:11 flameeyes Exp $
+
+INSTANCE="${SVCNAME#*.}"
+if [ -z "${INSTANCE}" ] || [ "${SVCNAME}" = "apcupsd" ]; then
+ INSTANCE="apcupsd"
+fi
+
+depend() {
+ use net
+}
+
+start() {
+ rm -f /etc/apcupsd/powerfail
+
+ export SERVICE="${SVCNAME}"
+
+ ebegin "Starting APC UPS daemon"
+ start-stop-daemon \
+ --start --pidfile "/var/run/${SVCNAME}.pid" \
+ --exec /sbin/apcupsd -- \
+ -f "/etc/apcupsd/${INSTANCE}.conf" \
+ -P "/var/run/${SVCNAME}.pid"
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping APC UPS daemon"
+ start-stop-daemon \
+ --stop --pidfile "/var/run/${SVCNAME}.pid" \
+ --retry TERM/5/TERM/5 \
+ --exec /sbin/apcupsd
+ eend $?
+}
+