diff options
author | Stuart Shelton <stuart@shelton.me> | 2014-07-04 11:34:05 +0100 |
---|---|---|
committer | Stuart Shelton <stuart@shelton.me> | 2014-07-04 11:34:05 +0100 |
commit | 5027e01beea97673d61e33ef9352ef692e490fb8 (patch) | |
tree | 52591718daa6ad92899c2133e60f6206604234c2 /sys-power | |
parent | Add app-emulation/lxc-1.0.4 with fixed Python dependencies (diff) | |
download | srcshelton-5027e01beea97673d61e33ef9352ef692e490fb8.tar.gz srcshelton-5027e01beea97673d61e33ef9352ef692e490fb8.tar.bz2 srcshelton-5027e01beea97673d61e33ef9352ef692e490fb8.zip |
Add sys-power/apcupsd-3.14.12-r1 with more flexible USE options
Diffstat (limited to 'sys-power')
-rw-r--r-- | sys-power/apcupsd/Manifest | 1 | ||||
-rw-r--r-- | sys-power/apcupsd/apcupsd-3.14.12-r1.ebuild | 160 |
2 files changed, 161 insertions, 0 deletions
diff --git a/sys-power/apcupsd/Manifest b/sys-power/apcupsd/Manifest index eb765276..2406702d 100644 --- a/sys-power/apcupsd/Manifest +++ b/sys-power/apcupsd/Manifest @@ -14,4 +14,5 @@ DIST apcupsd-3.14.12.tar.gz 2014699 SHA256 1b4f703cb19cfdf44daf173dc8394cafd30fe EBUILD apcupsd-3.14.10-r1.ebuild 4106 SHA256 4b16ea408b67ceac28b5940fe0e7b261f09ec2d9e995a3134a40083fab485f9a SHA512 3e2daacdd3034c705b365a1032c033acad47cd78ae538aa5e12002b5715c738f2d6d357d394b195df3efb00c0530e96c933f62221d3dbd469b0c3cc7adf1eff8 WHIRLPOOL 96fcc3dc10d4e9ba9c5d9f98bcd34f805bcced8639edf0138143a2845bde5273c628e1e0fa5e2258e1ca9935d315b5c0efbbca8a042ab55e41823b926655eac0 EBUILD apcupsd-3.14.10-r2.ebuild 4223 SHA256 0eacd497d6b82c9a92f3444698007b08a75a060bad7443309c8c25f93fae397f SHA512 e3586d453b028a4d44d9c823a944907f47d6ea1a1d5fa887941052417601579149d1e6dc8e521d47bf68fc1ae1fc24150e5cc9ca7b0beb0a80d36c1ef307a61e WHIRLPOOL 28adb4150904bea7ba3038a9fb4df595b7a61f9061305883a2fad61fc7cbef9c0262035e185c97cdd65fea06cf415d413564ecb38b5c51d5e6bce36e23d1ae71 EBUILD apcupsd-3.14.10-r6.ebuild 4450 SHA256 f7aef954fdf7e129e710e7264d9e683a98a6b8a8ac512658b7100b47bf093bad SHA512 e7daab1f314cd8dbdc6388e1b88f0426872a29a1de98fe008c0f3c0bfc8a050a3e1a7aaf19bdbd1d5af8c6ee89738a1e142251129be0e722d9b68121c12b3b87 WHIRLPOOL 526f2e5fddc5d337666c8b3ef6be72f6d9db923f4a39967f2f9ed2809e0c0ec99a1669fb782d8f19c11d13c2db96b175316e08e49a6d8034f1b540519e6d6f41 +EBUILD apcupsd-3.14.12-r1.ebuild 4838 SHA256 62579b99498c661e9c620dee999c636631874621bea3f7b07264fe594eb06c68 SHA512 d2d5b1d0b966258a1609f3fe547287285b517ef730f5e5dfc04730d3a6236cade1946223fc58a766c9d58b1481e11d76a9ed7484a5f6bcbde6050bf90e1db5cd WHIRLPOOL 6bc24264cb191e826d6faa70b5a2c38e9dc50b07e397ae8e47b6ec5ef65788b18c1a7c686414fb53a4f62df2fea7aa783ca196f5d54b832491834073d4d217b0 EBUILD apcupsd-3.14.12.ebuild 4790 SHA256 e7780e34d52abed94f22e2144612cceb2e9d4498ae0226495d91b096e732888c SHA512 3d114ceda9dee32cce1f094a2e566bff22b9aaf6d4f6a81b8021d2af9402440ab440e8abbff4c173c72f9bde33ae83c3615e2ece9c2db4b89f5474043f6fdf1b WHIRLPOOL 97004a9ba5aa0a55a5c680a1839966b163ad158d5b83f1f72595cf62d013d2f6d265ebc39c521953f19fc13523c89eb44e307f6aceba47b6986e03b500caa47f diff --git a/sys-power/apcupsd/apcupsd-3.14.12-r1.ebuild b/sys-power/apcupsd/apcupsd-3.14.12-r1.ebuild new file mode 100644 index 00000000..07acd20e --- /dev/null +++ b/sys-power/apcupsd/apcupsd-3.14.12-r1.ebuild @@ -0,0 +1,160 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/apcupsd-3.14.12-r1.ebuild,v 1.1 2014/07/03 21:28:45 mattm Exp $ + +EAPI=4 + +inherit eutils linux-info flag-o-matic systemd udev + +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="~amd64 ~arm ~ppc ~x86 ~x86-fbsd" +IUSE="snmp +usb cgi dumb gnome kernel_linux +modbus +net nls +powerchute +smart systemd udev" + +DEPEND=" + || ( >=sys-apps/util-linux-2.23[tty-helpers(-)] + <=sys-apps/sysvinit-2.88-r4 + sys-freebsd/freebsd-ubin + ) + cgi? ( >=media-libs/gd-1.8.4 ) + nls? ( sys-devel/gettext ) + snmp? ( >=net-analyzer/net-snmp-5.7.2 ) + gnome? ( >=x11-libs/gtk+-2.4.0:2 + dev-libs/glib:2 + >=gnome-base/gconf-2.0 )" +RDEPEND="${DEPEND} + sys-apps/openrc + virtual/mailx" + +CONFIG_CHECK="~USB_HIDDEV ~HIDRAW" +ERROR_USB_HIDDEV="CONFIG_USB_HIDDEV: needed to access USB-attached UPSes" +ERROR_HIDRAW="CONFIG_HIDRAW: needed to access USB-attached UPSes" + +pkg_setup() { + if use kernel_linux && use usb && linux_config_exists; then + check_extra_config + fi +} + +src_prepare() { + epatch "${FILESDIR}/${PN}-3.14.9-aliasing.patch" +} + +src_configure() { + local myconf="--disable-net-snmp --disable-test" + use cgi && myconf="${myconf} --enable-cgi --with-cgi-bin=/usr/libexec/${PN}/cgi-bin" + if use usb; then + myconf="${myconf} --with-upstype=usb --with-upscable=usb --with-dev= " + elif use modbus; then + myconf="${myconf} --with-upstype=modbus --with-upscable=modbus" + else + myconf="${myconf} --with-upstype=apcsmart --with-upscable=smart" + fi + + if use net; then + myconf="${myconf} --with-nis-port=3551 $(use_enable powerchute pcnet )" + else + sed -i -e '/^NISSRV_ENABLED=yes$/{s:yes:no:}' configure || die "NIS patch failed" + 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/apcupsd \ + --with-log-dir=/var/log \ + --with-distname=gentoo \ + $(use_enable dumb ) \ + $(use_enable gnome gapcmon) \ + $(use_enable modbus ) \ + $(use_enable net ) \ + $(use_enable smart apcsmart ) \ + $(use_enable snmp ) \ + $(use_enable usb ) \ + ${myconf} \ + APCUPSD_MAIL=/bin/mail +} + +src_compile() { + # Workaround for bug #280674; upstream should really just provide + # the text files in the distribution, but I wouldn't count on them + # doing that anytime soon. + MANPAGER=$(type -p cat) \ + emake || die "emake failed" +} + +src_install() { + emake DESTDIR="${D}" install || die "installed failed" + rm -f "${D}"/etc/init.d/halt + + insinto /etc/apcupsd + newins examples/safe.apccontrol safe.apccontrol + doins "${FILESDIR}"/apcupsd.conf + + dodoc ChangeLog* ReleaseNotes + doman doc/*.8 doc/*.5 + + dohtml -r doc/manual/* + + rm "${D}"/etc/init.d/apcupsd + newinitd "${FILESDIR}/${PN}.init.4" "${PN}" + newinitd "${FILESDIR}/${PN}.powerfail.init" "${PN}".powerfail + + if use systemd; then + systemd_dounit "${FILESDIR}"/${PN}.service + systemd_dotmpfilesd "${FILESDIR}"/${PN}-tmpfiles.conf + else + # Without this it'll crash at startup. When merging in ROOT= this + # won't be created by default, so we want to make sure we got it! + if [[ "${ROOT:-/}" != "/" ]]; then + keepdir /var/lock + fowners root:uucp /var/lock + fperms 0775 /var/lock + fi + fi + + # remove hal settings, we don't really want to have it around still. + rm -r "${D}"/usr/share/hal + + # replace it with our udev rules if we're in Linux + if use udev && use kernel_linux; then + udev_newrules "${FILESDIR}"/apcupsd-udev.rules 60-${PN}.rules + fi + +} + +pkg_postinst() { + if use cgi; then + elog "The cgi-bin directory for ${PN} is /usr/libexec/${PN}/cgi-bin." + elog "Set up your ScriptAlias or symbolic links accordingly." + 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 with openRC." + 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 "" + + 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 '' + + if use kernel_linux; then + elog "Starting from version 3.14.9-r1, ${PN} installs udev rules" + elog "for persistent device naming. If you have multiple UPS" + elog "connected to the machine, you can point them to the devices" + elog "in /dev/apcups/by-id directory." + fi +} |