aboutsummaryrefslogtreecommitdiffstats
path: root/main/apcupsd/APKBUILD
blob: b758c08be712c9828c19e6112fb83eb36db60f62 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=apcupsd
pkgver=3.14.14
pkgrel=1
pkgdesc="A Daemon to control APC UPSes"
subpackages="$pkgname-doc $pkgname-webif $pkgname-openrc"
url="http://www.apcupsd.org"
arch="all"
license="GPL-2.0-only"
depends="util-linux"
makedepends="net-snmp-dev man linux-headers gd-dev libusb-compat-dev"
options="!check" # no test suite included
source="https://sourceforge.net/projects/apcupsd/files/apcupsd%20-%20Stable/$pkgver/apcupsd-$pkgver.tar.gz
	apcupsd.initd
	apcupsd-alpine.patch
	"

_builddir="$srcdir/$pkgname-$pkgver"

prepare() {
	cd "$_builddir"
	update_config_sub
	default_prepare
}

build() {
	cd "$_builddir"

	export CHARSET="ISO8859-1"
	export LANG="C"

	ac_cv_path_SHUTDOWN="/sbin/poweroff" \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--enable-modbus-usb \
		--enable-usb \
		--enable-snmp \
		--enable-cgi
	make
}

package() {
	cd "$_builddir"
	make DESTDIR=$pkgdir install
	install -D -m755 "$srcdir"/apcupsd.initd "$pkgdir"/etc/init.d/apcupsd
}

webif() {
	cd "$_builddir"
	mkdir -p "$subpkgdir"/usr/share/webapps/apcupsd
	mv "$pkgdir"/etc/apcupsd/*.cgi "$subpkgdir"/usr/share/webapps/apcupsd
}

sha512sums="c953bbf3e08f809748a7978a3952604176390d1cd276f187fe096d9bc3c8993b52127e8350c0363387da41318e24b4d1e00ea58df71f3bb8f50c9a5a64cd2d7f  apcupsd-3.14.14.tar.gz
cd9cb3c812dfd72660007807965cac866dfb2ce4bd8200668f08e94fdcce874cce2ec87a0d832b8f37f254908d093aff0cc2db26e9403d5e613dc192072da617  apcupsd.initd
4f0712519213c4ef14f41eeef681c5498fac7bf42f205de8a855938f8e834d9488d86820d7c883e89d0d305ee287e17e2d321dbbc98ae12f8487bf58aa0d4a6b  apcupsd-alpine.patch"