summaryrefslogtreecommitdiffstats
path: root/abs/extra/network-ups-tools/PKGBUILD
blob: 50afbcc1fc785ec77b62d4d23a8ab8b09abaa092 (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
# Maintainer: Alex Reznichenko <sa5gap@yandex.ru>
# Contributor: Roman Kyrylych <roman@archlinux.org>
# Contributor: Giuseppe Lucarelli <luk@rebelsoft.org>

pkgname=network-ups-tools
pkgver=2.6.5
pkgrel=2
pkgdesc="NUT is a collection of programs for monitoring and administering UPS hardware"
arch=('i686' 'x86_64')
url="http://www.networkupstools.org/"
license=('GPL2')
depends=('openssl' 'libusb-compat')
makedepends=()
backup=(etc/ups/{ups.conf,upsd.conf,upsd.users,upsmon.conf,upssched.conf})
install=nut.install
source=("http://www.networkupstools.org/source/2.6/nut-$pkgver.tar.gz"
		'upsd.init' 'nut-driver.service.patch')
options=('!emptydirs' '!libtool')
md5sums=('e6eac4fa04baff0d0a827d64efe81a7e'
         '089ea4a56552253328d17603ff5670cc'
         'ee3aa25a08caca24f51951ee1f090c44')

build() {

  cd $srcdir/nut-$pkgver
  ./configure \
	--without-wrap \
    --with-user=ups \
    --with-group=nut \
    --with-usb \
    --prefix=/usr \
    --with-udev-dir=/usr/lib/udev \
    --with-systemdsystemunitdir=/lib/systemd/system \
    --datadir=/usr/share/ups \
    --sysconfdir=/etc/ups || return 1

  make || return 1

}

package() {

  cd $srcdir/nut-$pkgver
  make DESTDIR=$pkgdir install || return 1

  install -D -m755 $startdir/upsd.init $pkgdir/etc/rc.d/upsd || return 1
  install -D -m644 conf/ups.conf.sample $pkgdir/etc/ups/ups.conf
  install -D -m640 conf/upsd.conf.sample $pkgdir/etc/ups/upsd.conf
  install -D -m640 conf/upsd.users.sample $pkgdir/etc/ups/upsd.users
  install -D -m640 conf/upsmon.conf.sample $pkgdir/etc/ups/upsmon.conf
  install -D -m644 conf/upssched.conf.sample $pkgdir/etc/ups/upssched.conf

  # Fix systemd's nut-driver.service
  cd $pkgdir
  patch -p1 < ../nut-driver.service.patch

}