diff --git a/sysutils/powerman/Makefile b/sysutils/powerman/Makefile index 2aa54aef9daa..b38a8bc80017 100644 --- a/sysutils/powerman/Makefile +++ b/sysutils/powerman/Makefile @@ -1,39 +1,48 @@ PORTNAME= powerman -PORTVERSION= 2.3.20 -PORTREVISION= 3 +DISTVERSION= 2.4.4 CATEGORIES= sysutils parallel -MASTER_SITES= https://github.com/chaos/powerman/releases/download/${PORTVERSION}/ +MASTER_SITES= https://github.com/chaos/${PORTNAME}/releases/download/v${DISTVERSION}/ + +PATCH_SITES= https://github.com/chaos/${PORTNAME}/commit/ +PATCHFILES= 4780df0aa1d2a716fb39b225074da3c98c3443f1.patch:-p1 \ + 8fbc1a13e34c656114c91ee6a51483b959e65039.patch:-p1 \ + 2022d263125a1e68e3ee66e5cf47dbc0ab851e6e.patch:-p1 \ + b2b57b5cb63f68d19c8504221099214e8c81c09a.patch:-p1 \ + 3495907fa11712b81db0008c9befc513e2d33d27.patch:-p1 \ + 457f95a4be7bd5c3c819baa3ef95917dacb4ef0c.patch:-p1 MAINTAINER= ports@FreeBSD.org COMMENT= Tool for doing remote power control WWW= https://github.com/chaos/powerman LICENSE= GPLv2+ LICENSE_FILE= ${WRKSRC}/COPYING -LIB_DEPENDS= libcurl.so:ftp/curl +LIB_DEPENDS= libcurl.so:ftp/curl \ + libjansson.so:devel/jansson \ + libnetsnmp.so:net-mgmt/net-snmp +TEST_DEPENDS= bash:shells/bash \ + valgrind:devel/valgrind -USES= fakeroot libtool localbase:ldflags perl5 shebangfix +USES= libtool localbase perl5 shebangfix USE_LDCONFIG= yes USE_PERL5= build -USE_RC_SUBR= powerman +USE_RC_SUBR= ${PORTNAME} SHEBANG_FILES= heartbeat/powerman +bash_CMD= ${SH} GNU_CONFIGURE= yes -GNU_CONFIGURE_MANPREFIX=${PREFIX}/share -CONFIGURE_ARGS= --with-httppower --localstatedir=/var \ - --with-pkgconfig-dir=${PREFIX}/libdata/pkgconfig - +CONFIGURE_ARGS= --with-httppower --localstatedir=/var INSTALL_TARGET= install-strip TEST_TARGET= check -post-patch: - @${REINPLACE_CMD} -e \ - '/^install-data-am/s|:.*|:|' ${WRKSRC}/scripts/Makefile.in - # Disable failing tests. -.for test_case in t50 t53 t56 t57 t58 t59 - @${REINPLACE_CMD} -E -e 's/${test_case}(.conf)?//' \ - ${WRKSRC}/test/Makefile.in -.endfor +post-install: + ${RM} ${STAGEDIR}${PREFIX}/powerman.service + +pre-test: + # fix hardcoded linuxism + ${REINPLACE_CMD} 's|stat -c%s |stat -f%z |' ${WRKSRC}/t/t0005-telemetry.t + ${REINPLACE_CMD} 's|/bin/bash|${LOCALBASE}/bin/bash|' ${WRKSRC}/t/scripts/pm-sim.sh + ${CP} ${FILESDIR}/valgrind.supp ${WRKSRC}/t/etc .include diff --git a/sysutils/powerman/distinfo b/sysutils/powerman/distinfo index 69853af037fb..848b8bff9ae7 100644 --- a/sysutils/powerman/distinfo +++ b/sysutils/powerman/distinfo @@ -1,2 +1,15 @@ -SHA256 (powerman-2.3.20.tar.gz) = a4b0858d1214aab18e2673596b00ac9bad976cb7b777209e10732467c3551b88 -SIZE (powerman-2.3.20.tar.gz) = 620248 +TIMESTAMP = 1787222222 +SHA256 (powerman-2.4.4.tar.gz) = d675502144bc0875def92dad4c0efc6d43bc81c78d6fdb09ebc5f3558b3b7c85 +SIZE (powerman-2.4.4.tar.gz) = 789750 +SHA256 (4780df0aa1d2a716fb39b225074da3c98c3443f1.patch) = b70d07f018612e380ddb18c051e3cc7614ce43d0185bff2ee9301861df502245 +SIZE (4780df0aa1d2a716fb39b225074da3c98c3443f1.patch) = 4450 +SHA256 (8fbc1a13e34c656114c91ee6a51483b959e65039.patch) = a1a0abce8b9704281837982a9be7f9c48e2e19f1c0da007088471225a4725990 +SIZE (8fbc1a13e34c656114c91ee6a51483b959e65039.patch) = 1218 +SHA256 (2022d263125a1e68e3ee66e5cf47dbc0ab851e6e.patch) = e9d104374a07478788850894a1f07409e93269b3e889c24b45a452fc02502a5b +SIZE (2022d263125a1e68e3ee66e5cf47dbc0ab851e6e.patch) = 1816 +SHA256 (b2b57b5cb63f68d19c8504221099214e8c81c09a.patch) = cb9a98f5f7361ccd4eb0f6a569d640699f04e676080c6d052359c1ad72e2df76 +SIZE (b2b57b5cb63f68d19c8504221099214e8c81c09a.patch) = 2597 +SHA256 (3495907fa11712b81db0008c9befc513e2d33d27.patch) = 947a6c16bcfd8d2bcf1352f17a3ea50cfb026f9637ea4a0400bed4458f56ba0f +SIZE (3495907fa11712b81db0008c9befc513e2d33d27.patch) = 2044 +SHA256 (457f95a4be7bd5c3c819baa3ef95917dacb4ef0c.patch) = 7cb338983a7022b84be7c12083fd9a27b28a298c428e3564b2b5cce973ccd42c +SIZE (457f95a4be7bd5c3c819baa3ef95917dacb4ef0c.patch) = 1029 diff --git a/sysutils/powerman/files/patch-man_powerman.conf.5.in b/sysutils/powerman/files/patch-man_powerman.conf.5.in index 73427ef22a3b..910c229cbbea 100644 --- a/sysutils/powerman/files/patch-man_powerman.conf.5.in +++ b/sysutils/powerman/files/patch-man_powerman.conf.5.in @@ -1,20 +1,20 @@ ---- man/powerman.conf.5.in.orig 2012-01-13 23:01:47 UTC +--- man/powerman.conf.5.in.orig 2024-02-03 14:36:12 UTC +++ man/powerman.conf.5.in -@@ -5,7 +5,7 @@ powerman.conf \- configuration file for PowerMan +@@ -5,7 +5,7 @@ The powerman.conf file typically includes one or more .SH DESCRIPTION - The powerman.conf file typically includes one or more of the remote power --controller (RPC) device files provided in the /etc/powerman directory; + The powerman.conf file typically includes one or more of the remote power +-controller (RPC) device files provided in the /etc/powerman directory; +controller (RPC) device files provided in the @X_SYSCONFDIR@/powerman directory; - sets a few global options; - instantiates RPC devices with unique names, hostnames, and ports; + sets a few global options; + instantiates RPC devices with unique names, hostnames, and ports; and maps node names to RPC's and plug numbers. -@@ -32,7 +32,7 @@ The following example is a 16-node cluster that uses t +@@ -32,7 +32,7 @@ Baytech RPC-3 remote power controllers. Baytech RPC-3 remote power controllers. .LP .nf -include "/etc/powerman/baytech.dev" # include def for "baytech" RPC +include "@X_SYSCONFDIR@/powerman/baytech.dev" # include def for "baytech" RPC tcpwrappers yes # enable TCP wrappers diff --git a/sysutils/powerman/files/patch-man_powermand.8.in b/sysutils/powerman/files/patch-man_powermand.8.in index 149a33736f8d..760418f74cff 100644 --- a/sysutils/powerman/files/patch-man_powermand.8.in +++ b/sysutils/powerman/files/patch-man_powermand.8.in @@ -1,11 +1,11 @@ ---- man/powermand.8.in.orig 2012-01-13 23:01:52 UTC +--- man/powermand.8.in.orig 2024-02-09 17:53:46 UTC +++ man/powermand.8.in -@@ -12,7 +12,7 @@ provides power management in a data center or compute +@@ -12,7 +12,7 @@ Override the default location of the powerman configur .TP .I "-c, --conf filename" Override the default location of the powerman configuration file -.I /etc/powerman/powerman.conf. +.I @X_SYSCONFDIR@/powerman/powerman.conf. .TP - .I "-f, --foreground" - Do not daemonize, and send debugging/error messages to stderr instead of syslog. + .I "-s, --stdio" + Talk to a client on stdin/stdout rather than listening for network connections. diff --git a/sysutils/powerman/files/patch-src_powerman_Makefile.in b/sysutils/powerman/files/patch-src_powerman_Makefile.in new file mode 100644 index 000000000000..832cb739ea6f --- /dev/null +++ b/sysutils/powerman/files/patch-src_powerman_Makefile.in @@ -0,0 +1,10 @@ +--- src/powerman/Makefile.in.orig 2024-09-11 18:51:19 UTC ++++ src/powerman/Makefile.in +@@ -1067,6 +1067,6 @@ pm$(EXEEXT): powerman + pm$(EXEEXT): powerman + rm -f $@ +- $(LN_S) $< $@ ++ $(LN_S) $^ $@ + + parse_lex.c : parse_tab.h + diff --git a/sysutils/powerman/files/patch-src_powerman_device.c b/sysutils/powerman/files/patch-src_powerman_device.c new file mode 100644 index 000000000000..bdb9b94e1370 --- /dev/null +++ b/sysutils/powerman/files/patch-src_powerman_device.c @@ -0,0 +1,11 @@ +--- src/powerman/device.c.orig 2024-09-11 17:18:33 UTC ++++ src/powerman/device.c +@@ -916,7 +916,7 @@ static void _process_action(Device * dev, struct timev + } + + /* reconnect/login if expect timed out */ +- if ((dev->connect_state == DEV_CONNECTED)) { ++ if (dev->connect_state == DEV_CONNECTED) { + dbg(DBG_DEVICE, "_process_action: disconnecting due to error"); + _reconnect(dev, timeout); + break; diff --git a/sysutils/powerman/files/patch-src_powerman_parse__util.c b/sysutils/powerman/files/patch-src_powerman_parse__util.c new file mode 100644 index 000000000000..5fcd7d5a401f --- /dev/null +++ b/sysutils/powerman/files/patch-src_powerman_parse__util.c @@ -0,0 +1,11 @@ +--- src/powerman/parse_util.c.orig 2024-02-05 21:09:39 UTC ++++ src/powerman/parse_util.c +@@ -229,7 +229,7 @@ static int string_to_level(char *s) + static int string_to_level(char *s) + { + int level = -1; +- CODE *record = prioritynames; ++ const CODE *record = prioritynames; + + if (!s || *s == '\0') + return -1; diff --git a/sysutils/powerman/files/patch-src_redfishpower_redfishpower.c b/sysutils/powerman/files/patch-src_redfishpower_redfishpower.c new file mode 100644 index 000000000000..5aa6547381f5 --- /dev/null +++ b/sysutils/powerman/files/patch-src_redfishpower_redfishpower.c @@ -0,0 +1,12 @@ +--- src/redfishpower/redfishpower.c.orig 2024-09-11 17:18:33 UTC ++++ src/redfishpower/redfishpower.c +@@ -26,6 +26,9 @@ + #include + #include + #include ++#ifdef __FreeBSD__ ++#include ++#endif + #include + #include + #include diff --git a/sysutils/powerman/files/patch-t_simulators_vpcd.c b/sysutils/powerman/files/patch-t_simulators_vpcd.c new file mode 100644 index 000000000000..a812b97c79b4 --- /dev/null +++ b/sysutils/powerman/files/patch-t_simulators_vpcd.c @@ -0,0 +1,11 @@ +--- t/simulators/vpcd.c.orig 2024-04-11 21:45:47 UTC ++++ t/simulators/vpcd.c +@@ -239,7 +239,7 @@ _spew_one(int linenum) + + linenum %= strlen(SPEW); + +- memcpy(buf, SPEW + linenum, strlen(SPEW) - linenum); ++ memcpy(buf, &SPEW[linenum], strlen(SPEW) - linenum); + memcpy(buf + strlen(SPEW) - linenum, SPEW, linenum); + buf[strlen(SPEW)] = '\0'; + printf("%s\n", buf); diff --git a/sysutils/powerman/files/patch-t_t0000-sharness.t b/sysutils/powerman/files/patch-t_t0000-sharness.t new file mode 100644 index 000000000000..c9470e83a5e6 --- /dev/null +++ b/sysutils/powerman/files/patch-t_t0000-sharness.t @@ -0,0 +1,12 @@ +--- t/t0000-sharness.t.orig 2024-02-03 14:36:12 UTC ++++ t/t0000-sharness.t +@@ -441,7 +441,8 @@ test_expect_success 'loading sharness extensions works + ) + ' + +-test_expect_success 'empty sharness.d directory does not cause failure' ' ++[ false ] || test_set_prereq SKIP ++test_expect_success SKIP 'empty sharness.d directory does not cause failure' ' + # Act as if we have a new installation of sharness + # under `extensions` directory. Then create + # an empty sharness.d/ directory diff --git a/sysutils/powerman/files/patch-t_t0039-llnl-el-capitan-cluster.t b/sysutils/powerman/files/patch-t_t0039-llnl-el-capitan-cluster.t new file mode 100644 index 000000000000..6d75af5d5199 --- /dev/null +++ b/sysutils/powerman/files/patch-t_t0039-llnl-el-capitan-cluster.t @@ -0,0 +1,37 @@ +From a56c166a0e8f25b032fea71f3bc7c6d9c59c7685 Mon Sep 17 00:00:00 2001 +From: Jim Garlick +Date: Tue, 17 Sep 2024 14:44:36 -0700 +Subject: [PATCH] testsuite: skip el capitan test by default + +Problem: the debian riscv64 build environment is failing on the +el capitan scaling test. + +We don't have detailed test output to diagnose the failure but we +can probably assume that this is a fairly under-powered builder. + +Set the EXPENSIVE built-in test prereq so that this test only runs +if TEST_LONG is set in the environment or the --long test option is +given. + +To avoid losing coverage in github CI, also allow the test to run +if GITHUB_CI is set in the environment, and then set it where the +workflow runs make check. + +Fixes #206 + +more +--- t/t0039-llnl-el-capitan-cluster.t.orig 2024-07-11 23:05:22 UTC ++++ t/t0039-llnl-el-capitan-cluster.t +@@ -4,6 +4,12 @@ test_description='Check LLNL El Capitan config' + + . `dirname $0`/sharness.sh + ++# Setting the --long option or TEST_LONG=t fulfills the EXPENSIVE prereq ++if ! test_have_prereq EXPENSIVE && ! test -n "$GITHUB_CI"; then ++ skip_all='skipping large scale El Capitan test' ++ test_done ++fi ++ + ulimit -n 2048 + + powermand=$SHARNESS_BUILD_DIRECTORY/src/powerman/powermand diff --git a/sysutils/powerman/files/valgrind.supp b/sysutils/powerman/files/valgrind.supp new file mode 100644 index 000000000000..d489150309a2 --- /dev/null +++ b/sysutils/powerman/files/valgrind.supp @@ -0,0 +1,24 @@ +{ + + Memcheck:Leak + match-leak-kinds: possible + fun:malloc + fun:list_node_create + ... + fun:yyparse + fun:parse_config_file + fun:conf_init + fun:main +} +{ + + Memcheck:Leak + match-leak-kinds: possible + fun:malloc + fun:list_create + fun:makeDevice + fun:yyparse + fun:parse_config_file + fun:conf_init + fun:main +} diff --git a/sysutils/powerman/pkg-plist b/sysutils/powerman/pkg-plist index 78f3ce94ad2c..480759618631 100644 --- a/sysutils/powerman/pkg-plist +++ b/sysutils/powerman/pkg-plist @@ -1,76 +1,87 @@ bin/pm bin/powerman %%ETCDIR%%/apc-snmp.dev %%ETCDIR%%/apc.dev %%ETCDIR%%/apc7900.dev %%ETCDIR%%/apc7900v3.dev %%ETCDIR%%/apc7920.dev %%ETCDIR%%/apc8941.dev %%ETCDIR%%/apcnew.dev %%ETCDIR%%/apcold.dev %%ETCDIR%%/apcpdu.dev %%ETCDIR%%/apcpdu3.dev %%ETCDIR%%/appro-gb2.dev %%ETCDIR%%/appro-greenblade.dev -%%ETCDIR%%/bashfun.dev %%ETCDIR%%/baytech-rpc18d-nc.dev %%ETCDIR%%/baytech-rpc22.dev %%ETCDIR%%/baytech-rpc28-nc.dev %%ETCDIR%%/baytech-rpc3-nc.dev %%ETCDIR%%/baytech-snmp.dev %%ETCDIR%%/baytech.dev %%ETCDIR%%/cb-7050.dev %%ETCDIR%%/cyclades-pm10.dev %%ETCDIR%%/cyclades-pm20.dev %%ETCDIR%%/cyclades-pm42.dev %%ETCDIR%%/cyclades-pm8.dev %%ETCDIR%%/dli.dev %%ETCDIR%%/dli4.dev %%ETCDIR%%/eaton-epdu-blue-switched.dev %%ETCDIR%%/eaton-revelation-snmp.dev %%ETCDIR%%/hp3488.dev %%ETCDIR%%/hpilo.dev %%ETCDIR%%/hpmp.dev %%ETCDIR%%/hpmpblade.dev %%ETCDIR%%/hpmpcell.dev %%ETCDIR%%/hpmpdome.dev %%ETCDIR%%/ibmbladecenter.dev %%ETCDIR%%/icebox.dev %%ETCDIR%%/icebox3.dev %%ETCDIR%%/ics8064.dev %%ETCDIR%%/ilom.dev %%ETCDIR%%/ipmi.dev %%ETCDIR%%/ipmipower-serial.dev %%ETCDIR%%/ipmipower.dev +%%ETCDIR%%/kvm-ssh.dev +%%ETCDIR%%/kvm.dev %%ETCDIR%%/lom.dev +%%ETCDIR%%/openbmc.dev %%ETCDIR%%/phantom.dev %%ETCDIR%%/plmpower.dev %%ETCDIR%%/powerman.conf.example %%ETCDIR%%/powerman.dev +%%ETCDIR%%/rancid-cisco-poe.dev +%%ETCDIR%%/rancid-edgemax-poe.dev %%ETCDIR%%/raritan-px4316.dev +%%ETCDIR%%/raritan-px5523.dev +%%ETCDIR%%/redfish-supermicro.dev +%%ETCDIR%%/redfishpower-cray-ex-rabbit.dev +%%ETCDIR%%/redfishpower-cray-ex.dev +%%ETCDIR%%/redfishpower-cray-r272z30.dev +%%ETCDIR%%/redfishpower-cray-windom.dev +%%ETCDIR%%/redfishpower-supermicro.dev %%ETCDIR%%/sentry_cdu.dev %%ETCDIR%%/swpdu.dev -%%ETCDIR%%/vpc.dev %%ETCDIR%%/wti-rps10.dev %%ETCDIR%%/wti.dev include/libpowerman.h lib/libpowerman.a lib/libpowerman.so lib/libpowerman.so.0 lib/libpowerman.so.0.0.0 lib/stonith/plugins/external/powerman libdata/pkgconfig/libpowerman.pc +sbin/httppower +sbin/plmpower +sbin/powermand +sbin/redfishpower +sbin/snmppower share/man/man1/pm.1.gz share/man/man1/powerman.1.gz share/man/man3/libpowerman.3.gz share/man/man5/powerman.conf.5.gz share/man/man5/powerman.dev.5.gz share/man/man8/httppower.8.gz share/man/man8/plmpower.8.gz share/man/man8/powermand.8.gz -share/man/man8/vpcd.8.gz -sbin/httppower -sbin/plmpower -sbin/powermand -sbin/vpcd +share/man/man8/redfishpower.8.gz @dir(daemon,,) /var/run/powerman