summaryrefslogtreecommitdiff
path: root/sys-power
diff options
context:
space:
mode:
Diffstat (limited to 'sys-power')
-rw-r--r--sys-power/Manifest.gzbin5062 -> 5060 bytes
-rw-r--r--sys-power/nut/Manifest12
-rw-r--r--sys-power/nut/files/nut-2.6.5-init.d-upsmon2
-rw-r--r--sys-power/nut/files/nut-2.8.0-fix-man-page-generation.patch64
-rw-r--r--sys-power/nut/files/nut-2.8.0-init.d-upsd37
-rw-r--r--sys-power/nut/files/nut.powerfail.initd1
-rw-r--r--sys-power/nut/files/systemd_notify.path50
-rw-r--r--sys-power/nut/metadata.xml18
-rw-r--r--sys-power/nut/nut-2.8.0-r1.ebuild220
-rw-r--r--sys-power/nut/nut-9999.ebuild262
10 files changed, 660 insertions, 6 deletions
diff --git a/sys-power/Manifest.gz b/sys-power/Manifest.gz
index 7a76a808143d..6a0dc9f181b3 100644
--- a/sys-power/Manifest.gz
+++ b/sys-power/Manifest.gz
Binary files differ
diff --git a/sys-power/nut/Manifest b/sys-power/nut/Manifest
index e8bcfb1d29cd..97bb05b92825 100644
--- a/sys-power/nut/Manifest
+++ b/sys-power/nut/Manifest
@@ -3,13 +3,19 @@ AUX nut-2.2.2-init.d-upsdrv 859 BLAKE2B 7911afe5ab45fa0123b43ac2fe186dbfa4eb9cb2
AUX nut-2.6.2-lowspeed-buffer-size.patch 553 BLAKE2B 2f758e7b807117e20b465951676ff524d1d2b52b5a69fcb09ad6811730c0038fff4b81cfcc1daaf6f0cfc6d5248be35c4be8b58f9193fe26028361c888ed1535 SHA512 59a953d3c89acccc3d5c028b36de15059f512d0a8074e7fed1d3831570bd09a544e44b5b754b4ad72f8163295db21160c142a83f4d608e40a401c9452823d7b7
AUX nut-2.6.5-init.d-upsd 671 BLAKE2B a8658d22ffdba585d9fd6de13a347a16e98182bd484c41f6eb8b3e38d94be6a4eea4475f2586d2a7d8146858bc14b2fd0e861a56681ae25a5ce3116a2b7d435c SHA512 79c36537fb40b8284afb8edc28afa0f98fdf96e8def0382278c6242b4602f1911e29a174825ee676f77aa609b6409ce3483a1d188354956d20be9862c4e78180
AUX nut-2.6.5-init.d-upslog 573 BLAKE2B 2a0e04f83990035beb12eee33cfe7ce4fdcd1f310a7ba6f2255e4ad3a1f76245acf4a66332eea5cce7765d914ce7c14f02da50ebb8fa8640c871a12f492ed28b SHA512 06ca7fa8f3fe729b07a919d2a0ecb573b8ac180c447f927504524fca18894e045492458271b9a15898861cb3839b9fb95b2c843e241c7148bc25331ab8360b36
-AUX nut-2.6.5-init.d-upsmon 557 BLAKE2B a48b215181d6b40691db244d38b5868e69844f5a1ee6f91cb8815c4386ae801f957b2fbaf53fbe5dd98925be42036dbd54dd5d13c0077c8884e018fac24d101a SHA512 9ccf947b2c5e7a73e96148edb7684f21ae84c4212b980f2ba7b88006dc1e3400b1b9017202b87648f928a3e19f4898094622a6683e0995b72f355ccb394280c3
+AUX nut-2.6.5-init.d-upsmon 557 BLAKE2B 2681668f09426397a79ade8fe706c182dcb5c58c8e0189d51f9ccd0eddaf9eae78a083da38625f8868b355f2096ad7566b27cbaf967aa7472a92a760fa9ef767 SHA512 9559af5c12ef23db196762e2f999a463518383506ded48903ca5ad4b06230644668bbaa1fd007784514140ef391f76bb0bd6e11efa5d1698b79c57b7f5f74cf2
AUX nut-2.7.1-snmpusb-order.patch 1417 BLAKE2B 20c3150559d3810c8bf15a9560ccf950ad1bb26bd58b4f2bcf3736871f4599bc3ad948e5f008b1549184f78d0fa3b417bbc8728660fbb110f4537fce83231bad SHA512 df3701821bc4ef45a5089e4d4439c3367fb23cefce7d06168bd422a8c32a1b373ae9fb3456bd5f90a51a672edf9ce29254a08c2045efe210a11b82399793ec19
AUX nut-2.7.4-nut-scanner.patch 1615 BLAKE2B dd672f2996ca650a6456084dc92d6a9c6ea1b0fe2d1b812bffcfdefda5e797f3f89e19e325f5a2d9ba066b077b9855d2403e111038bd4024f255f2fee243f500 SHA512 5db031aa5c74e4987824b2ac7a5f6e073de16b8958104ceabb7482a6c6b7779d8380fc30b6189ca2cfee9ab795a7413e537d093b0a338aee73d3385b54d280d7
AUX nut-2.7.4-py3.patch 1940 BLAKE2B 5bb77bca18ad40a1ba4e579098accb0135c0f4b24436425de3983204554ddb0aeceb473a7a6729048dbfb6175e015129a8bfcce26b169b3e21c905f9f08f079e SHA512 2a4f12954bdf2e50cbfb7a7dd09ed83be27ed2a6d0a2e4244ca8b309614515599c81541b5cfb4c81244b739cf3a47d56cb2746db3fae9e8861c5115c0287041b
AUX nut-2.7.4-slibtool.patch 2470 BLAKE2B 6baadd663f83209f3abbb4a6b83f170df56da07bb679f6e47571151406c879cfe9a0dbe17fa72678ca66fdcd07ad07bfb8a38e4821cf529e9367a71fad18de69 SHA512 9dfa6c38a56dcf6d743e4ea4eb46ff5e4a81e77eb79df97921662e00c6f4bee4f70a845c3e49ef5ecda31e0e90b8e7f5b450a9c3cd8c5742b093409b894556a8
+AUX nut-2.8.0-fix-man-page-generation.patch 2116 BLAKE2B a7842137c2a5d8103bdb456f576948494697b37c7c8ac9a0e960fe32af50302625ef7bebe4a82252dda8a01503854dfd4fa822d06384eb59efb95466ba946fd4 SHA512 bbeb61a804e39e1a061ad19d28b852214195a9b3a5f70f0841871a197ca25dbf618799298d83898560c843425df9c4bbe20f8b4d6fcd2499af57350b162ba8da
+AUX nut-2.8.0-init.d-upsd 667 BLAKE2B f3ec275cd401df017428c3772fb3f0d51b66173e3d08fdd844e8499bd216b455d6a2846e991c53285092eafc1ad3f43665185c853a438f5331ecd95c2c8c2e30 SHA512 4a58aea9b0119c6ba0949a5d8365cf8785aa49050fb9cb6f6e0ac4d12d1b8e947823d0c41b64500f453fdf236dee6cf60f812c76a65bff9b2ea0f2b713852dc3
AUX nut-openssl-1.1-support.patch 3873 BLAKE2B 17877276e46372aa17d357efc0851b9cdb33b14ac0c40913b47ea513a8ecaa6eebe3241ae8b324583070d76b6c12d3cf18c043778754b5774af846fb8a33b4d7 SHA512 8945f2f663dc50cfd7041cc7f2c4af5cca4b5ef9cfa1be48c122a623e6eadfc511bbaa60a8bd6b68bb2569c75d5f64613d595ad7444b8d6ec9f773d7743872a1
-AUX nut.powerfail.initd 1306 BLAKE2B 9e9c6eb40c6a313ad625136523de730a75b811841331ae5f7dd42b71b65f591c4ab5b8da6e954ceab42da89f4a20e8655cae57354aec6ab796cec80f60ebb419 SHA512 b9aaab526d0996b36a7a6d76a3ee63c1452b0a1bed358e23f6f7f5534e0da7751281428091efc7dba2004706996850ec18318809fdacb94cd8d73ea22bda52ee
+AUX nut.powerfail.initd 1305 BLAKE2B 88bd2a1b5b3fbb2ab9ea4d408e4cc57399702c587ec8314c5b78aa5ce03d4de0f4850ecd580140bf5a42947853f7f64953e0a2859fb1f83de185682d6b600500 SHA512 9e171fc192efaa16e554725b6bf40377e648400f6f6e860d436218289fadcf96c7209fed76129d0dfec912dc5702cca11c90fea072767135fe1a2ba8e11ef2ac
+AUX systemd_notify.path 1753 BLAKE2B a44167bf491b393474b94ee4c375013cd23d1e1151311eab40ba6ca2c190019631aeb3fd21e20b9ce0a0b98d98506c88ddd9fe043a1000268d8b7b4195d8b489 SHA512 9984fb879a002cd00949dd7e10f5720f3b50ce871312750dbdb8b805903b37b1f8be2c7b2f6b79a13739fba2c28bf0f85427af7c9b7421ebf13cabfb3cd88381
DIST nut-2.7.4.tar.gz 2509831 BLAKE2B 367c687efd739150898a14c700d5fddbe22bf926522923e1842011ec49b67d6638620500c4eda50291feb474cc6eef39fff63764cb3e0fad5898abee981f8308 SHA512 320c4aff85d8a370c5eff77d33924fdfc3caf6a250620693cdd5bf3336b3a80d8a207488eee841bcf8b72fbad68fda4c074e63b99c56e7886716fc934122d11a
+DIST nut-2.8.0.tar.gz 3287640 BLAKE2B 6ad87e9c90920d45846d9c1311e8feeb3c36bfa506d62d938940c00d2fc7f7b30632d079a8ee969db624824ae4fd3e14e41e8acd1eda296e26a3aa340f186b94 SHA512 3c413ae54088045a713eb80cf1bdda474f41bb3b67c7c0248aa7a0c4d441dce1ff42627a2735273d7e36892d1f2eeb895220cf28af63fec2fa0c7a267f82d577
EBUILD nut-2.7.4-r8.ebuild 8850 BLAKE2B 0e298891877dae79a3612cb37d4596c164e36d84d072b130b94861e429b700e0f103c1a1245a3a996dba06d2c2912f4847bccbc6db1a717f759f3ae890cf794c SHA512 79090443c160dc043f88417d6500dd49ee3427a4e685bf86ce6b653d324eaf67425e5fd96acb72d8d59348e264f9ae0b2c514be3999fe81a17c9cb1d94f63866
-MISC metadata.xml 5273 BLAKE2B 8eb36ab7d2c0650fc0fc69cb33a5f845b6adbff85cb6f1d9f3359286d125281a26e6864a3fc57171cec40cce2c82d0d7c7525ab35034cbae1d054b37fee0f3c2 SHA512 1d9653333532ca5090aa8ab5f66c18d46b8c7df2b75fd42b6d55ff252f7596122bf15302c3d5bf8a3dcbe9a1795f4af845c36e2160ee377bbe05ca4031366900
+EBUILD nut-2.8.0-r1.ebuild 5770 BLAKE2B f91d73797be97f5d5165b9da9c0e569175dedbe5e61cb2f6b110081822416980885573458cf656210a88b8bad653450cd337e8a5556f05d7d6d2c9aa276fc0a7 SHA512 a5b0a567f9a1190d73119d0defe10629399de1faddd30924ffb688c3288e09e933afea7f70d6cc71624f67e525477fa9093e649c4496151c894d76f4df7a73d6
+EBUILD nut-9999.ebuild 6921 BLAKE2B 4b9436e707fd4806968b500e49b7b535b953e538936e3ecc2584b59f1dd4c79db173cc54f87bc66a902a40c659144bce70f5366dba6c9ed9b1efaca9c78bb9e8 SHA512 430d445736f9bad1c3866edc1d7f16656f0d278fcc914cfacf2884d6b89da027fe65cc4205c2d719a60fe88cf617ccbcd2291ef58c41ce465823f94be4c261f8
+MISC metadata.xml 6068 BLAKE2B 499dd975b0364733e71175eb061d935f754343d32d6eba547a26659438a0488a25509e907516b73d7bfd9714be28bc2159dd8688d2578611c9b9fca419881446 SHA512 cc42c7645c78516a2b2e82ec09098c88c1f7fbcc68f5685906811b9182dd4869c31c4eb865c5deab8cc105cf24e32161cf7db746fe793e6bea08fbf12f561e79
diff --git a/sys-power/nut/files/nut-2.6.5-init.d-upsmon b/sys-power/nut/files/nut-2.6.5-init.d-upsmon
index 3aafe1676d6e..729df9c5460b 100644
--- a/sys-power/nut/files/nut-2.6.5-init.d-upsmon
+++ b/sys-power/nut/files/nut-2.6.5-init.d-upsmon
@@ -4,7 +4,7 @@
extra_started_commands="reload"
-pidfile=/var/run/upsmon.pid
+pidfile=/run/nut/upsmon.pid
bin=/usr/sbin/upsmon
depend() {
diff --git a/sys-power/nut/files/nut-2.8.0-fix-man-page-generation.patch b/sys-power/nut/files/nut-2.8.0-fix-man-page-generation.patch
new file mode 100644
index 000000000000..ff224a4774bf
--- /dev/null
+++ b/sys-power/nut/files/nut-2.8.0-fix-man-page-generation.patch
@@ -0,0 +1,64 @@
+From c0d9ce265c6ca627039845d9544ebbdf87a00f7f Mon Sep 17 00:00:00 2001
+From: Timo Kokkonen <timo.t.kokkonen@iki.fi>
+Date: Mon, 11 Jul 2022 20:41:12 +0300
+Subject: [PATCH] docs: man: upsd: Fix driver list when building only some of
+ drivers
+
+There are two issues that come up in man page generation when only
+some of the drivers are built.
+
+First is that during configure phase DRIVER_MAN_LIST is collected by
+searching any .8 files matching the driver names. This does not work
+very well as during the first configure call these files don't exist
+yet as none of them are compiled yet. Searching the .txt files where
+they are built from works better.
+
+Second issue is that SRC_DRIVERS_PAGES list needs to contain the
+source files where the driver list is generated from. If only some
+drivers are built, this needs to be populated from the list of files
+we collected to DRIVER_MAN_LIST during configure phase.
+
+Adding these entries will ensure manpage generation will not fail if
+only some of the drivers are built
+
+Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
+---
+ configure.ac | 4 ++--
+ docs/man/Makefile.am | 6 ++++++
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 3aa26c24e..a49ca4417 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1745,8 +1745,8 @@ if test "${WITH_MANS}" = "yes"; then
+ else
+ DRIVER_MAN_LIST=""
+ for i in ${DRIVER_BUILD_LIST}; do
+- if test -f ${srcdir}/docs/man/$i.8; then
+- DRIVER_MAN_LIST="${DRIVER_MAN_LIST} $i.8"
++ if test -f ${srcdir}/docs/man/$i.txt; then
++ DRIVER_MAN_LIST="${DRIVER_MAN_LIST} $i.txt"
+ fi
+ done
+ AC_MSG_RESULT(${DRIVER_MAN_LIST})
+diff --git a/docs/man/Makefile.am b/docs/man/Makefile.am
+index 0d693a355..a7345264b 100644
+--- a/docs/man/Makefile.am
++++ b/docs/man/Makefile.am
+@@ -695,6 +695,12 @@ SRC_DRIVERS_PAGES = \
+ $(SRC_MODBUS_PAGES) \
+ $(SRC_LINUX_I2C_PAGES)
+
++if SOME_DRIVERS
++SRC_DRIVERS_PAGES += \
++ $(DRIVER_MAN_LIST)
++endif
++
++
+ # distribute everything, even those not installed by default
+ # Note that 'dist' target requires AsciiDoc!
+ SRC_ALL_PAGES = \
+--
+2.35.1
+
diff --git a/sys-power/nut/files/nut-2.8.0-init.d-upsd b/sys-power/nut/files/nut-2.8.0-init.d-upsd
new file mode 100644
index 000000000000..ce09de52d56d
--- /dev/null
+++ b/sys-power/nut/files/nut-2.8.0-init.d-upsd
@@ -0,0 +1,37 @@
+#!/sbin/openrc-run
+# Copyright 1999-2023 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_started_commands="reload"
+
+pidfile=/run/nut/upsd.pid
+bin=/usr/sbin/upsd
+
+depend() {
+ use net
+ before upsmon
+ after upsdrv
+}
+
+start() {
+ ebegin "Starting upsd"
+ # clean up first
+ pkill -u root,nut -x ${bin}
+ sleep 1
+ rm -f ${pidfile}
+ # now start up
+ start-stop-daemon --start --quiet --exec ${bin}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping upsd"
+ start-stop-daemon --stop --quiet --pidfile ${pidfile}
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading upsd"
+ start-stop-daemon --stop --signal HUP --oknodo --quiet --pidfile ${pidfile}
+ eend $?
+}
diff --git a/sys-power/nut/files/nut.powerfail.initd b/sys-power/nut/files/nut.powerfail.initd
index fd26b4f76aec..f81b258a7cdb 100644
--- a/sys-power/nut/files/nut.powerfail.initd
+++ b/sys-power/nut/files/nut.powerfail.initd
@@ -45,4 +45,3 @@ start() {
ewarn "UPS powerfail script scheduled, and flags found, but ${UPS_CTL} missing."
fi
}
-
diff --git a/sys-power/nut/files/systemd_notify.path b/sys-power/nut/files/systemd_notify.path
new file mode 100644
index 000000000000..657e0075420c
--- /dev/null
+++ b/sys-power/nut/files/systemd_notify.path
@@ -0,0 +1,50 @@
+--- old/configure.ac 2023-06-09 00:53:54.121886669 +0200
++++ new/configure.ac 2023-06-09 00:57:13.149792791 +0200
+@@ -3220,45 +3220,8 @@
+ AC_PATH_PROG([SYSTEMD_ANALYZE_PROGRAM], [systemd-analyze], [/usr/bin/systemd-analyze])
+
+ dnl Relevant since 2023: https://github.com/systemd/systemd/pull/25916
+-SYSTEMD_SUPPORTS_DAEMON_TYPE_NOTIFY=no
+-AS_IF([test -x "$SYSTEMD_ANALYZE_PROGRAM"], [
+- AC_MSG_CHECKING([if your systemd version supports Type=notify])
+- myFILE="`mktemp systemd-analyze-XXXXXX.service`"
+- cat > "$myFILE" << EOF
+-@<:@Unit@:>@
+-Description=temp
+-@<:@Service@:>@
+-ExecStart=/bin/true
+-Type=notify
+-EOF
+- if myOUT="`"$SYSTEMD_ANALYZE_PROGRAM" verify "$myFILE" 2>&1`" \
+- && ! (echo "$myOUT" | grep "Failed to parse service type, ignoring") \
+- ; then
+- SYSTEMD_SUPPORTS_DAEMON_TYPE_NOTIFY=yes
+- fi
+- rm -f "$myFILE"
+- AC_MSG_RESULT([${SYSTEMD_SUPPORTS_DAEMON_TYPE_NOTIFY}])
+- ])
+-
+-SYSTEMD_SUPPORTS_DAEMON_TYPE_NOTIFY_RELOAD=no
+-AS_IF([test -x "$SYSTEMD_ANALYZE_PROGRAM"], [
+- AC_MSG_CHECKING([if your systemd version supports Type=notify-reload])
+- myFILE="`mktemp systemd-analyze-XXXXXX.service`"
+- cat > "$myFILE" << EOF
+-@<:@Unit@:>@
+-Description=temp
+-@<:@Service@:>@
+-ExecStart=/bin/true
+-Type=notify-reload
+-EOF
+- if myOUT="`"$SYSTEMD_ANALYZE_PROGRAM" verify "$myFILE" 2>&1`" \
+- && ! (echo "$myOUT" | grep "Failed to parse service type, ignoring") \
+- ; then
+- SYSTEMD_SUPPORTS_DAEMON_TYPE_NOTIFY_RELOAD=yes
+- fi
+- rm -f "$myFILE"
+- AC_MSG_RESULT([${SYSTEMD_SUPPORTS_DAEMON_TYPE_NOTIFY_RELOAD}])
+- ])
++SYSTEMD_SUPPORTS_DAEMON_TYPE_NOTIFY=yes
++SYSTEMD_SUPPORTS_DAEMON_TYPE_NOTIFY_RELOAD=yes
+
+ AS_IF([test x"${with_libsystemd}" = xyes && test x"${SYSTEMD_SUPPORTS_DAEMON_TYPE_NOTIFY}" = xyes], [
+ dnl Built with sd_notify support
diff --git a/sys-power/nut/metadata.xml b/sys-power/nut/metadata.xml
index d310afca661e..4579366e6071 100644
--- a/sys-power/nut/metadata.xml
+++ b/sys-power/nut/metadata.xml
@@ -8,8 +8,24 @@
<maintainer type="person">
<email>prometheanfire@gentoo.org</email>
</maintainer>
+ <maintainer type="person" proxied="yes">
+ <email>web@inode64.com</email>
+ <name>Fco. Javier FĂ©lix</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
<use>
- <flag name="ipmi">Support IPMI-based UPSes.</flag>
+ <flag name="gpio">Includes all UPS drivers that use GPIO.</flag>
+ <flag name="i2c">Includes all UPS drivers that use I2C.</flag>
+ <flag name="ipmi">Includes all UPS drivers that use ipmi.</flag>
+ <flag name="modbus">Includes all UPS drivers that use MODBUS.</flag>
+ <flag name="monitor">Add a QT5 gui monitor.</flag>
+ <flag name="serial">Includes all UPS drivers that use SERIAL.</flag>
+ <flag name="snmp">Includes all UPS drivers that use SNMP.</flag>
+ <flag name="usb">Includes all UPS drivers that use USB.</flag>
+ <flag name="xml">Includes all UPS drivers that use XML.</flag>
<flag name="ups_drivers_al175">Driver for Eltek UPS models with AL175 alarm module</flag>
<flag name="ups_drivers_bcmxcp">Driver for UPSes supporting the serial BCM/XCP protocol</flag>
<flag name="ups_drivers_belkin">Driver for Belkin serial UPS equipment</flag>
diff --git a/sys-power/nut/nut-2.8.0-r1.ebuild b/sys-power/nut/nut-2.8.0-r1.ebuild
new file mode 100644
index 000000000000..653fa007ed62
--- /dev/null
+++ b/sys-power/nut/nut-2.8.0-r1.ebuild
@@ -0,0 +1,220 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 flag-o-matic linux-info optfeature systemd
+inherit tmpfiles toolchain-funcs udev
+
+MY_P=${P/_/-}
+
+DESCRIPTION="Network-UPS Tools"
+HOMEPAGE="https://networkupstools.org/"
+
+if [[ ${PV} == *9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/networkupstools/${PN}.git"
+ inherit git-r3
+else
+ SRC_URI="https://networkupstools.org/source/${PV%.*}/${MY_P}.tar.gz"
+ KEYWORDS="~amd64 ~arm64 ~x86"
+fi
+
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="cgi doc ipmi serial i2c +man snmp +usb modbus selinux split-usr ssl tcpd test xml zeroconf"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ acct-group/nut
+ acct-user/nut
+ dev-libs/libltdl
+ virtual/udev
+ cgi? ( >=media-libs/gd-2[png] )
+ i2c? ( sys-apps/i2c-tools )
+ ipmi? ( sys-libs/freeipmi )
+ modbus? ( dev-libs/libmodbus )
+ snmp? ( net-analyzer/net-snmp:= )
+ ssl? ( >=dev-libs/openssl-1:= )
+ tcpd? ( sys-apps/tcp-wrappers )
+ usb? ( virtual/libusb:1 )
+ xml? ( >=net-libs/neon-0.25.0:= )
+ zeroconf? ( net-dns/avahi )
+"
+BDEPEND="
+ virtual/pkgconfig
+ man? ( app-text/asciidoc )
+ test? ( dev-util/cppunit )
+"
+RDEPEND="
+ ${DEPEND}
+ selinux? ( sec-policy/selinux-nut )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-2.6.2-lowspeed-buffer-size.patch"
+)
+
+pkg_pretend() {
+ if use i2c; then
+ CONFIG_CHECK="~I2C_CHARDEV"
+ ERROR_I2C_CHARDEV="You must enable I2C_CHARDEV in your kernel to continue"
+ fi
+ if use usb; then
+ CONFIG_CHECK+=" ~HIDRAW ~USB_HIDDEV"
+ ERROR_HIDRAW="HIDRAW is needed to support USB UPSes"
+ ERROR_I2C_CHARDEV="USB_HIDDEV is needed to support USB UPSes"
+ fi
+ if use serial; then
+ CONFIG_CHECK="~SERIAL_8250"
+ ERROR_SERIAL_8250="SERIAL_8250 is needed to support Serial UPSes"
+ fi
+
+ # Now do the actual checks setup above
+ check_extra_config
+}
+
+src_prepare() {
+ default
+
+ if [[ ${PV} == *9999 ]] ; then
+ ./autogen.sh || die
+ fi
+}
+
+src_configure() {
+ local myeconfargs=(
+ --datadir=/usr/share/nut
+ --datarootdir=/usr/share/nut
+ --disable-static
+ --disable-strip
+ --disable-Werror
+ --sysconfdir=/etc/nut
+ --with-dev
+ --with-drvpath="/$(get_libdir)/nut"
+ --with-group=nut
+ --with-htmlpath=/usr/share/nut/html
+ --with-logfacility=LOG_DAEMON
+ --with-statepath=/var/lib/nut
+ --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+ --with-systemdtmpfilesdir="/usr/lib/tmpfiles.d"
+ --with-udev-dir="$(get_udevdir)"
+ --with-user=nut
+ --without-powerman
+ --without-python
+ --without-python2
+ --without-python3
+ --with-altpidpath=/run/nut
+ --with-pidpath=/run/nut
+ $(use_enable test cppunit)
+ $(use_with i2c linux_i2c)
+ $(use_with ipmi freeipmi)
+ $(use_with ipmi)
+ $(use_with serial)
+ $(use_with snmp)
+ $(use_with ssl)
+ $(use_with tcpd wrap)
+ $(use_with usb)
+ $(use_with xml neon)
+ $(use_with zeroconf avahi)
+ )
+
+ filter-lto
+ append-flags -fno-lto
+ tc-export CC CXX AR
+
+ use cgi && myeconfargs+=( --with-cgipath=/usr/share/nut/cgi )
+ use man && myeconfargs+=( --with-doc=man )
+
+ export bashcompdir="$(get_bashcompdir)"
+
+ econf "${myeconfargs[@]}"
+}
+
+src_install() {
+ default
+
+ rm -rf "${ED}/etc/hotplug" || die
+
+ find "${ED}" -name '*.la' -delete || die
+
+ dodir /sbin
+ use split-usr && dosym ../usr/sbin/upsdrvctl /sbin/upsdrvctl
+
+ if use cgi; then
+ elog "CGI monitoring scripts are installed in ${EPREFIX}/usr/share/nut/cgi."
+ elog "copy them to your web server's ScriptPath to activate (this is a"
+ elog "change from the old location)."
+ elog "If you use lighttpd, see lighttpd_nut.conf in the documentation."
+ elog
+ elog "Use script aliases according to the web server you use (apache, nginx, lighttpd, etc...)"
+ fi
+
+ # This must be done after all of the install phases
+ local i
+ for i in "${ED}"/etc/nut/*.sample ; do
+ mv "${i}" "${i/.sample/}" || die
+ done
+
+ local DOCS=( AUTHORS MAINTAINERS NEWS README TODO UPGRADING )
+ einstalldocs
+
+ if use doc; then
+ newdoc lib/README README.lib
+ dodoc docs/*.txt
+ docinto cables
+ dodoc docs/cables/*
+ fi
+
+ newinitd "${FILESDIR}"/nut-2.8.0-init.d-upsd upsd
+ newinitd "${FILESDIR}"/nut-2.2.2-init.d-upsdrv upsdrv
+ newinitd "${FILESDIR}"/nut-2.6.5-init.d-upsmon upsmon
+ newinitd "${FILESDIR}"/nut-2.6.5-init.d-upslog upslog
+ newinitd "${FILESDIR}"/nut.powerfail.initd nut.powerfail
+
+ newbashcomp "${S}"/scripts/misc/nut.bash_completion upsc
+ bashcomp_alias upsc upscmd upsd upsdrvctl upsmon upsrw
+
+ if use zeroconf; then
+ insinto /etc/avahi/services
+ doins scripts/avahi/nut.service
+ fi
+
+ mv "${ED}"/usr/lib/tmpfiles.d/nut-common.tmpfiles "${ED}"/usr/lib/tmpfiles.d/nut-common-tmpfiles.conf || die
+
+ # Fix double directory
+ sed -i -e 's:/nut/nut:/nut:g' "${ED}"/usr/lib/tmpfiles.d/nut-common-tmpfiles.conf || die
+}
+
+pkg_postinst() {
+ elog "Please note that NUT now runs under the 'nut' user."
+ elog "NUT is in the uucp group for access to RS-232 UPS."
+ elog "However if you use a USB UPS you may need to look at the udev or"
+ elog "hotplug rules that are installed, and alter them suitably."
+ elog
+ elog "You are strongly advised to read the UPGRADING file provided by upstream."
+ elog
+ elog "Please note that upsdrv is NOT automatically started by upsd anymore."
+ elog "If you have multiple UPS units, you can use their NUT names to"
+ elog "have a service per UPS:"
+ elog "ln -s /etc/init.d/upsdrv /etc/init.d/upsdrv.\$UPSNAME"
+ elog
+ elog 'If you want apcupsd to power off your UPS when it'
+ elog 'shuts down your system in a power failure, you must'
+ elog 'add nut.powerfail to your shutdown runlevel:'
+ elog
+ elog 'rc-update add nut.powerfail shutdown'
+ elog
+
+ optfeature "all notify events generate a global message (wall) to all users, plus they are logged via the syslog" \
+ sys-apps/util-linux[logger,tty-helpers]
+
+ udev_reload
+
+ tmpfiles_process nut-common-tmpfiles.conf
+}
+
+pkg_postrm() {
+ udev_reload
+}
diff --git a/sys-power/nut/nut-9999.ebuild b/sys-power/nut/nut-9999.ebuild
new file mode 100644
index 000000000000..1a18e915356e
--- /dev/null
+++ b/sys-power/nut/nut-9999.ebuild
@@ -0,0 +1,262 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+inherit bash-completion-r1 desktop flag-o-matic linux-info optfeature
+inherit python-single-r1 systemd tmpfiles toolchain-funcs udev wrapper xdg
+
+MY_P=${P/_/-}
+
+DESCRIPTION="Network-UPS Tools"
+HOMEPAGE="https://networkupstools.org/"
+
+if [[ ${PV} == *9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/networkupstools/${PN}.git"
+ inherit git-r3
+else
+ SRC_URI="https://networkupstools.org/source/${PV%.*}/${MY_P}.tar.gz"
+ KEYWORDS="~amd64 ~arm64 ~x86"
+fi
+
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="gpio cgi doc ipmi serial i2c +man snmp +usb modbus selinux split-usr ssl tcpd test xml zeroconf python monitor systemd"
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="
+ monitor? ( python )
+ python? ( ${PYTHON_REQUIRED_USE} )
+ snmp? ( python )
+"
+
+# sys-apps/systemd-253 required for Type=notify-reload
+DEPEND="
+ acct-group/nut
+ acct-user/nut
+ dev-libs/libltdl
+ virtual/udev
+ cgi? ( >=media-libs/gd-2[png] )
+ gpio? ( dev-libs/libgpiod )
+ i2c? ( sys-apps/i2c-tools )
+ ipmi? ( sys-libs/freeipmi )
+ modbus? ( dev-libs/libmodbus )
+ python? ( ${PYTHON_DEPS} )
+ snmp? ( net-analyzer/net-snmp:= )
+ ssl? ( >=dev-libs/openssl-1:= )
+ systemd? ( >=sys-apps/systemd-253 )
+ tcpd? ( sys-apps/tcp-wrappers )
+ usb? ( virtual/libusb:1 )
+ xml? ( >=net-libs/neon-0.25.0:= )
+ zeroconf? ( net-dns/avahi )
+"
+BDEPEND="
+ virtual/pkgconfig
+ man? ( app-text/asciidoc )
+ test? ( dev-util/cppunit )
+"
+RDEPEND="
+ ${DEPEND}
+ monitor? ( $(python_gen_cond_dep '
+ dev-python/PyQt5[gui,widgets,${PYTHON_USEDEP}]
+ ')
+ )
+ selinux? ( sec-policy/selinux-nut )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-2.6.2-lowspeed-buffer-size.patch"
+ "${FILESDIR}/systemd_notify.path"
+)
+
+pkg_pretend() {
+ if use i2c; then
+ CONFIG_CHECK="~I2C_CHARDEV"
+ ERROR_I2C_CHARDEV="You must enable I2C_CHARDEV in your kernel to continue"
+ fi
+ if use usb; then
+ CONFIG_CHECK+=" ~HIDRAW ~USB_HIDDEV"
+ ERROR_HIDRAW="HIDRAW is needed to support USB UPSes"
+ ERROR_I2C_CHARDEV="USB_HIDDEV is needed to support USB UPSes"
+ fi
+ if use gpio; then
+ CONFIG_CHECK="~GPIO_CDEV_V1"
+ ERROR_GPIO_CDEV_V1="GPIO_CDEV_V1 is needed to support GPIO UPSes"
+ fi
+ if use serial; then
+ CONFIG_CHECK="~SERIAL_8250"
+ ERROR_SERIAL_8250="SERIAL_8250 is needed to support Serial UPSes"
+ fi
+
+ # Now do the actual checks setup above
+ check_extra_config
+}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+
+ if [[ ${PV} == *9999 ]] ; then
+ ./autogen.sh || die
+ fi
+
+ xdg_environment_reset
+}
+
+src_configure() {
+ local myeconfargs=(
+ --datadir=/usr/share/nut
+ --datarootdir=/usr/share/nut
+ --disable-static
+ --disable-strip
+ --disable-Werror
+ --sysconfdir=/etc/nut
+ --with-dev
+ --with-drvpath="/$(get_libdir)/nut"
+ --with-group=nut
+ --with-htmlpath=/usr/share/nut/html
+ --with-logfacility=LOG_DAEMON
+ --with-statepath=/var/lib/nut
+ --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+ --with-systemdtmpfilesdir="/usr/lib/tmpfiles.d"
+ --with-udev-dir="$(get_udevdir)"
+ --with-user=nut
+ --without-powerman
+ --without-python
+ --without-python2
+ --with-altpidpath=/run/nut
+ --with-pidpath=/run/nut
+ $(use_with gpio)
+ $(use_with i2c linux_i2c)
+ $(use_with ipmi freeipmi)
+ $(use_with ipmi)
+ $(use_with monitor nut_monitor)
+ $(use_with python pynut)
+ $(use_with serial)
+ $(use_with snmp)
+ $(use_with ssl)
+ $(use_with systemd libsystemd)
+ $(use_with tcpd wrap)
+ $(use_with usb)
+ $(use_with xml neon)
+ $(use_with zeroconf avahi)
+ )
+
+ filter-lto
+ append-flags -fno-lto
+ tc-export CC CXX AR
+
+ use cgi && myeconfargs+=( --with-cgipath=/usr/share/nut/cgi )
+ use man && myeconfargs+=( --with-doc=man )
+ use python && myeconfargs+=( --with-python3="${PYTHON}" ) || myeconfargs+=( --without-python3 )
+
+ export bashcompdir="$(get_bashcompdir)"
+
+ econf "${myeconfargs[@]}"
+}
+
+src_install() {
+ default
+
+ rm -rf "${ED}/etc/hotplug" || die
+
+ find "${ED}" -name '*.la' -delete || die
+
+ dodir /sbin
+ use split-usr && dosym ../usr/sbin/upsdrvctl /sbin/upsdrvctl
+
+ if use cgi; then
+ elog "CGI monitoring scripts are installed in ${EPREFIX}/usr/share/nut/cgi."
+ elog "copy them to your web server's ScriptPath to activate (this is a"
+ elog "change from the old location)."
+ elog "If you use lighttpd, see lighttpd_nut.conf in the documentation."
+ elog
+ elog "Use script aliases according to the web server you use (apache, nginx, lighttpd, etc...)"
+ fi
+
+ # This must be done after all of the install phases
+ local i
+ for i in "${ED}"/etc/nut/*.sample ; do
+ mv "${i}" "${i/.sample/}" || die
+ done
+
+ local DOCS=( AUTHORS MAINTAINERS NEWS README TODO UPGRADING )
+ einstalldocs
+
+ if use doc; then
+ newdoc lib/README README.lib
+ dodoc docs/*.txt
+ docinto cables
+ dodoc docs/cables/*
+ fi
+
+ newinitd "${FILESDIR}"/nut-2.8.0-init.d-upsd upsd
+ newinitd "${FILESDIR}"/nut-2.2.2-init.d-upsdrv upsdrv
+ newinitd "${FILESDIR}"/nut-2.6.5-init.d-upsmon upsmon
+ newinitd "${FILESDIR}"/nut-2.6.5-init.d-upslog upslog
+ newinitd "${FILESDIR}"/nut.powerfail.initd nut.powerfail
+
+ newbashcomp "${S}"/scripts/misc/nut.bash_completion upsc
+ bashcomp_alias upsc upscmd upsd upsdrvctl upsmon upsrw
+
+ if use zeroconf; then
+ insinto /etc/avahi/services
+ doins scripts/avahi/nut.service
+ fi
+
+ if use monitor; then
+ make_wrapper NUT-Monitor-py3qt5 /usr/share/nut/nut-monitor/app/NUT-Monitor-py3qt5 /usr/share/nut/nut-monitor/app
+
+ # Install desktop shortcut
+ newmenu scripts/python/app/nut-monitor-py3qt5.desktop nut-monitor.desktop
+
+ # Installing Application icons
+ local res
+ for res in 48 64 256; do
+ doicon -s ${res} scripts/python/app/icons/${res}x${res}/nut-monitor.png
+ done
+ doicon -s scalable scripts/python/app/icons/scalable/nut-monitor.svg
+ fi
+
+ use python && python_optimize
+}
+
+pkg_postinst() {
+ elog "Please note that NUT now runs under the 'nut' user."
+ elog "NUT is in the uucp group for access to RS-232 UPS."
+ elog "However if you use a USB UPS you may need to look at the udev or"
+ elog "hotplug rules that are installed, and alter them suitably."
+ elog
+ elog "You are strongly advised to read the UPGRADING file provided by upstream."
+ elog
+ elog "Please note that upsdrv is NOT automatically started by upsd anymore."
+ elog "If you have multiple UPS units, you can use their NUT names to"
+ elog "have a service per UPS:"
+ elog "ln -s /etc/init.d/upsdrv /etc/init.d/upsdrv.\$UPSNAME"
+ elog
+ elog 'If you want apcupsd to power off your UPS when it'
+ elog 'shuts down your system in a power failure, you must'
+ elog 'add nut.powerfail to your shutdown runlevel:'
+ elog
+ elog 'rc-update add nut.powerfail shutdown'
+ elog
+
+ optfeature "all notify events generate a global message (wall) to all users, plus they are logged via the syslog" \
+ sys-apps/util-linux[logger,tty-helpers]
+
+ udev_reload
+
+ tmpfiles_process nut-common-tmpfiles.conf
+ xdg_pkg_postinst
+}
+
+pkg_postrm() {
+ udev_reload
+ xdg_pkg_postrm
+}