dcallagh-exheres

My personal Exherbo repository
git clone https://code.djc.id.au/git/dcallagh-exheres/

packages/sys-power/apcupsd/apcupsd-3.14.10.exheres-0 (2105B) - raw

      1 # Copyright 2011 Dan Callaghan <djc@djc.id.au>
      2 # Distributed under the terms of the GNU General Public License v2
      3 # Based in part upon apcupsd-3.14.8-r1.ebuild, which is:
      4 #   Copyright 1999-2011 Gentoo Foundation
      5 #   Distributed under the terms of the GNU General Public License v2
      6 
      7 require sourceforge [ suffix=tar.gz ] systemd-service
      8 
      9 SUMMARY="Monitoring daemon for APC UPSes"
     10 DESCRIPTION="
     11 Apcupsd can be used for power mangement and controlling most of APC's UPS models. Apcupsd works with 
     12 most of APC's Smart-UPS models as well as most simple signalling models such a Back-UPS, and 
     13 BackUPS-Office. During a power failure, apcupsd will inform the users about the power failure and 
     14 that a shutdown may occur. If power is not restored, a system shutdown will follow when the battery 
     15 is exhausted, a timeout (seconds) expires, or runtime expires based on internal APC calculations 
     16 determined by power consumption rates.
     17 "
     18 HOMEPAGE="http://www.apcupsd.com/"
     19 
     20 LICENCES="GPL-2"
     21 SLOT="0"
     22 PLATFORMS="~amd64 ~x86"
     23 MYOPTIONS="usb"
     24 
     25 DEPENDENCIES="
     26     build:
     27         dev-util/pkg-config
     28     run:
     29         mail-client/mailx
     30 "
     31 
     32 BUGS_TO="djc@djc.id.au"
     33 
     34 src_configure() {
     35     unset LD # build uses LD where it means CC, let's not confuse it
     36     econf \
     37         --hates=docdir \
     38         $(option_enable usb) \
     39         --sysconfdir=/etc/apcupsd \
     40         --with-pwrfail-dir=/etc/apcupsd \
     41         --with-pid-dir=/run \
     42         --with-lock-dir=/run/lock \
     43         --with-log-dir=/var/log \
     44         --enable-net \
     45         --enable-snmp \
     46         --enable-pcnet \
     47         --enable-dumb \
     48         --enable-apcsmart \
     49         --with-distname=unknown \
     50         APCUPSD_MAIL=/bin/mail
     51 }
     52 
     53 src_compile() {
     54     export MANPAGER=$(type -p cat)
     55     default
     56 }
     57 
     58 src_install() {
     59     default
     60     dodoc ReleaseNotes Developers
     61 
     62     edo rm -r "${IMAGE}usr/share/hal"
     63     edo rm "${IMAGE}sbin/smtp" # we use mailx instead
     64 
     65     insinto /etc/apcupsd
     66     newins examples/safe.apccontrol safe.apccontrol
     67 
     68     install_systemd_files
     69     insinto /usr/${LIBDIR}/tmpfiles.d
     70     hereins apcupsd.conf <<EOF
     71 d /run/lock 0755 root root -
     72 EOF
     73 }
     74