summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2009-03-22 13:58:12 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2009-03-22 13:58:12 +0000
commit2c6cf4520c20401fa6ea652723676420ba852b0b (patch)
tree41278c68a1c45a252c7ea285df913235ed77124e /sys-power/apcupsd
parent* bump (diff)
downloadhistorical-2c6cf4520c20401fa6ea652723676420ba852b0b.tar.gz
historical-2c6cf4520c20401fa6ea652723676420ba852b0b.tar.bz2
historical-2c6cf4520c20401fa6ea652723676420ba852b0b.zip
Add init script for shutting the UPS down on power failure. Thanks to Matt Whitlock in bug #262234.
Package-Manager: portage-2.2_rc26/cvs/Linux x86_64
Diffstat (limited to 'sys-power/apcupsd')
-rw-r--r--sys-power/apcupsd/ChangeLog10
-rw-r--r--sys-power/apcupsd/Manifest14
-rw-r--r--sys-power/apcupsd/apcupsd-3.14.5-r2.ebuild (renamed from sys-power/apcupsd/apcupsd-3.14.5-r1.ebuild)13
-rw-r--r--sys-power/apcupsd/apcupsd-3.14.5.ebuild116
-rw-r--r--sys-power/apcupsd/files/apcupsd.powerfail.init18
5 files changed, 46 insertions, 125 deletions
diff --git a/sys-power/apcupsd/ChangeLog b/sys-power/apcupsd/ChangeLog
index 2f159f6d2da0..574af6ad09cf 100644
--- a/sys-power/apcupsd/ChangeLog
+++ b/sys-power/apcupsd/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for sys-power/apcupsd
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/ChangeLog,v 1.42 2009/03/11 11:23:11 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/ChangeLog,v 1.43 2009/03/22 13:58:12 flameeyes Exp $
+
+*apcupsd-3.14.5-r2 (22 Mar 2009)
+
+ 22 Mar 2009; Diego E. Pettenò <flameeyes@gentoo.org>
+ +files/apcupsd.powerfail.init, -apcupsd-3.14.5.ebuild,
+ -apcupsd-3.14.5-r1.ebuild, +apcupsd-3.14.5-r2.ebuild:
+ Add init script for shutting the UPS down on power failure. Thanks to Matt
+ Whitlock in bug #262234.
*apcupsd-3.14.5-r1 (11 Mar 2009)
diff --git a/sys-power/apcupsd/Manifest b/sys-power/apcupsd/Manifest
index 62d5c02fe380..ab7fb63314dd 100644
--- a/sys-power/apcupsd/Manifest
+++ b/sys-power/apcupsd/Manifest
@@ -12,19 +12,19 @@ AUX 3.12.4/exit-status-build.patch 803 RMD160 c55fa78dbb454955135409eed3e0d737cd
AUX 3.12.4/no-parallel.patch 339 RMD160 c6e50aa5b22438e02e17df4fda41c7cae371217f SHA1 4d20db0882272b9c472b1ea994d115310bcab6d3 SHA256 3bcd10a6f7c623496a75d8cc321becbc24162372936dab4e696b0322c46e4c62
AUX 3.12.4/no-strip.patch 2181 RMD160 aa2d852fa223e2c5b18426a5334a1e3ee05b9cdc SHA1 b7952c4102fd810cb325c3cd6ab58592aa3cf527 SHA256 d45668c87581c1f5dd3a235578b291af157678480536d501c7f60b1cdfb0edab
AUX apcupsd.init.2 838 RMD160 fdca4e15d5f475c43147ce65624a4355e6ed9279 SHA1 b34596c601f368ed5028d661f7dd79630bfef4a9 SHA256 9c60e920d5946ff581b38c33087ec6a1ed7d8885bc2c9c5621932f5e7c8571d3
+AUX apcupsd.powerfail.init 507 RMD160 97fef59db29e49d69a25caf4ebc876c8caf54c4d SHA1 6dd74928a5cebffa8fde0c7930acd2831009efe0 SHA256 4c3b882e55dc658fb4f9d66cc97a521d5eb77159a1d47d457e43c44d1722dfd4
DIST apcupsd-3.10.18.tar.gz 5698299 RMD160 ebaf99e097d836ff8858cf653a825928058f54dd SHA1 a4e0f968be13c833ec25869f686e44c5a34e7964 SHA256 ae42d64e5cb29c8ce291f634139b5c81e888c95686f5c70ac9c250a1d8c02a38
DIST apcupsd-3.12.4.tar.gz 4223158 RMD160 a54c2f6d71c902d7963a1c65a3850f657aabaa88 SHA1 a36212d9634d36beda2318d85b882209763f2473 SHA256 e2c789089a71f8bafc2812a5e20b73f5420e4c234961afb53a30f6ff891640ba
DIST apcupsd-3.14.5.tar.gz 4172931 RMD160 76dadfb241b69a9603cc6f06ef4549a1aa3ac55e SHA1 c28685a2ccd0565b4c5d9e972773b18a915562a9 SHA256 f48a75139d5701d13444128da6f9f6feea04da8524e8ba3bce2c21bdbedba49e
EBUILD apcupsd-3.10.18-r1.ebuild 2614 RMD160 4136189b375cdd5b50fa1e98bcff757406ea8e66 SHA1 de25eb0d627ca017c4f5d27119ffaba709125735 SHA256 f5004d36d0c5a41df6c4fa9fe5e2cc3c49894a7aef927e79cfb72a1cce04ee39
EBUILD apcupsd-3.12.4.ebuild 3028 RMD160 257a1dcc849ba616569693b7fb685c7be4a5d6f8 SHA1 41a0e20c82b02fe9158f3a45bd816fa66c4ac46a SHA256 86c0a2f5ffe869f5ea0db0220264d1109dcab7f4c395533e8dd5c87c478b59c9
-EBUILD apcupsd-3.14.5-r1.ebuild 3153 RMD160 a0ad603227f3b21bda7555a105687856e5b37d49 SHA1 a0807ba726935bcb953a24df699d6bcdcf834316 SHA256 6fc28aaf39211b06869e3cd46de85da1476d8ed7a908262fd5c35d895201968e
-EBUILD apcupsd-3.14.5.ebuild 3207 RMD160 f88053a95d883bbf3c4a9e6b10d0f3d453323297 SHA1 d705e6f777573f3cfd3e4e6c2c561ad54a92ba12 SHA256 fbd069b68cd5896e7ac7f7000b93fa19887129f992440cb7878551cb7bf4364a
-MISC ChangeLog 19934 RMD160 166413d77fe96cbe59df3b36d93ff4a2ac9c1988 SHA1 d8c5bb9383c37427b8db45a3ff77f8df727788f8 SHA256 0d002514f9b11fdcbd291bd649aff7662c4fea67a2e1dbb37da7f4ffbb73c6c0
+EBUILD apcupsd-3.14.5-r2.ebuild 3623 RMD160 0cf070c17b229abae6ce63695ed5daab377236f3 SHA1 f1ef1feb3788bce643b08b69d99336ea6937b6f9 SHA256 defe94c26ef8cf6cb9dc2d1809236ec7d3d6468cc659ab2fbdbbe247ed264ee6
+MISC ChangeLog 20242 RMD160 57f03f5f2d30036bc585ea71835ea159696c635a SHA1 d16cf316948c90bf696813346cd0d0d586d659c0 SHA256 9ada06d1f8d6341e2d64a4a914709af2e0c2c852d71ae6d93ceac198bdb62b40
MISC metadata.xml 237 RMD160 2a4fab832a64fbdafe2cd6f59b141b2aa80797ac SHA1 75878fb1a17b8617882c9e02331a6643d647882b SHA256 368acc29aa9214adaa137c17b114b16c6a021c4dfc9efa5f3440e968db04a9b3
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.10 (GNU/Linux)
+Version: GnuPG v2.0.11 (GNU/Linux)
-iEYEARECAAYFAkm3nzcACgkQAiZjviIA2XgZxACeNN5klHuDz9tal1ZpxVhOAWQn
-Bl0AnAo1C6OYJ58GP92OSQmLfL4zp7oC
-=vLCa
+iEYEARECAAYFAknGQ/kACgkQAiZjviIA2XiFMwCfW0GwafMMjVP/NWi1Bu1dl53U
+jjoAoPNFnsCT7InHPRJBsZPDdmbAfiRz
+=7jKv
-----END PGP SIGNATURE-----
diff --git a/sys-power/apcupsd/apcupsd-3.14.5-r1.ebuild b/sys-power/apcupsd/apcupsd-3.14.5-r2.ebuild
index 2d4c881e64be..167349529335 100644
--- a/sys-power/apcupsd/apcupsd-3.14.5-r1.ebuild
+++ b/sys-power/apcupsd/apcupsd-3.14.5-r2.ebuild
@@ -1,6 +1,6 @@
# 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-r1.ebuild,v 1.1 2009/03/11 11:23:11 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/apcupsd-3.14.5-r2.ebuild,v 1.1 2009/03/22 13:58:12 flameeyes Exp $
WEBAPP_MANUAL_SLOT="yes"
WEBAPP_OPTIONAL="yes"
@@ -89,6 +89,7 @@ src_install() {
rm "${D}"/etc/init.d/apcupsd
newinitd "${FILESDIR}/${PN}.init.2" "${PN}" || die "newinitd failed"
+ newinitd "${FILESDIR}/${PN}.powerfail.init" "${PN}".powerfail || die "newinitd failed"
}
pkg_postinst() {
@@ -106,6 +107,16 @@ pkg_postinst() {
elog "/etc/init.d/apcupsd.something, and it will then load the"
elog "configuration file at /etc/apcupsd/something.conf."
elog ""
+
+ if [ -d "${ROOT}"/etc/runlevels/shutdown -a \
+ ! -e "${ROOT}"/etc/runlevels/shutdown/"${PN}".powerfail ] ; then
+ elog 'If you want apcupsd to power off your UPS when it'
+ elog 'shuts down your system in a power failure, you must'
+ elog 'add apcupsd.powerfail to your shutdown runlevel:'
+ elog ''
+ elog ' \e[01m rc-update add apcupsd.powerfail shutdown \e[0m'
+ elog ''
+ fi
}
pkg_prerm() {
diff --git a/sys-power/apcupsd/apcupsd-3.14.5.ebuild b/sys-power/apcupsd/apcupsd-3.14.5.ebuild
deleted file mode 100644
index cd7064da1848..000000000000
--- a/sys-power/apcupsd/apcupsd-3.14.5.ebuild
+++ /dev/null
@@ -1,116 +0,0 @@
-# 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.4 2009/01/19 15:52:12 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 nls gnome"
-
-DEPEND="doc? ( virtual/latex-base
- dev-tex/latex2html
- app-text/dvipdfm )
- cgi? ( >=media-libs/gd-1.8.4
- ${WEBAPP_DEPEND} )
- 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_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.
- 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 snmp net-snmp) \
- $(use_enable gnome gapcmon) \
- ${myconf} \
- APCUPSD_MAIL=/bin/mail \
- || die "econf failed"
- emake || die "emake failed"
-
- if use doc; then
- einfo "Building full documentation..."
- cd "${S}"/doc/latex
- emake -j1 texcheck tex web pdf || die "doc build failed"
- 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
- newman doc/apctest.man apctest.8 || die "newman failed"
-
- if use doc; then
- einfo "Installing full documentation..."
- newdoc doc/latex/apcupsd.pdf manual.pdf || die "pdf doc failed"
- dohtml -r doc/latex/apcupsd/* || die "doc install failed"
- 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}" || die "newinitd failed"
-}
-
-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.powerfail.init b/sys-power/apcupsd/files/apcupsd.powerfail.init
new file mode 100644
index 000000000000..35ee364c80ca
--- /dev/null
+++ b/sys-power/apcupsd/files/apcupsd.powerfail.init
@@ -0,0 +1,18 @@
+#!/sbin/runscript
+# Copyright 2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/files/apcupsd.powerfail.init,v 1.1 2009/03/22 13:58:11 flameeyes Exp $
+
+description='Signal the UPS to kill power in a power failure condition'
+
+depend() {
+ need mount-ro
+}
+
+start() {
+ if [[ $(runlevel) == *' 0' && -f /etc/apcupsd/powerfail ]] ; then
+ ebegin 'Signaling UPS to kill power'
+ /sbin/apcupsd --killpower
+ eend $?
+ fi
+}