summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Bruhin2022-04-09 13:06:53 +0200
committerFlorian Bruhin2022-04-09 13:06:53 +0200
commitb6b1874e28a12e8987a81de66781331f0f830a29 (patch)
tree53aa81e5cf87b921fb7fb93be07361c9a83017d3
parent3ce7c0be14007d028efee041fe869ab135254067 (diff)
downloadaur-b6b1874e28a12e8987a81de66781331f0f830a29.tar.gz
Rebase on community package
-rw-r--r--.SRCINFO45
-rw-r--r--PKGBUILD134
-rw-r--r--nut.install18
-rw-r--r--nut.sysusers2
-rw-r--r--nut.tmpfiles6
5 files changed, 122 insertions, 83 deletions
diff --git a/.SRCINFO b/.SRCINFO
index e1e686c18af0..e788e30bffab 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,32 +1,43 @@
-# Generated by mksrcinfo v8
-# Fri Apr 28 20:14:20 UTC 2017
pkgbase = network-ups-tools-git
- pkgdesc = NUT is a collection of programs for monitoring and administering UPS hardware
- pkgver = v2.7.4.r371.g30e04684
+ pkgdesc = A collection of programs which provide a common interface for monitoring and administering UPS, PDU and SCD hardware
+ pkgver = 2.7.4.r5111.g88acc3578
pkgrel = 1
- url = http://www.networkupstools.org/
+ url = https://networkupstools.org/
install = nut.install
- arch = i686
arch = x86_64
- arch = armv6h
- arch = armv7h
license = GPL2
+ license = GPL3
makedepends = asciidoc
+ makedepends = gd
makedepends = git
- depends = openssl-1.0
+ makedepends = python
+ depends = gcc-libs
+ depends = glibc
+ depends = libtool
depends = libusb-compat
- depends = libltdl
depends = neon
depends = net-snmp
+ depends = openssl
+ optdepends = gd: CGI support
provides = network-ups-tools
+ provides = nut
conflicts = network-ups-tools
- 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
+ conflicts = nut
+ options = !makeflags
+ backup = etc/nut/hosts.conf
+ backup = etc/nut/nut.conf
+ backup = etc/nut/ups.conf
+ backup = etc/nut/upsd.conf
+ backup = etc/nut/upsd.users
+ backup = etc/nut/upsmon.conf
+ backup = etc/nut/upssched.conf
+ backup = etc/nut/upsstats.html
+ backup = etc/nut/upsstats-single.html
source = git+https://github.com/networkupstools/nut.git
- md5sums = SKIP
+ source = nut.sysusers
+ source = nut.tmpfiles
+ sha256sums = SKIP
+ sha256sums = 3001e24969545136361670c5d615684d2b37830525e090c2ab3bcfa90d90e4ac
+ sha256sums = c924ccaae9ec75ee7795c872e1708d10201402642a6d5de2304cc644744bbcc5
pkgname = network-ups-tools-git
-
diff --git a/PKGBUILD b/PKGBUILD
index 148fb373131f..037fb4c27a25 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,79 +1,113 @@
# Maintainer: Florian Bruhin (The Compiler) <archlinux.org@the-compiler.org>
+# Contributor: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Alex Reznichenko <sa5gap@yandex.ru>
# Contributor: Roman Kyrylych <roman@archlinux.org>
# Contributor: Giuseppe Lucarelli <luk@rebelsoft.org>
# Contributor: Dan Ziemba <zman0900@gmail.com>
pkgname=network-ups-tools-git
-pkgver=v2.7.4.r371.g30e04684
+pkgver=2.7.4.r5111.g88acc3578
pkgrel=1
-pkgdesc="NUT is a collection of programs for monitoring and administering UPS hardware"
-arch=('i686' 'x86_64' 'armv6h' 'armv7h')
-url="http://www.networkupstools.org/"
-license=('GPL2')
-depends=('openssl-1.0' 'libusb-compat' 'libltdl' 'neon' 'net-snmp')
-provides=('network-ups-tools')
-conflicts=('network-ups-tools')
-makedepends=('asciidoc' 'git')
-backup=(etc/ups/{ups.conf,upsd.conf,upsd.users,upsmon.conf,upssched.conf})
+pkgdesc='A collection of programs which provide a common interface for monitoring and administering UPS, PDU and SCD hardware'
+arch=(x86_64)
+url=https://networkupstools.org/
+license=(
+ GPL2
+ GPL3
+)
+depends=(
+ gcc-libs
+ glibc
+ libtool
+ libusb-compat
+ neon
+ net-snmp
+ openssl
+)
+makedepends=(
+ asciidoc
+ gd
+ git
+ python
+)
+optdepends=('gd: CGI support')
+provides=(network-ups-tools nut)
+conflicts=(network-ups-tools nut)
+options=(!makeflags)
install=nut.install
-source=("git+https://github.com/networkupstools/nut.git")
-options=()
-md5sums=('SKIP')
+backup=(
+ etc/nut/hosts.conf
+ etc/nut/nut.conf
+ etc/nut/ups.conf
+ etc/nut/upsd.conf
+ etc/nut/upsd.users
+ etc/nut/upsmon.conf
+ etc/nut/upssched.conf
+ etc/nut/upsstats.html
+ etc/nut/upsstats-single.html
+)
+source=(
+ git+https://github.com/networkupstools/nut.git
+ nut.sysusers
+ nut.tmpfiles
+)
+sha256sums=('SKIP'
+ '3001e24969545136361670c5d615684d2b37830525e090c2ab3bcfa90d90e4ac'
+ 'c924ccaae9ec75ee7795c872e1708d10201402642a6d5de2304cc644744bbcc5')
pkgver() {
- cd "$srcdir/nut"
- git describe --long | sed -E 's/([^-]*-g)/r\1/;s/-/./g'
+ cd nut
+ git describe --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare() {
- find "$srcdir/nut" -name '*.py' -exec sed -i 's|^#!/usr/bin/env python|&2|' {} \;
+ cd nut
+ ./autogen.sh
}
build() {
- cd "$srcdir/nut"
- export PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig
- ./autogen.sh
+ cd nut
+
./configure \
- --without-wrap \
- --with-user=ups \
- --with-group=nut \
+ --prefix=/usr \
+ --datadir=/usr/share/nut \
+ --sbindir=/usr/bin \
+ --sysconfdir=/etc/nut \
--disable-static \
+ --with-user=nut \
+ --with-group=nut \
+ --with-altpidpath=/run/nut \
+ --with-cgipath=/usr/share/nut/cgi \
+ --with-drvpath=/usr/lib/nut \
+ --with-htmlpath=/usr/share/nut/html \
+ --with-pidpath=/run/nut \
+ --with-statepath=/var/lib/nut \
+ --with-systemdsystemunitdir=/usr/lib/systemd/system \
+ --with-udev-dir=/usr/lib/udev \
+ --with-cgi \
+ --with-dev \
+ --with-doc=html-single \
+ --with-libltdl \
+ --with-neon \
+ --with-openssl \
--with-serial \
+ --with-snmp \
--with-usb \
- --with-doc=html-single \
--without-avahi \
- --with-snmp \
- --with-neon \
- --without-powerman \
+ --without-doc \
--without-ipmi \
--without-freeipmi \
- --with-libltdl \
- --without-cgi \
- --prefix=/usr \
- --with-udev-dir=/usr/lib/udev \
- --with-systemdsystemunitdir=/usr/lib/systemd/system \
- --datadir=/usr/share/ups \
- --sbindir=/usr/bin \
- --with-drvpath=/usr/lib/network-ups-tools \
- --sysconfdir=/etc/ups \
- --with-openssl \
- --with-dev
- make
+ --without-powerman \
+ --without-wrap
+ make -j1
}
package() {
- cd "$srcdir/nut"
- 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"
+ make DESTDIR="${pkgdir}" -C nut install
+ find "${pkgdir}"/etc/nut -name *.sample -exec rename '.sample' '' {} \;
- install -d -v -m755 "$pkgdir/usr/share/doc/network-ups-tools/images/cables"
- install -v -m 644 docs/*.html "$pkgdir/usr/share/doc/network-ups-tools"
- install -v -m 644 docs/images/*.png "$pkgdir/usr/share/doc/network-ups-tools/images"
- install -v -m 644 docs/images/cables/*.{png,jpg} "$pkgdir/usr/share/doc/network-ups-tools/images/cables"
+ install -Dm 644 nut.sysusers "${pkgdir}"/usr/lib/sysusers.d/nut.conf
+ install -Dm 644 nut.tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/nut.conf
}
+
+# vim: ts=2 sw=2 et:
diff --git a/nut.install b/nut.install
index 1eca341b939d..9e76f7b8b710 100644
--- a/nut.install
+++ b/nut.install
@@ -1,18 +1,4 @@
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."
+ echo ">>> This package was rebased on the [community] one."
+ echo ">>> Thus, nut will now run as the 'nut' rather than 'ups' user."
}
-
-pre_remove() {
- userdel ups >/dev/null 2>&1
- groupdel nut >/dev/null 2>&1
- rm -rf /var/state/ups/
-}
-
diff --git a/nut.sysusers b/nut.sysusers
new file mode 100644
index 000000000000..476b0384f38a
--- /dev/null
+++ b/nut.sysusers
@@ -0,0 +1,2 @@
+u nut - "Network UPS Tools" /var/lib/nut
+m nut uucp
diff --git a/nut.tmpfiles b/nut.tmpfiles
new file mode 100644
index 000000000000..279b92b65687
--- /dev/null
+++ b/nut.tmpfiles
@@ -0,0 +1,6 @@
+d /run/nut 0700 nut nut -
+d /var/lib/nut 0700 nut nut -
+z /etc/nut/upsd.conf 0640 root nut -
+z /etc/nut/upsd.users 0640 root nut -
+z /etc/nut/upsmon.conf 0640 root nut -
+