Compare commits

...
Sign in to create a new pull request.

29 commits

Author SHA1 Message Date
Fedora Release Engineering
d71ed2aa54 Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild 2026-01-16 03:48:55 +00:00
Fedora Release Engineering
f2445acf01 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-23 17:07:44 +00:00
Gwyn Ciesla
c2ac98a585 Don't ship /usr/bin/smtp 2025-05-22 14:25:42 -05:00
Gwyn Ciesla
583cb0b03b Move binaries to bin 2025-05-09 15:00:02 -05:00
Davide Cavalca
8a2cf41162 Fix libusb conditional to make it build on EPEL 10 2025-04-23 14:15:16 -07:00
Germano Massullo
89ca1eea99 Adds 99-apcupsd-xfer-glitch.patch 2025-04-09 12:38:58 +02:00
Fedora Release Engineering
cb33d36eae Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-16 11:19:42 +00:00
Germano Massullo
cb14d73ce6 fixed license format 2024-11-11 12:50:14 +01:00
Germano Massullo
289b8ada59 Adds distinction between Fedora and EL <= 9 for BuildRequires: libusb 2024-11-08 19:41:45 +01:00
Germano Massullo
063db992f5 release bump 2024-11-08 17:39:36 +01:00
Germano Massullo
42e9efbb5f Adds disable_nologin.patch 2024-11-08 16:57:51 +01:00
Miroslav Suchý
c5aa870a6e convert GPLv2 license to SPDX
This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_4
2024-07-29 10:11:30 +02:00
Fedora Release Engineering
8aca3335ef Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-17 17:14:30 +00:00
Fedora Release Engineering
325ee1c78c Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-22 23:16:48 +00:00
Fedora Release Engineering
5d22797bc1 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-19 13:19:45 +00:00
Fedora Release Engineering
e5f8421257 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-19 13:32:21 +00:00
Fedora Release Engineering
8e55767a3a Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-18 21:57:06 +00:00
Jason Tibbitts
dd4047ce0a Depend on libusb-compat-0.1-devel. 2022-08-02 17:19:53 -05:00
Fedora Release Engineering
76adc1d87c Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-20 21:02:37 +00:00
Jason Tibbitts
e9ceaea260 Require systemd at build time
systemd used to be in the buildroot but it seems that it no longer is.
apcupsd requires /sbin/shutdown to be present at build time, so depend
on it manually.
need to make sure it's installed.
2022-01-25 11:55:46 -06:00
Fedora Release Engineering
d02bbffc60 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-19 21:27:24 +00:00
Fedora Release Engineering
1cbb103fdb - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-21 17:45:25 +00:00
Fedora Release Engineering
779e741458 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-21 12:49:22 +00:00
Jason Tibbitts
8f5ac90905 Clean up .gitignore. 2021-02-05 16:05:38 -06:00
Jason Tibbitts
3d82f65c42 Fix format-security error.
Add a patch to fix the one line of code which triggered a
format-security error instead of disabling format security checks for
the entire package.
2021-01-30 14:56:53 -06:00
Jason Tibbitts
fdc6fd1f93 Use _make_verbose instead of hacks
This is the single package which won't build with make V=1.  Now that
RPM has %_make_verbose to override this, use it instead of redefinining
%make_build.
2021-01-30 14:53:51 -06:00
Jason Tibbitts
513fee665f Fix build on F33+
Previous to F33, the files /usr/lib/rpm/config.{guess,sub} existed, and
this package copied them into the autoconf directory.  This was added in
2008 with no explanatory comment other than "new upstream version".  RPM
no longer includes those files, though copies do still exist in
/usr/lib/rpm/redhat.  The package appears fine without them.
2021-01-30 13:31:24 -06:00
Fedora Release Engineering
a8a7b6eef1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-26 00:17:16 +00:00
Tom Stellard
ebecec4c08 Add BuildRequires: make
https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot
2020-12-16 23:31:34 +00:00
6 changed files with 188 additions and 19 deletions

11
.gitignore vendored
View file

@ -1,7 +1,4 @@
apcupsd-3.14.8.tar.gz
/apcupsd-3.14.9.tar.gz
/apcupsd-3.14.10.tar.gz
/apcupsd-3.14.11.tar.gz
/apcupsd-3.14.12.tar.gz
/apcupsd-3.14.13.tar.gz
/apcupsd-3.14.14.tar.gz
/apcupsd-*.tar.gz
/apcupsd-*.src.rpm
/apcupsd-*/
/results_*/

View file

