summaryrefslogtreecommitdiff
path: root/sys-power
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2025-01-24 06:47:17 +0000
committerV3n3RiX <venerix@koprulu.sector>2025-01-24 06:47:17 +0000
commitf1e6490ffadd8d677960342b348f2b08492dd5f6 (patch)
tree63f2fb113fe5dad7c6a20b69255e07f9bc2446f2 /sys-power
parentc78477d222e1ceb9516a9bbbadbba0b5c1ce11db (diff)
gentoo auto-resync : 24:01:2025 - 06:47:17
Diffstat (limited to 'sys-power')
-rw-r--r--sys-power/Manifest.gzbin5579 -> 5583 bytes
-rw-r--r--sys-power/apcupsd/Manifest5
-rw-r--r--sys-power/apcupsd/apcupsd-3.14.14-r4.ebuild160
-rw-r--r--sys-power/apcupsd/files/apcupsd-3.14.14-lto.patch29
-rw-r--r--sys-power/apcupsd/files/apcupsd.powerfail.init-r117
-rw-r--r--sys-power/apcupsd/metadata.xml4
6 files changed, 214 insertions, 1 deletions
diff --git a/sys-power/Manifest.gz b/sys-power/Manifest.gz
index 9e87b44e3455..5addd7f519d0 100644
--- a/sys-power/Manifest.gz
+++ b/sys-power/Manifest.gz
Binary files differ
diff --git a/sys-power/apcupsd/Manifest b/sys-power/apcupsd/Manifest
index 87265d92cdc7..278cbaee2bbb 100644
--- a/sys-power/apcupsd/Manifest
+++ b/sys-power/apcupsd/Manifest
@@ -1,3 +1,4 @@
+AUX apcupsd-3.14.14-lto.patch 874 BLAKE2B 687915f30422df22173d1bcd3040b148f3f9f0cfc7bf4f492056351a6dcdb7c680eb4de60c147a0bd73a1aebc2d2d746af3cfb3397a98375449cd5a355a8c087 SHA512 ec2ec1277918ca96b148daa259aae6441df64c203bf315d962ddc608bfbca10b19f3dbf0dc78f32b05d28a91230a71591990b479dd075f38f43895c802aa5cd5
AUX apcupsd-3.14.9-aliasing.patch 2108 BLAKE2B b6ce1e6e3e40b6d533a08d5fac633e7c3d81574b2b2fd9c442a10eac8e507abfa73ddf3dc74ac9fc4d8bbd9c7da3f7d9eb5194f6df959dbe792d5b103d88844c SHA512 48eb51385136216d1cdddb6b237b89a52c516b223aa7fe50fb35761cd595d9ab7f7fabbd0e4f8c0f7d45df6feed0a2e240d227181f3d772fc5fa9f8bfa62529f
AUX apcupsd-3.14.9-close-on-exec.patch 1700 BLAKE2B 33bc681a008c98a6659a832359d3906bfe153db7cf3fbb0dbf442dc60e97c41dd0680eb5674592c835a28731f1fb361a20f2f5acae88f84142781153fba5ca66 SHA512 5f348efc11f35538fc9810d9026b2f8eeeadf5675ca1bf2275f704310a654266e5e79e393a59e6c25171a94f5d0b1d9e74b45a1511c4289242379f6f4e30888b
AUX apcupsd-3.14.9-commfailure.patch 519 BLAKE2B 58763a637f44ad3e506b1f8da73027353d05bbcab6a3a108d39c4d189682a8185d89960e46eb760b7f5781115b266ff0c5ebb902a1307634faed0639c7b4ceb9 SHA512 856063b915ccd583abbef4347e01a8a5f71f7853efbfeb62d2edfee1acd14030e34373c420d5fdd58bc47ce03e79b55dd4a5ee6486c8dee984e8f272257af673
@@ -9,7 +10,9 @@ AUX apcupsd-udev.rules 328 BLAKE2B be1a8ff2eb09c045137ab2f1e48d3caa5ea9df85f766d
AUX apcupsd.conf 12475 BLAKE2B c7695035887fa4fa867b2588f2ed0e2fee6c6a0086c221fec3019e3de639202287e9a35082334b8801cda38c846a0bcac714b046b1ddc1297f764bb211e42fb9 SHA512 1519d3cd47a2a73ff4148e4f74964ae841d37639616fe5b974b426983f5379db89b8793a6952389c443c56b84d0ef33f6995eccd920f71b4e5efc842a58a04e1
AUX apcupsd.init 804 BLAKE2B 7afd83a6be8b068133f6221cc2396a1fe4cab23f6dec68957b48ef7940730908e7a20e1597a21480eeffdb79314fd02505d4bafdd0b7a6bd1ff2b7c452f847ef SHA512 dd7fcc52b495c3f73bc9b2fe73bbb7c8fe3ec959ea733360d370148d617d98f34de3b48f1cb451f9a8356eb8088b06d3c736bd6cbad2bb5e9e609e37d5f2c53c
AUX apcupsd.powerfail.init 397 BLAKE2B 472512906536753d3054d275707764a98094c14866da63fbc8d2d62e16a9099fdce0b61cf572a4ba862f0be13e1ed3407821ed07ec90f9c77fb8d95f18aafc2f SHA512 cd0ed9d24a8371de7920bf0ce2e89bb63c0bee58da1ac782ed2b929068f95b2af47458529223a33ecea4e8f73ddfe3a7b9591af6f64828de7ed1d91e2edbb6e1
+AUX apcupsd.powerfail.init-r1 360 BLAKE2B 87015320928267dc48b1f3c31f588e0c99fac819238b41c2ed6161558d3d384501ca396a62c53b1f198c59b4a09b6ad0ffafd06fb13c7191841f968bc7ef4c40 SHA512 69a0221e5050e32e44ef5145ecd6c7ce113418f3f13a957be72954be396f898705643a2e81f38a9db6d835bc4dc2d2ff901519e75851963aaa8b8eb446da6f5f
AUX apcupsd.service 111 BLAKE2B bf2ac8161af5b971642298c30b08ad78d289044bb2452bdef39b31119b60eceb0a14add7c00262132bb80dbf1964103242452cb8d9b815d6ec82c204100ea184 SHA512 011e3e52e7909f36fb73b6064277a69e5db41263cfc72bda07e326172396d5318cd2b050f1fb84c4cc6da7a247c0035c36c55322ffb234a1cfa7bf13ba492889
DIST apcupsd-3.14.14.tar.gz 1843409 BLAKE2B 48a3b249780064d699d86b658584aa222ce9f3b46a81209110b4684bf737cca7492b87b063154864ce76478f29f73cda83ab96b47f4a7aa7aa91e29a8abbf4a8 SHA512 c953bbf3e08f809748a7978a3952604176390d1cd276f187fe096d9bc3c8993b52127e8350c0363387da41318e24b4d1e00ea58df71f3bb8f50c9a5a64cd2d7f
EBUILD apcupsd-3.14.14-r3.ebuild 4557 BLAKE2B c4e278bedd39497ed302fdd928b298d2fa0bb7b5559dcf5e0f58c4c9e1e52509736724c74594ee972e095032e5aca5e431be7b167dcf1ac9a7b644461e1a13e6 SHA512 db4bb4eb0078a4e4a530f3fa49a8da05ee39391c5dca7b0a4a5dd86b7a2d8c95e99d6ff6832a4b9337d602002e38685362010d4dc1131c0795268851ef5103bb
-MISC metadata.xml 1162 BLAKE2B ff0f026e800ae6f2985d46fdcc2f756e46706b3a1910a3032215996636de9839e0936c5ff88cc7d9e709caf2ad53c9d9b8beca73ca17b8bd4b408c039a0d5696 SHA512 aae2a1aaf01a2412d5e054f8ed93fafb912f8a4cf48d2790615746751091f412f9bf3e19c2d857506ba50ef2a312ad5eec7c2dac770eb0b1130e062af856ab36
+EBUILD apcupsd-3.14.14-r4.ebuild 4399 BLAKE2B fab8dff0a14ec15df358b412edf949d8aeb7429529c5302715c6a771fbaa768be872c651cfa993e378bf31f5a29e46d9a1f91ea88c5ffab0678fb6d240f061d8 SHA512 7760ebf8a2acc7d9af4e8ad19b2179108c8d89a733ded434946c85cfcaab132dc7809314c94d239355854fa1fdaa75afde1cb4c33574092b9afb6d041db41cd6
+MISC metadata.xml 1273 BLAKE2B 1df1dcddcde2814806465b73da094a12f782b5e5ff5368b5b57dfdc290ecc68e817561296e3799d047cd1071656a408b068baf11eb5dc9c9153b5418d0f6ca59 SHA512 297eceae5e520df991f9be3cc8f58436d1b92ce46643fbc46bcc8457931f3fd67cac036e4d7a0e1fa42cbf1705c553596ed9de88b074ee265e152f59b7c6b328
diff --git a/sys-power/apcupsd/apcupsd-3.14.14-r4.ebuild b/sys-power/apcupsd/apcupsd-3.14.14-r4.ebuild
new file mode 100644
index 000000000000..c3bc2dbb2a36
--- /dev/null
+++ b/sys-power/apcupsd/apcupsd-3.14.14-r4.ebuild
@@ -0,0 +1,160 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit linux-info systemd udev tmpfiles
+
+DESCRIPTION="APC UPS daemon with integrated tcp/ip remote shutdown"
+HOMEPAGE="http://www.apcupsd.org/"
+SRC_URI="https://downloads.sourceforge.net/apcupsd/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~riscv ~x86"
+IUSE="cgi +modbus selinux snmp +usb"
+
+DEPEND="
+ sys-apps/util-linux[tty-helpers]
+ cgi? ( media-libs/gd:2= )
+ modbus? (
+ usb? ( virtual/libusb:0= )
+ )
+ snmp? ( net-analyzer/net-snmp )
+"
+
+RDEPEND="
+ virtual/mailx
+ selinux? ( sec-policy/selinux-apcupsd )
+ ${DEPEND}
+"
+
+CONFIG_CHECK="~USB_HIDDEV ~HIDRAW"
+ERROR_USB_HIDDEV="CONFIG_USB_HIDDEV: needed to access USB-attached UPSes"
+ERROR_HIDRAW="CONFIG_HIDRAW: needed to access USB-attached UPSes"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.14.9-aliasing.patch
+ "${FILESDIR}"/${PN}-3.14.9-close-on-exec.patch
+ "${FILESDIR}"/${PN}-3.14.9-commfailure.patch
+ "${FILESDIR}"/${PN}-3.14.9-fix-nologin.patch
+ "${FILESDIR}"/${PN}-3.14.9-gapcmon.patch
+ "${FILESDIR}"/${PN}-3.14.9-wall-on-mounted-usr.patch
+ "${FILESDIR}"/${PN}-3.14.14-lto.patch
+)
+
+pkg_setup() {
+ if use kernel_linux && use usb && linux_config_exists ; then
+ check_extra_config
+ fi
+}
+
+src_prepare() {
+ default
+ # skip this specific doc step as produced files never installed
+ # this avoids calling the col command not available on musl based system.
+ sed -i "/^SUBDIRS/ s/doc//g" Makefile || die
+}
+
+src_configure() {
+ # We force the DISTNAME to gentoo so it will use gentoo's layout also
+ # when installed on non-linux systems.
+ local myeconfargs
+ myeconfargs=(
+ APCUPSD_MAIL="$(type -p mail)"
+ --disable-gapcmon
+ --enable-net
+ --enable-pcnet
+ --sbindir="/sbin"
+ --sysconfdir="${EPREFIX}/etc/apcupsd"
+ --with-distname="gentoo"
+ --with-pwrfail-dir="${EPREFIX}/etc/apcupsd"
+ --with-lock-dir="${EPREFIX}/run/apcupsd"
+ --with-log-dir="${EPREFIX}/var/log"
+ --with-nisip="127.0.0.1"
+ --with-nis-port="3551"
+ --with-pid-dir="${EPREFIX}/run/apcupsd"
+ --with-upscable="$(usex usb usb smart)"
+ --with-upstype="$(usex usb usb apcsmart)"
+ $(use_enable cgi)
+ $(use_enable modbus)
+ $(use_enable snmp)
+ $(use_enable usb)
+ $(use_with cgi cgi-bin "${EPREFIX}/usr/libexec/${PN}/cgi-bin")
+ $(usex modbus $(use_enable usb modbus-usb) "--disable-modbus-usb")
+ $(usex usb "--without-serial-dev" "--with-serial-dev=/dev/ttyS0")
+ $(usex usb "--with-dev=" "--with-dev=/dev/ttyS0")
+ )
+
+ econf "${myeconfargs[@]}"
+}
+
+src_compile() {
+ emake VERBOSE="2"
+}
+
+src_install() {
+ emake DESTDIR="${D}" VERBOSE="2" install
+
+ rm "${ED}"/etc/init.d/apcupsd || die
+ rm "${ED}"/etc/init.d/halt || die
+ rm -r "${ED}"/usr/share/hal || die
+
+ insinto /etc/apcupsd
+ newins examples/safe.apccontrol safe.apccontrol
+
+ doman doc/*.8 doc/*.5
+
+ docinto html
+ dodoc -r doc/manual/.
+ einstalldocs
+
+ newinitd "${FILESDIR}"/apcupsd.init apcupsd
+ newinitd "${FILESDIR}"/apcupsd.powerfail.init-r1 apcupsd.powerfail
+
+ systemd_dounit "${FILESDIR}"/apcupsd.service
+ dotmpfiles "${FILESDIR}"/apcupsd-tmpfiles.conf
+
+ # replace it with our udev rules if we're in Linux
+ if use kernel_linux ; then
+ udev_newrules "${FILESDIR}"/apcupsd-udev.rules 60-${PN}.rules
+ fi
+
+}
+
+pkg_postinst() {
+ use kernel_linux && udev_reload
+
+ tmpfiles_process ${PN}-tmpfiles.conf
+
+ if use cgi ; then
+ elog "The cgi-bin directory for ${PN} is /usr/libexec/${PN}/cgi-bin."
+ elog "Set up your ScriptAlias or symbolic links accordingly."
+ fi
+
+ elog ""
+ elog "Since version 3.14.0 you can use multiple apcupsd instances to"
+ elog "control more than one UPS in a single box with openRC."
+ elog "To do this, create a link between /etc/init.d/apcupsd to a new"
+ elog "/etc/init.d/apcupsd.something, and it will then load the"
+ elog "configuration file at /etc/apcupsd/something.conf."
+ 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 apcupsd.powerfail to your shutdown runlevel:'
+ elog ''
+ elog ' \e[01m rc-update add apcupsd.powerfail shutdown \e[0m'
+ elog ''
+
+ if use kernel_linux; then
+ elog "Starting from version 3.14.9-r1, ${PN} installs udev rules"
+ elog "for persistent device naming. If you have multiple UPS"
+ elog "connected to the machine, you can point them to the devices"
+ elog "in /dev/apcups/by-id directory."
+ fi
+}
+
+pkg_postrm() {
+ use kernel_linux && udev_reload
+}
diff --git a/sys-power/apcupsd/files/apcupsd-3.14.14-lto.patch b/sys-power/apcupsd/files/apcupsd-3.14.14-lto.patch
new file mode 100644
index 000000000000..54ad76b61a35
--- /dev/null
+++ b/sys-power/apcupsd/files/apcupsd-3.14.14-lto.patch
@@ -0,0 +1,29 @@
+Fix extern symbol declarations to be consistent with the definition.
+
+Bug: https://bugs.gentoo.org/941584
+Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
+
+diff -rup a/src/apcupsd.c a/src/apcupsd.c
+--- a/src/apcupsd.c
++++ b/src/apcupsd.c
+@@ -31,7 +31,7 @@ static void daemon_start(void);
+ int pidcreated = 0;
+ extern int kill_on_powerfail;
+ extern FILE *trace_fd;
+-extern char *pidfile;
++extern const char *pidfile;
+
+ /*
+ * The terminate function and trapping signals allows apcupsd
+diff -rup a/src/options.c b/src/options.c
+--- a/src/options.c
++++ b/src/options.c
+@@ -62,7 +62,7 @@ int terminate_on_powerfail = FALSE;
+ int kill_on_powerfail = FALSE;
+ int dumb_mode_test = FALSE; /* for testing dumb mode */
+ int go_background = TRUE;
+-extern char *pidfile;
++extern const char *pidfile;
+ extern bool trace;
+
+ static void print_usage(char *argv[])
diff --git a/sys-power/apcupsd/files/apcupsd.powerfail.init-r1 b/sys-power/apcupsd/files/apcupsd.powerfail.init-r1
new file mode 100644
index 000000000000..d582d9eb5b3a
--- /dev/null
+++ b/sys-power/apcupsd/files/apcupsd.powerfail.init-r1
@@ -0,0 +1,17 @@
+#!/sbin/openrc-run
+# Copyright 2009-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+description='Signal the UPS to kill power in a power failure condition'
+
+depend() {
+ need mount-ro
+}
+
+start() {
+ if [ -f /etc/apcupsd/powerfail ] ; then
+ ebegin 'Signaling UPS to kill power'
+ /sbin/apcupsd --killpower
+ eend $?
+ fi
+}
diff --git a/sys-power/apcupsd/metadata.xml b/sys-power/apcupsd/metadata.xml
index d64a3eaece13..e37ee3898b20 100644
--- a/sys-power/apcupsd/metadata.xml
+++ b/sys-power/apcupsd/metadata.xml
@@ -5,6 +5,10 @@
<email>john.einar@gmail.com</email>
<name>John Einar Reitan</name>
</maintainer>
+ <maintainer type="person">
+ <email>conikost@gentoo.org</email>
+ <name>Conrad Kostecki</name>
+ </maintainer>
<maintainer type="project">
<email>base-system@gentoo.org</email>
<name>Gentoo Base System</name>