# Contributor: Bram Prieshof # Contributor: Valery Kartel # Contributor: Kozak Ivan # Maintainer: Bram Prieshof pkgname=nut pkgver=2.8.2 pkgrel=3 pkgdesc="Network UPS tools" url="https://networkupstools.org/" arch="all" license="GPL-2.0-or-later" depends="hidapi libgd eudev udev-init-scripts-openrc" depends_dev="openssl-dev>3 libmodbus-dev libusb-dev net-snmp-dev neon-dev nss-dev gd-dev" makedepends="$depends_dev libtool autoconf automake" pkgusers=$pkgname pkggroups=$pkgname install="$pkgname.pre-install" subpackages="$pkgname-doc $pkgname-dev $pkgname-bash-completion $pkgname-openrc" source="https://networkupstools.org/source/${pkgver%.*}/nut-$pkgver.tar.gz powerfail.initd upsd.initd upsmon.initd " prepare() { default_prepare # fix version git init . git config user.name "abc" git config user.email "a@a" git add configure.ac git commit -m "$pkgver" git tag "$pkgver" autoreconf -fi } build() { CFLAGS="$CFLAGS -flto=auto" \ ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --libexecdir=/usr/lib/nut \ --without-wrap \ --with-user=$pkgname \ --with-group=$pkgname \ --disable-static \ --with-serial \ --with-usb \ --without-avahi \ --with-snmp \ --with-modbus \ --with-neon \ --without-powerman \ --without-ipmi \ --without-freeipmi \ --with-libltdl \ --with-cgi \ --with-drvpath=/usr/lib/nut \ --datadir=/usr/share/nut \ --sysconfdir=/etc/nut \ --with-statepath=/var/run/nut \ --with-altpidpath=/var/run/nut \ --with-udev-dir=/usr/lib/udev \ --with-nss \ --with-openssl make } check() { make check } package() { make DESTDIR="$pkgdir" install install -Dm755 "$srcdir"/powerfail.initd "$pkgdir"/etc/init.d/nut-powerfail.initd install -Dm755 "$srcdir"/upsd.initd "$pkgdir"/etc/init.d/nut-upsd install -Dm755 "$srcdir"/upsmon.initd "$pkgdir"/etc/init.d/nut-upsmon install -Dm644 "$builddir"/scripts/logrotate/nutlogd "$pkgdir"/etc/logrotate.d/$pkgname install -d -o $pkgname -g $pkgname "$pkgdir"/var/lib/$pkgname local CgiFile; for CgiFile in "$pkgdir"/usr/cgi-bin/*.cgi; do install -Dm755 -o root -g $pkgname -t "$pkgdir"/usr/cgi-bin/nut/ $CgiFile; done local HtmlFile; for HtmlFile in "$pkgdir"/usr/html/*; do install -Dm644 -o root -g $pkgname -t "$pkgdir"/usr/html/nut/ $HtmlFile; done rm "$pkgdir"/usr/cgi-bin/*.cgi "$pkgdir"/usr/html/*.html "$pkgdir"/usr/html/*.png install -D -m644 "$builddir"/scripts/misc/nut.bash_completion \ "$pkgdir"/usr/share/bash-completion/completions/$pkgname.bash local file; for file in "$pkgdir"/etc/nut/*.sample; do chmod 640 $file chown root:$pkgname $file mv $file ${file%.sample} done } sha512sums=" b6f8f22318e4a4fcb8073a63132b1cb083952c665191b82a7d6765a61b859575a4b0c2ba84ed17cfb8c88d34179876d64520dd2f75f02fe8707b406da2c0821c nut-2.8.2.tar.gz c32f693e9882602f847b714d2837172b18c0b2fb78cbbf95c0af43a59b3213e3241327890ae038573a9de114ab33bb43d69796c4683b5120ca49cd3174dd5f2d powerfail.initd 5fce1247815e36a0e787f28dfec215077a42b046f6ce35a5ad3cf94479dfc26303d3cf4d5f760d5851ed5273ee398572c36cd354af0645cbebc1f1560414e222 upsd.initd 32470ae473fc363131787cd57f13d40763898947d56d032790ba7f3a5eaa8038b602f7e395ca44f6c5adce8ee5ec496e30ca0eaadb3c78a38015677aea751e12 upsmon.initd "