summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Bruhin2014-02-24 16:30:16 +0100
committerFlorian Bruhin2014-02-24 16:30:16 +0100
commit41f7bdc2f6be8c20cdc33612b9d590f66470822f (patch)
treefbde8f6bfcbca354442335f5644a4384c01210cb
downloadaur-41f7bdc2f6be8c20cdc33612b9d590f66470822f.tar.gz
Add NUT
-rw-r--r--.SRCINFO26
-rw-r--r--PKGBUILD48
-rw-r--r--nut.install18
3 files changed, 92 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..5f0ff6cce12
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,26 @@
+pkgbase = network-ups-tools
+ pkgdesc = NUT is a collection of programs for monitoring and administering UPS hardware
+ pkgver = 2.7.1
+ pkgrel = 2
+ url = http://www.networkupstools.org/
+ install = nut.install
+ arch = i686
+ arch = x86_64
+ license = GPL2
+ depends = openssl
+ depends = libusb-compat
+ depends = libltdl
+ options = !emptydirs
+ options = !libtool
+ backup = etc/ups/ups.conf
+ backup = etc/ups/upsd.conf
+ backup = etc/ups/upsd.users
+ backup = etc/ups/upsmon.conf
+ backup = etc/ups/upssched.conf
+ source = http://www.networkupstools.org/source/2.7/nut-2.7.1.tar.gz
+ source = http://www.networkupstools.org/source/2.7/nut-2.7.1.tar.gz.sig
+ sha256sums = 71a6d73ad6d910808126ba7f217ec1142a0c6709c63a22a099e7338960b2c798
+ sha256sums = SKIP
+
+pkgname = network-ups-tools
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..5e2d4dab991
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,48 @@
+# Maintainer: Florian Bruhin (The Compiler) <archlinux.org@the-compiler.org>
+# Contributor: Alex Reznichenko <sa5gap@yandex.ru>
+# Contributor: Roman Kyrylych <roman@archlinux.org>
+# Contributor: Giuseppe Lucarelli <luk@rebelsoft.org>
+
+pkgname=network-ups-tools
+pkgver=2.7.1
+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' 'libltdl')
+makedepends=()
+backup=(etc/ups/{ups.conf,upsd.conf,upsd.users,upsmon.conf,upssched.conf})
+install=nut.install
+source=("http://www.networkupstools.org/source/2.7/nut-${pkgver}.tar.gz"
+"http://www.networkupstools.org/source/2.7/nut-${pkgver}.tar.gz.sig")
+options=('!emptydirs' '!libtool')
+sha256sums=('71a6d73ad6d910808126ba7f217ec1142a0c6709c63a22a099e7338960b2c798'
+'SKIP')
+
+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 \
+ --sbindir=/usr/bin \
+ --with-drvpath=/usr/bin \
+ --sysconfdir=/etc/ups
+ make
+}
+
+package() {
+ cd "$srcdir/nut-$pkgver"
+ make DESTDIR="$pkgdir" install
+ 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"
+}
diff --git a/nut.install b/nut.install
new file mode 100644
index 00000000000..1eca341b939
--- /dev/null
+++ b/nut.install
@@ -0,0 +1,18 @@
+post_install() {
+ groupadd -g 55 nut &> /dev/null
+ useradd -u 55 -g nut -G tty -d /var/state/ups -s /bin/false ups >/dev/null 2>&1
+ mkdir -p /var/state/ups/
+ chmod 0770 /var/state/ups/
+ chown root:nut /var/state/ups/
+ chown root:nut /etc/ups/upsd.conf /etc/ups/upsd.users /etc/ups/upsmon.conf
+ echo ">>> Before starting your UPSd daemon, you must"
+ echo ">>> edit /etc/ups/ups.conf in order to set your"
+ echo ">>> UPS driver and port."
+}
+
+pre_remove() {
+ userdel ups >/dev/null 2>&1
+ groupdel nut >/dev/null 2>&1
+ rm -rf /var/state/ups/
+}
+