diff options
-rw-r--r-- | sys-power/apcupsd/Manifest | 3 | ||||
-rw-r--r-- | sys-power/apcupsd/apcupsd-3.14.10-r2.ebuild | 139 | ||||
-rw-r--r-- | sys-power/apcupsd/files/apcupsd-tmpfiles.conf | 2 | ||||
-rw-r--r-- | sys-power/apcupsd/files/apcupsd.service | 8 |
4 files changed, 152 insertions, 0 deletions
diff --git a/sys-power/apcupsd/Manifest b/sys-power/apcupsd/Manifest index 009361a4..66b33ff4 100644 --- a/sys-power/apcupsd/Manifest +++ b/sys-power/apcupsd/Manifest @@ -1,8 +1,11 @@ AUX apcupsd-3.14.10-mib.patch 3967 SHA256 e0eae470fd6f2d5cfc5f9faa3028ba5c13b24dc9c69c4c3a8555e61558378c70 SHA512 080fd6f6bd1aa571458c09b7587dee3fe5937175a6e111976537445e805b1a2a6bbddc28224bdc23cee58a2bedcc2c458ff24f1946fd9cbfbf50500b18124680 WHIRLPOOL b50d1b1deeb51f42230e56d4dfd1927af4858c5f42621acab94c46dc8b46ee9d281f296050f9f5b3e8ba434352eae43a90fd7a3c29d46915a40b257a3570702c AUX apcupsd-3.14.9-aliasing.patch 2108 SHA256 21343f4798121a828a89eee49ca9fe7574b2fb45a5aad35fbfd5aabec7740761 SHA512 48eb51385136216d1cdddb6b237b89a52c516b223aa7fe50fb35761cd595d9ab7f7fabbd0e4f8c0f7d45df6feed0a2e240d227181f3d772fc5fa9f8bfa62529f WHIRLPOOL 8ad5540b942919c7ce0c3b560feb1dc6a0771b81999f546d62b8c480ecb3731994a930c72dde9c5e36d9024d4c1b97b8bd00d8baa98ee99f273c59e43070ae38 +AUX apcupsd-tmpfiles.conf 39 SHA256 b00cd1a31de70a172698d486583aa79113b99c1bb4b882ab906d0e37504d7f55 SHA512 1030992a19558e79a9dddef88b508f9d9aa352223b1031f80751b2ee04821d53a185fe89cd20a7e6677709ac29179accd220a5489488b808b1280dcb2682b578 WHIRLPOOL e34d8064df32f7666e4860b49430b2434b0afb5ee7260d200329373e80a4e81416cee5616aec7ebae7005faac59060d9050fb419f4c75c2bf13024a72b445b32 AUX apcupsd-udev.rules 328 SHA256 0865097a99b321301ec5b0bb51d0560a01df0a21cca0ee0df61f8d33f888b86a SHA512 ba2ebb9f28011548c845a81f17a328b98ec8d79c1e6be33aeab863d77b9d3aa61b4dfbd1bb89a0cae00465387dffe8cc223634a6e9a2f59170846d4bed9e7135 WHIRLPOOL ec304d772bcbcd5ba3cec1437a097d6159ad1f8b8e2bde49125d6cb1970bbc6f1de6264ba35a719431aed83f88210a583bb20fab0b771c115aaa93bf1db8c867 AUX apcupsd.init.2a 844 SHA256 86be1bafb0cf72db61def444361c659e5c36d0e44b1a007772b3f49aa0e95bcb SHA512 e86dfc3b7b8a0dbca59225795a5e996176b9a064720f4c2f6c1efc27cdf2eb0ecbdb59180b24abde1af730b834303fdf31564ec3b86a46d29ebe19abfdd48494 WHIRLPOOL e7d1e8dcb61862061d1889436c9157d95ed6a86a60aca54a0dda2120f3f5410fb700c0d889841b2013808faa349f90033a34e53eecd407df4089c58fea551f56 AUX apcupsd.init.3 659 SHA256 c3186646f06666ebd1ef265f5f6d56aeff27587face610d5f73c625b5c6053cc SHA512 fdaf68b4191dd04616c81035f8cfeafccb400a55273675b4125e67d28c3d23dc08446805e6553c868abf474773ce3a1fb36acbfbad9b85e4b6a57b7a170e01b2 WHIRLPOOL 0ea76a163c008f01d0bf8aa09219cce3a4ba6ada9f88d70b660dc06815227df37fdc82eb1b6987ec76a2cafc4f9cafa842d4ad9d81d017ef1c6d450efb077bc8 AUX apcupsd.powerfail.init 520 SHA256 eee773aa07175674085cb0ab7ed2c071fcc04fc05383d368f38d056e7327ff35 SHA512 d946d9b3427e0269d87aba1d6048cc4c73d767b1f5bc7d112718b82ec60076123e302dc0a73a4e5bbb7d1137ff78fc87a61983622a765341cfd7a79dcd0817ad WHIRLPOOL 1639496c976c6b654c20b953d675916636e44e7e3097696850bd202c91a9ffb713b398a86a2777b93472bccd3179aa83fb63ce43a1bbbe47e99f320ba8282a9c +AUX apcupsd.service 111 SHA256 fef0b088daa7d652b8c30e6105318cff547ad2504627efabd014083eabc7182d SHA512 011e3e52e7909f36fb73b6064277a69e5db41263cfc72bda07e326172396d5318cd2b050f1fb84c4cc6da7a247c0035c36c55322ffb234a1cfa7bf13ba492889 WHIRLPOOL 940b6eb812c010f32b4bf54fd3e1b8d0a47890fd88acd8451bccbf6d17ab894915b179c110dda561c120e346ed20ca481f47761b9a5bac1e3b323457fbbc6f5a DIST apcupsd-3.14.10.tar.gz 1336852 SHA256 0707b5ec9916fbde9e44eb8d18037c8d8f75dfd6aeef51aba5487e189eef2032 SHA512 f95918bff783cb60fa40b03a532ee7447293b0542f44f2f9ecf36ee028df3aa414f01e2b834a28fc319d88ec2e84c81314cd546b5628554176f2ca47fdc66bbc WHIRLPOOL 1fb40a5199eb8dfcd287bab08c2bbf51f02a3657ba615e16395d5f377bc9a5b6144db24b83ef5e9172ff970a715f87f685118a035c00372c34702984fac02d38 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 diff --git a/sys-power/apcupsd/apcupsd-3.14.10-r2.ebuild b/sys-power/apcupsd/apcupsd-3.14.10-r2.ebuild new file mode 100644 index 00000000..6cd47ed7 --- /dev/null +++ b/sys-power/apcupsd/apcupsd-3.14.10-r2.ebuild @@ -0,0 +1,139 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/apcupsd-3.14.10-r2.ebuild,v 1.1 2013/08/31 12:46:20 pacho 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 nls gnome kernel_linux" + +DEPEND=" + cgi? ( >=media-libs/gd-1.8.4 ) + nls? ( sys-devel/gettext ) + snmp? ( net-analyzer/net-snmp ) + 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" + epatch "${FILESDIR}/${PN}-3.14.10-mib.patch" +} + +src_configure() { + local myconf + 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 --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 --enable-pcnet \ + --with-distname=gentoo \ + $(use_enable snmp net-snmp) \ + $(use_enable gnome gapcmon) \ + ${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 + + dodoc ChangeLog* ReleaseNotes + doman doc/*.8 doc/*.5 + + dohtml -r doc/manual/* + + rm "${D}"/etc/init.d/apcupsd + newinitd "${FILESDIR}/${PN}.init.3" "${PN}" + newinitd "${FILESDIR}/${PN}.powerfail.init" "${PN}".powerfail + systemd_dounit "${FILESDIR}"/${PN}.service + systemd_dotmpfilesd "${FILESDIR}"/${PN}-tmpfiles.conf + + # 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 kernel_linux; then + udev_newrules "${FILESDIR}"/apcupsd-udev.rules 60-${PN}.rules + fi + + # 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! + keepdir /var/lock + fowners root:uucp /var/lock + fperms 0775 /var/lock +} + +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 +} diff --git a/sys-power/apcupsd/files/apcupsd-tmpfiles.conf b/sys-power/apcupsd/files/apcupsd-tmpfiles.conf new file mode 100644 index 00000000..0ceb4106 --- /dev/null +++ b/sys-power/apcupsd/files/apcupsd-tmpfiles.conf @@ -0,0 +1,2 @@ +r /etc/apcupsd/powerfail +r /etc/nologin
\ No newline at end of file diff --git a/sys-power/apcupsd/files/apcupsd.service b/sys-power/apcupsd/files/apcupsd.service new file mode 100644 index 00000000..9cec6e44 --- /dev/null +++ b/sys-power/apcupsd/files/apcupsd.service @@ -0,0 +1,8 @@ +[Unit] +Description=APC UPS Monitor + +[Service] +ExecStart=/sbin/apcupsd -b + +[Install] +WantedBy=multi-user.target |