Permalink
Browse files

FL-593: unfork apcupsd, invalid report

  • Loading branch information...
1 parent 9ac21a8 commit 2f0468211fa5501559ea51665b5b0f969dccffad @angryvincent angryvincent committed Jul 17, 2013
@@ -1 +0,0 @@
-DIST apcupsd-3.14.10.tar.gz 1336852 SHA256 0707b5ec9916fbde9e44eb8d18037c8d8f75dfd6aeef51aba5487e189eef2032 SHA512 f95918bff783cb60fa40b03a532ee7447293b0542f44f2f9ecf36ee028df3aa414f01e2b834a28fc319d88ec2e84c81314cd546b5628554176f2ca47fdc66bbc WHIRLPOOL 1fb40a5199eb8dfcd287bab08c2bbf51f02a3657ba615e16395d5f377bc9a5b6144db24b83ef5e9172ff970a715f87f685118a035c00372c34702984fac02d38
@@ -1,135 +0,0 @@
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=4
-
-inherit eutils linux-info flag-o-matic 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="*"
-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}-mail.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
-
- # 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."
- 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
-}
@@ -1,39 +0,0 @@
-Index: apcupsd-3.14.9/src/apctest.c
-===================================================================
---- apcupsd-3.14.9.orig/src/apctest.c
-+++ apcupsd-3.14.9/src/apctest.c
-@@ -2206,18 +2206,18 @@ static struct {
- const char *config_directive;
- const char *descript;
- char type;
-- int *data;
-+ void *data;
- } cmd_table[] = {
- {'u', "HITRANSFER", "Upper transfer voltage", 'i', &eeprom_ups.hitrans},
- {'l', "LOTRANSFER", "Lower transfer voltage", 'i', &eeprom_ups.lotrans},
- {'e', "RETURNCHARGE", "Return threshold", 'i', &eeprom_ups.rtnpct},
- {'o', "OUTPUTVOLTS", "Output voltage on batts", 'i', &eeprom_ups.NomOutputVoltage},
-- {'s', "SENSITIVITY", "Sensitivity", 'c', (int *)eeprom_ups.sensitivity},
-+ {'s', "SENSITIVITY", "Sensitivity", 'c', eeprom_ups.sensitivity},
- {'q', "LOWBATT", "Low battery warning", 'i', &eeprom_ups.dlowbatt},
- {'p', "SLEEP", "Shutdown grace delay", 'i', &eeprom_ups.dshutd},
-- {'k', "BEEPSTATE", "Alarm delay", 'c', (int *)eeprom_ups.beepstate},
-+ {'k', "BEEPSTATE", "Alarm delay", 'c', eeprom_ups.beepstate},
- {'r', "WAKEUP", "Wakeup delay", 'i', &eeprom_ups.dwake},
-- {'E', "SELFTEST", "Self test interval", 'c', (int *)eeprom_ups.selftest},
-+ {'E', "SELFTEST", "Self test interval", 'c', eeprom_ups.selftest},
- {0, NULL, NULL} /* Last entry */
- };
-
-@@ -2240,9 +2240,9 @@ static void print_valid_eeprom_values(UP
- for (j = 0; cmd_table[j].cmd; j++) {
- if (cmd[i].cmd == cmd_table[j].cmd) {
- if (cmd_table[j].type == 'c')
-- asnprintf(val, sizeof(val), "%s", (char *)cmd_table[j].data);
-+ asnprintf(val, sizeof(val), "%s", cmd_table[j].data);
- else
-- asnprintf(val, sizeof(val), "%d", *cmd_table[j].data);
-+ asnprintf(val, sizeof(val), "%d", *((int*)cmd_table[j].data));
-
- pmsg("%-24s %-12s %-6s ", cmd_table[j].descript,
- cmd_table[j].config_directive, val);
@@ -1,96 +0,0 @@
-diff -Nuar apcupsd-3.14.10/examples/hid-ups.c apcupsd-3.14.10-fixed/examples/hid-ups.c
---- apcupsd-3.14.10/examples/hid-ups.c 2007-07-17 22:54:25.000000000 +0000
-+++ apcupsd-3.14.10-fixed/examples/hid-ups.c 2013-07-05 01:24:59.624237143 +0000
-@@ -223,7 +223,7 @@
- #ifndef TESTING
- char buf[256];
- printf("[Log message \"%s\"]\n", msg);
-- sprintf(buf, "/bin/echo %s | /bin/mail -s \"UPS System\" %s", msg, MADDR);
-+ sprintf(buf, "/bin/echo %s | /bin/mail \"UPS System\" %s", msg, MADDR);
- system(buf);
- #else
- printf("[Log message \"%s\"]\n", msg);
-diff -Nuar apcupsd-3.14.10/examples/offbattery.cpufreq apcupsd-3.14.10-fixed/examples/offbattery.cpufreq
---- apcupsd-3.14.10/examples/offbattery.cpufreq 2005-09-18 05:25:28.000000000 +0000
-+++ apcupsd-3.14.10-fixed/examples/offbattery.cpufreq 2013-07-05 01:21:45.420205861 +0000
-@@ -37,6 +37,6 @@
- done
- echo " "
- /sbin/apcaccess status
--) | $APCUPSD_MAIL -s "$MSG" $SYSADMIN
-+) | $APCUPSD_MAIL "$MSG" $SYSADMIN
- exit 0
-
-diff -Nuar apcupsd-3.14.10/examples/onbattery.cpufreq apcupsd-3.14.10-fixed/examples/onbattery.cpufreq
---- apcupsd-3.14.10/examples/onbattery.cpufreq 2005-09-18 05:25:28.000000000 +0000
-+++ apcupsd-3.14.10-fixed/examples/onbattery.cpufreq 2013-07-05 01:22:15.196428585 +0000
-@@ -50,6 +50,6 @@
- done
- echo " "
- /sbin/apcaccess status
--) | $APCUPSD_MAIL -s "$MSG" $SYSADMIN
-+) | $APCUPSD_MAIL "$MSG" $SYSADMIN
- exit 0
-
-diff -Nuar apcupsd-3.14.10/platforms/etc/changeme.in apcupsd-3.14.10-fixed/platforms/etc/changeme.in
---- apcupsd-3.14.10/platforms/etc/changeme.in 2003-09-02 07:55:35.000000000 +0000
-+++ apcupsd-3.14.10-fixed/platforms/etc/changeme.in 2013-07-05 01:22:41.513419107 +0000
-@@ -17,5 +17,5 @@
- echo "$MSG"
- echo " "
- @sbindir@/apcaccess status
--) | $APCUPSD_MAIL -s "$MSG" $SYSADMIN
-+) | $APCUPSD_MAIL "$MSG" $SYSADMIN
- exit 0
-diff -Nuar apcupsd-3.14.10/platforms/etc/commfailure.in apcupsd-3.14.10-fixed/platforms/etc/commfailure.in
---- apcupsd-3.14.10/platforms/etc/commfailure.in 2005-08-30 18:06:02.000000000 +0000
-+++ apcupsd-3.14.10-fixed/platforms/etc/commfailure.in 2013-07-05 01:23:05.255348086 +0000
-@@ -17,5 +17,5 @@
- echo "$MSG"
- echo " "
- @sbindir@/apcaccess status
--) | $APCUPSD_MAIL -s "$MSG" $SYSADMIN
-+) | $APCUPSD_MAIL "$MSG" $SYSADMIN
- exit 0
-diff -Nuar apcupsd-3.14.10/platforms/etc/commok.in apcupsd-3.14.10-fixed/platforms/etc/commok.in
---- apcupsd-3.14.10/platforms/etc/commok.in 2005-08-30 18:06:02.000000000 +0000
-+++ apcupsd-3.14.10-fixed/platforms/etc/commok.in 2013-07-05 01:23:23.958239863 +0000
-@@ -17,5 +17,5 @@
- echo "$MSG"
- echo " "
- @sbindir@/apcaccess status
--) | $APCUPSD_MAIL -s "$MSG" $SYSADMIN
-+) | $APCUPSD_MAIL "$MSG" $SYSADMIN
- exit 0
-diff -Nuar apcupsd-3.14.10/platforms/etc/offbattery.in apcupsd-3.14.10-fixed/platforms/etc/offbattery.in
---- apcupsd-3.14.10/platforms/etc/offbattery.in 2005-06-07 22:44:58.000000000 +0000
-+++ apcupsd-3.14.10-fixed/platforms/etc/offbattery.in 2013-07-05 01:23:41.349458577 +0000
-@@ -17,5 +17,5 @@
- echo "$MSG"
- echo " "
- @sbindir@/apcaccess status
--) | $APCUPSD_MAIL -s "$MSG" $SYSADMIN
-+) | $APCUPSD_MAIL "$MSG" $SYSADMIN
- exit 0
-diff -Nuar apcupsd-3.14.10/platforms/etc/onbattery.in apcupsd-3.14.10-fixed/platforms/etc/onbattery.in
---- apcupsd-3.14.10/platforms/etc/onbattery.in 2003-09-02 07:55:35.000000000 +0000
-+++ apcupsd-3.14.10-fixed/platforms/etc/onbattery.in 2013-07-05 01:23:59.152365488 +0000
-@@ -17,5 +17,5 @@
- echo "$MSG"
- echo " "
- @sbindir@/apcaccess status
--) | $APCUPSD_MAIL -s "$MSG" $SYSADMIN
-+) | $APCUPSD_MAIL "$MSG" $SYSADMIN
- exit 0
-diff -Nuar apcupsd-3.14.10/src/win32/email.c apcupsd-3.14.10-fixed/src/win32/email.c
---- apcupsd-3.14.10/src/win32/email.c 2007-06-17 12:54:10.000000000 +0000
-+++ apcupsd-3.14.10-fixed/src/win32/email.c 2013-07-05 01:25:50.292333727 +0000
-@@ -2,7 +2,7 @@
- * Dumb program to send an email message
- *
- * Called:
-- * email -s "Subject" address@somewhere.com -m "Body of text"
-+ * email "Subject" address@somewhere.com -m "Body of text"
- *
- * Kern Sibbald, October MM
- */
@@ -1,10 +0,0 @@
-# do not edit this file, it will be overwritten on update
-
-ACTION!="add", GOTO="apcupsd_end"
-SUBSYSTEM!="usb", GOTO="apcupsd_end"
-ENV{ID_VENDOR}=="", IMPORT{program}="usb_id --export %p"
-ENV{ID_VENDOR_ID}!="051d", GOTO="apcupsd_end"
-
-KERNEL=="?*", SYMLINK+="apcups/by-id/$env{ID_BUS}-$env{ID_SERIAL_SHORT}"
-
-LABEL="apcupsd_end"
@@ -1,37 +0,0 @@
-#!/sbin/runscript
-# Copyright 1999-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/files/apcupsd.init.2a,v 1.1 2011/08/29 13:38:55 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 $?
-}
-
@@ -1,28 +0,0 @@
-#!/sbin/runscript
-# Copyright 1999-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/files/apcupsd.init.3,v 1.1 2011/10/21 22:06:43 flameeyes Exp $
-
-INSTANCE="${SVCNAME#*.}"
-if [ -z "${INSTANCE}" -o "${SVCNAME}" = "apcupsd" ]; then
- INSTANCE="apcupsd"
-fi
-
-name="APC UPS Daemon"
-
-pidfile=/var/run/${SVCNAME}.pid
-
-command=/sbin/apcupsd
-command_args="-f /etc/apcupsd/${INSTANCE}.conf -P ${pidfile}"
-start_stop_daemon_args="--wait 300 --retry TERM/5/TERM/5"
-
-depend() {
- use net
- after udev
-}
-
-start_pre() {
- rm -f /etc/apcupsd/powerfail
-
- export SERVICE="${SVCNAME}"
-}
@@ -1,18 +0,0 @@
-#!/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.2 2009/03/22 15:22:28 flameeyes Exp $
-
-description='Signal the UPS to kill power in a power failure condition'
-
-depend() {
- need mount-ro
-}
-
-start() {
- if [ "$(runlevel | cut -d' ' -f2)" = "0" -a -f /etc/apcupsd/powerfail ] ; then
- ebegin 'Signaling UPS to kill power'
- /sbin/apcupsd --killpower
- eend $?
- fi
-}

0 comments on commit 2f04682

Please sign in to comment.