@ -0,0 +1,61 @@
diff -aruN apcupsd-3.14.14.orig/src/drivers/usb/usb.c apcupsd-3.14.14/src/drivers/usb/usb.c
--- apcupsd-3.14.14.orig/src/drivers/usb/usb.c 2024-02-24 20:22:42.007641242 +0100
+++ apcupsd-3.14.14/src/drivers/usb/usb.c 2024-02-24 20:23:03.824987965 +0100
@@ -42,7 +42,9 @@
UpsDriver(ups),
_quirk_old_backups_pro(false),
_prev_time((struct timeval){0}),
- _bpcnt(0)
+ _bpcnt(0),
+ _bacnt(0),
+ _brcnt(0)
{
}
@@ -410,8 +412,13 @@
break;
case CI_NeedReplacement:
- if (uval->iValue)
- _ups->set_replacebatt(uval->iValue);
+ if (uval->iValue) {
+ if (_brcnt++) {
+ _ups->set_replacebatt(uval->iValue);
+ }
+ } else {
+ _brcnt = 0;
+ }
Dmsg(200, "ReplaceBatt=%d\n", uval->iValue);
break;
@@ -569,11 +576,15 @@
* delayed. C'est la vie.
*/
if (uval->iValue) {
- if (_bpcnt++)
+ if (_bpcnt++) {
+ _bacnt = 0;
_ups->set_battpresent();
+ }
} else {
- _bpcnt = 0;
- _ups->clear_battpresent();
+ if (_bacnt++) {
+ _bpcnt = 0;
+ _ups->clear_battpresent();
+ }
}
Dmsg(200, "BatteryPresent=%d\n", uval->iValue);
break;
diff -aruN apcupsd-3.14.14.orig/src/drivers/usb/usb.h apcupsd-3.14.14/src/drivers/usb/usb.h
--- apcupsd-3.14.14.orig/src/drivers/usb/usb.h 2024-02-24 20:22:42.007641242 +0100
+++ apcupsd-3.14.14/src/drivers/usb/usb.h 2024-02-24 20:23:01.754956355 +0100
@@ -86,6 +86,8 @@
bool _quirk_old_backups_pro;
struct timeval _prev_time;
int _bpcnt;
+ int _bacnt;
+ int _brcnt;
};
/* Max rate to update volatile data */

View file

@ -5,7 +5,7 @@ After=network-online.target
[Service]
ExecStartPre=-/bin/rm -f /etc/apcupsd/powerfail
ExecStart=/sbin/apcupsd -b -f /etc/apcupsd/apcupsd.conf
ExecStart=/usr/bin/apcupsd -b -f /etc/apcupsd/apcupsd.conf
KillMode=process
[Install]

View file

