aboutsummaryrefslogtreecommitdiffstats
path: root/testing/nut/APKBUILD
blob: 4ec2f85cf598e7c03910aaadcf26f8bdb7908512 (plain)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Contributor: Kozak Ivan <kozak-iv@yandex.ru>
# Maintainer: Kozak Ivan <kozak-iv@yandex.ru>
pkgname=nut
pkgver=2.7.4
pkgrel=2
pkgdesc="Network UPS tools - server"
url="http://www.networkupstools.org"
arch="all"
license="GPL"
depends_dev="libressl-dev libusb-compat-dev net-snmp-dev neon-dev"
makedepends="$depends_dev libtool autoconf automake"
pkgusers="nut"
pkggroups="nut"
install="$pkgname.pre-install"
subpackages="$pkgname-doc $pkgname-dev"
source="http://www.networkupstools.org/source/2.7/$pkgname-$pkgver.tar.gz
	nut.confd
	upsd.initd
	upsmon.initd
	"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--libexecdir=/lib/nut \
		--without-wrap \
		--with-user=nut	\
		--with-group=nut \
		--disable-static \
		--with-serial \
		--with-usb \
		--without-avahi \
		--with-snmp \
		--with-neon \
		--without-powerman \
		--without-ipmi \
		--without-freeipmi \
		--with-libltdl \
		--without-cgi \
		--with-drvpath=/usr/libexec/nut \
		--datadir=/usr/share/nut \
		--sysconfdir=/etc/nut \
		--with-statepath=/var/run/nut \
		--with-altpidpath=/var/run/nut \
		--with-openssl \
		|| return 1
	make || return 1
}

package() {
	local i
	cd "$builddir"

	make DESTDIR="$pkgdir" install || return 1
	chmod -R 640 "$pkgdir"/etc/nut || return 1
	chown -R root:nut "$pkgdir"/etc/nut || return 1

	for i in "$pkgdir"/etc/nut/*.sample; do
		mv $i ${i%.*} || return 1
	done

	for i in upsd upsmon; do
		install -Dm 755 "$srcdir"/$i.initd "$pkgdir"/etc/init.d/nut-$i || return 1
		install -Dm 644 "$srcdir"/nut.confd "$pkgdir"/etc/conf.d/nut-$i || return 1
	done
}

sha512sums="320c4aff85d8a370c5eff77d33924fdfc3caf6a250620693cdd5bf3336b3a80d8a207488eee841bcf8b72fbad68fda4c074e63b99c56e7886716fc934122d11a  nut-2.7.4.tar.gz
de59b3ab84553780874aeb9edf5faaa1fe19144406f58d40e878cc4cf520440d95a57645a6e3fdd84fdec77c6840ab2185b9554a423f7b9b8b6bca4a1795fb78  nut.confd
1a4b8ee42eb62b68170ef72e87115ae135905135d5d9bd48e837d18c73229c9da66e53cde4289faa1f4fdc2446195b3047bc1a66ae33bfb14cffb19dac403eb5  upsd.initd
d80f35af1e8ea2bb0da35af6a9bd2bfbc3b92d0cc0765a4d10d6cdce925225bb8200c7d9d2d77b1e5cc47593198dec3678403358538401f97644c61d8516adfb  upsmon.initd"