diff options
Diffstat (limited to 'abs/extra')
-rw-r--r-- | abs/extra/apcupsd/PKGBUILD | 47 | ||||
-rw-r--r-- | abs/extra/apcupsd/__changelog | 3 | ||||
-rw-r--r-- | abs/extra/apcupsd/apcupsd-tmpfiles.conf | 2 | ||||
-rw-r--r-- | abs/extra/apcupsd/apcupsd.install | 24 | ||||
-rw-r--r-- | abs/extra/apcupsd/apcupsd.service | 8 |
5 files changed, 84 insertions, 0 deletions
diff --git a/abs/extra/apcupsd/PKGBUILD b/abs/extra/apcupsd/PKGBUILD new file mode 100644 index 0000000..31a3cfa --- /dev/null +++ b/abs/extra/apcupsd/PKGBUILD @@ -0,0 +1,47 @@ +# $Id$ +# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com> +# Maintainer: Todd Musall <tmusall@comcast.net> +# Maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com> + +pkgname=apcupsd +pkgver=3.14.10 +pkgrel=7 +pkgdesc="Power mangement and controlling most of APC's UPS models" +arch=(i686 x86_64) +url="http://www.apcupsd.org" +license=('GPL') +install=apcupsd.install +depends=('gcc-libs') +optdepends=('gd: for CGI' + 'gconf: for frontend' + 'gtk2: for frontend') +makedepends=('pkgconfig' 'gd' 'gconf' 'gtk2') +backup=(etc/apcupsd/apcupsd.conf etc/apcupsd/hosts.conf + etc/apcupsd/multimon.conf) +source=(http://downloads.sourceforge.net/apcupsd/$pkgname-$pkgver.tar.gz + apcupsd.service + apcupsd-tmpfiles.conf) +sha256sums=('0707b5ec9916fbde9e44eb8d18037c8d8f75dfd6aeef51aba5487e189eef2032' + '145e88863335f077fc354b4d263b15f64af67b45a10ed37c68ebd468181e23f7' + 'b00cd1a31de70a172698d486583aa79113b99c1bb4b882ab906d0e37504d7f55') + +build() { + cd "$srcdir/$pkgname-$pkgver" + ./configure --prefix=/usr --libexecdir=/usr/lib/$pkgname \ + --sbindir=/usr/bin \ + --enable-cgi --enable-usb --enable-net \ + --with-upstype=usb --with-upscable=usb \ + --with-serial-dev=/dev/usb/hid/hiddev[0-9] \ + --enable-pthreads --enable-gapcmon + make +} + +package() { + cd "$srcdir/$pkgname-$pkgver" + make DESTDIR="$pkgdir" install + install -Dm644 "$srcdir/apcupsd.service" "$pkgdir/usr/lib/systemd/system/apcupsd.service" + install -Dm644 "$srcdir/apcupsd-tmpfiles.conf" "$pkgdir/usr/lib/tmpfiles.d/apcupsd.conf" + chmod 755 "$pkgdir"/usr/bin/* + install -dm755 "$pkgdir/usr/lib/$pkgname/cgi-bin" + mv "$pkgdir"/etc/apcupsd/*.cgi "$pkgdir/usr/lib/$pkgname/cgi-bin" +} diff --git a/abs/extra/apcupsd/__changelog b/abs/extra/apcupsd/__changelog new file mode 100644 index 0000000..3c43f29 --- /dev/null +++ b/abs/extra/apcupsd/__changelog @@ -0,0 +1,3 @@ +remove systemd-sysvcompat as dep +add apcupsd.install to have runit start the service + diff --git a/abs/extra/apcupsd/apcupsd-tmpfiles.conf b/abs/extra/apcupsd/apcupsd-tmpfiles.conf new file mode 100644 index 0000000..0ceb410 --- /dev/null +++ b/abs/extra/apcupsd/apcupsd-tmpfiles.conf @@ -0,0 +1,2 @@ +r /etc/apcupsd/powerfail +r /etc/nologin
\ No newline at end of file diff --git a/abs/extra/apcupsd/apcupsd.install b/abs/extra/apcupsd/apcupsd.install new file mode 100644 index 0000000..3f1e6b2 --- /dev/null +++ b/abs/extra/apcupsd/apcupsd.install @@ -0,0 +1,24 @@ +# This is a default template for a post-install scriptlet. You can +# remove any functions you don't need (and this header). + +# arg 1: the new package version +post_install() { + add_service.sh apcupsd + /sbin/sv start apcupsd +} + +# arg 1: the new package version +# arg 2: the old package version +post_upgrade() { + post_install +} + +# arg 1: the old package version +post_remove() { + /sbin/sv stop apcupsd + remove_service.sh apcupsd +} + +op=$1 +shift +$op $* diff --git a/abs/extra/apcupsd/apcupsd.service b/abs/extra/apcupsd/apcupsd.service new file mode 100644 index 0000000..b8dfb9b --- /dev/null +++ b/abs/extra/apcupsd/apcupsd.service @@ -0,0 +1,8 @@ +[Unit] +Description=APC UPS Monitor + +[Service] +ExecStart=/usr/bin/apcupsd -b + +[Install] +WantedBy=multi-user.target |