@ -1,13 +1,13 @@
# A change in RPM 4.15 causes the make_build macro to misbuild this package.
# See https://github.com/rpm-software-management/rpm/issues/798
%global make_build %{__make} %{?_make_output_sync} %{?_smp_mflags}
%global _make_verbose %nil
Name: apcupsd
Version: 3.14.14
Release: 20%{?dist}
Release: 40%{?dist}
Summary: APC UPS Power Control Daemon
License: GPLv2
License: GPL-2.0-only
URL: http://www.apcupsd.com
Source0: https://downloads.sourceforge.net/apcupsd/apcupsd-%version.tar.gz
Source1: apcupsd.service
@ -20,13 +20,31 @@ Source5: apcupsd64x64.png
Patch0: apcupsd-3.14.9-fixgui.patch
# Halt without powering off, rhbz#1442577
Patch1: apcupsd-3.14.4-shutdown.patch
# Fix format-security error so we can enable the checks
Patch2: patch-format-security
Patch3: disable_nologin.patch
# fixes "increasing NUMXFERS" bug:
# https://sourceforge.net/p/apcupsd/mailman/apcupsd-users/thread/ad9afb27-30f9-443f-a9fb-982c41ad1325%40okazoo.eu/
# https://www.reddit.com/r/homelab/comments/1c3eo9n/apcupsd_and_proxmox_frequent_battery_disconnected/
# patch source: https://sourceforge.net/p/apcupsd/mailman/message/58741334/
Patch4: 99-apcupsd-xfer-glitch.patch
BuildRequires: gcc-c++
BuildRequires: glibc-devel, gd-devel
BuildRequires: net-snmp-devel, libusb-devel
%if %{defined fedora} || (%{defined rhel} && 0%{?rhel} > 9)
BuildRequires: libusb-compat-0.1-devel
%endif
%if (%{defined rhel} && 0%{?rhel} <= 9)
BuildRequires: libusb-devel
%endif
BuildRequires: net-snmp-devel,
BuildRequires: gtk2-devel, GConf2-devel, desktop-file-utils
# /sbin/shutdown is required to be present when building
# Somehow in F36 systemd is installed in mock but not in koji
BuildRequires: systemd
# This is part of util-linux in Fedora, but on EL7 it's in sysvinit-tools.
BuildRequires: /usr/bin/wall
BuildRequires: make
Requires: /bin/mail /usr/bin/wall
%{?systemd_requires}
@ -66,15 +84,10 @@ A GUI interface to the APC UPS monitoring daemon.
printf 'install:\n\techo skipped\n' > platforms/redhat/Makefile
%build
%global _hardened_build 1
cp -p /usr/lib/rpm/config.{guess,sub} autoconf/
export CPPFLAGS="$RPM_OPT_FLAGS -DNETSNMP_NO_LEGACY_DEFINITIONS -Wno-format-security -Wno-error=format-security"
export CXXFLAGS="$CPPFLAGS"
export CFLAGS="$CPPFLAGS"
%configure \
--sysconfdir="/etc/apcupsd" \
--with-cgi-bin="/var/www/apcupsd" \
--sbindir=/sbin \
--sbindir=%{_bindir} \
--enable-cgi \
--enable-pthreads \
--enable-net \
@ -131,7 +144,11 @@ rm examples/*.in
%config(noreplace) /etc/apcupsd/onbattery
%config(noreplace) /etc/logrotate.d/apcupsd
/usr/share/hal/fdi/policy/20thirdparty/80-apcupsd-ups-policy.fdi
%attr(0755,root,root) /sbin/*
%{_bindir}/apcaccess
%{_bindir}/apctest
%{_bindir}/apcupsd
%exclude %{_bindir}/smtp
%{_mandir}/*/*
%files cgi
@ -164,6 +181,69 @@ rm examples/*.in
%changelog
* Fri Jan 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 3.14.14-40
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
* Wed Jul 23 2025 Fedora Release Engineering <releng@fedoraproject.org> - 3.14.14-39
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Thu May 22 2025 Gwyn Ciesla <gwync@protonmail.com> - 3.14.14-38
- Don't ship /usr/bin/smtp, not used, conflicts with opensmtpd.
* Fri May 09 2025 Gwyn Ciesla <gwync@protonmail.com> - 3.14.14-37
- Move binaries from sbin to bin, 2365293.
* Wed Apr 23 2025 Davide Cavalca <dcavalca@fedoraproject.org> - 3.14.14-36
- Fix libusb conditional to make it build on EPEL 10
Fixes: RHBZ#2337139
* Wed Apr 09 2025 Germano Massullo <germano.massullo@gmail.com> - 3.14.14-35
- Adds 99-apcupsd-xfer-glitch.patch
* Thu Jan 16 2025 Fedora Release Engineering <releng@fedoraproject.org> - 3.14.14-34
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Fri Nov 08 2024 Germano Massullo <germano.massullo@gmail.com> - 3.14.14-33
- Adds distinction between Fedora and EL <= 9 for BuildRequires: libusb
* Fri Nov 08 2024 Germano Massullo <germano.massullo@gmail.com> - 3.14.14-32
- release bump
* Fri Nov 08 2024 Germano Massullo <germano.massullo@gmail.com> - 3.14.14-31
- Adds disable_nologin.patch
* Sun Jan 07 2024 Germano Massullo <germano.massullo@gmail.com> - 3.14.14-30
- disables apcupsd-3.14.4-shutdown.patch
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.14.14-29
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Wed Jan 18 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.14.14-28
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Tue Aug 02 2022 Jason L Tibbitts III <j@tib.bs> - 3.14.14-27
- Depend on libusb-compat-0.1-devel to avoid build breakage.
* Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.14.14-26
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Tue Jan 25 2022 Jason L Tibbitts III <j@tib.bs> - 3.14.14-25
- Explicitly require systemd at build time to ensure that /sbin/shutdown is
present.
* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.14.14-24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.14.14-23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Sat Jan 30 2021 Jason L Tibbitts III <tibbs@math.uh.edu> - 3.14.14-22
- Fix build on F33+.
- Allow build with format-security checking enabled.
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.14.14-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.14.14-20
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

18
disable_nologin.patch Normal file
View file

@ -0,0 +1,18 @@
diff -urNr apcupsd-3.14.14-orig/src/action.c apcupsd-3.14.14/src/action.c
--- apcupsd-3.14.14-orig/src/action.c 2015-03-20 04:59:41.000000000 +0100
+++ apcupsd-3.14.14/src/action.c 2024-11-08 16:48:46.095910557 +0100
@@ -189,13 +189,7 @@
static void prohibit_logins(UPSINFO *ups)
{
- if (ups->nologin_file)
- return; /* already done */
-
- logonfail(ups, 0);
- ups->nologin_file = true;
-
- log_event(ups, LOG_ALERT, "User logins prohibited");
+ return;
}
static void do_shutdown(UPSINFO *ups, int cmdtype)

13
patch-format-security Normal file
View file

@ -0,0 +1,13 @@
diff --git a/src/gapcmon/gapcmon.c b/src/gapcmon/gapcmon.c
index 40bf29d..111fe1f 100644
--- a/src/gapcmon/gapcmon.c
+++ b/src/gapcmon/gapcmon.c
@@ -2938,7 +2938,7 @@ static void gapc_util_log_app_msg(gchar * pch_func, gchar * pch_topic,
pch = g_strdup_printf("%s(%s) emsg=%s", pch_func, pch_topic, pch_emsg);
- g_message(pch);
+ g_message("%s", pch);
g_free(pch);