diff --git a/.gitignore b/.gitignore index 039fa15..830429c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ apcupsd-3.14.8.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 diff --git a/apcupsd-3.14.13-netopenfix.patch b/apcupsd-3.14.13-netopenfix.patch deleted file mode 100644 index face793..0000000 --- a/apcupsd-3.14.13-netopenfix.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff -up apcupsd-3.14.13/src/apcaccess.c.netopenfix apcupsd-3.14.13/src/apcaccess.c ---- apcupsd-3.14.13/src/apcaccess.c.netopenfix 2015-11-23 13:03:18.960051659 +0100 -+++ apcupsd-3.14.13/src/apcaccess.c 2015-11-23 13:07:37.225759158 +0100 -@@ -49,7 +49,7 @@ static int do_pthreads_status(const char - char recvline[MAXSTRING + 1]; - char *line; - -- if ((sockfd = net_open(host, NULL, port)) == INVALID_SOCKET) { -+ if ((sockfd = net_open(host, NULL, port)) < 0) { - fprintf(stderr, "Error contacting apcupsd @ %s:%d: %s\n", - host, port, strerror(-sockfd)); - return 1; -diff -up apcupsd-3.14.13/src/cgi/upsfetch.c.netopenfix apcupsd-3.14.13/src/cgi/upsfetch.c ---- apcupsd-3.14.13/src/cgi/upsfetch.c.netopenfix 2015-11-23 13:09:20.108837721 +0100 -+++ apcupsd-3.14.13/src/cgi/upsfetch.c 2015-11-23 13:09:20.153838193 +0100 -@@ -114,7 +114,7 @@ static int fetch_data(const char *host) - *p++ = '\0'; - nis_port = atoi(p); - } -- if ((sockfd = net_open(lhost, NULL, nis_port)) == INVALID_SOCKET) { -+ if ((sockfd = net_open(lhost, NULL, nis_port)) < 0) { - (void) snprintf(errmsg, sizeof (errmsg), - "upsfetch: tcp_open failed for %s port %d", lhost, nis_port); - return 0; -@@ -153,7 +153,7 @@ int fetch_events(const char *host) - *p++ = '\0'; - nis_port = atoi(p); - } -- if ((sockfd = net_open(lhost, NULL, nis_port)) == INVALID_SOCKET) { -+ if ((sockfd = net_open(lhost, NULL, nis_port)) < 0) { - snprintf(errmsg, sizeof(errmsg), - "upsfetch: tcp_open failed for %s port %d", lhost, nis_port); - fputs(errmsg, stdout); -diff -up apcupsd-3.14.13/src/drivers/net/net.c.netopenfix apcupsd-3.14.13/src/drivers/net/net.c ---- apcupsd-3.14.13/src/drivers/net/net.c.netopenfix 2015-11-23 13:09:33.997983325 +0100 -+++ apcupsd-3.14.13/src/drivers/net/net.c 2015-11-23 13:09:34.041983787 +0100 -@@ -202,7 +202,7 @@ bool NetUpsDriver::poll_ups() - _statlen = 0; - - Dmsg(20, "Opening connection to %s:%d\n", _hostname, _port); -- if ((_sockfd = net_open(_hostname, NULL, _port)) == INVALID_SOCKET) { -+ if ((_sockfd = net_open(_hostname, NULL, _port)) < 0) { - Dmsg(90, "Exit poll_ups 0 comm lost\n"); - if (!_ups->is_commlost()) { - _ups->set_commlost(); -diff -up apcupsd-3.14.13/src/lib/statmgr.cpp.netopenfix apcupsd-3.14.13/src/lib/statmgr.cpp ---- apcupsd-3.14.13/src/lib/statmgr.cpp.netopenfix 2015-11-23 13:08:48.076501913 +0100 -+++ apcupsd-3.14.13/src/lib/statmgr.cpp 2015-11-23 13:08:48.105502218 +0100 -@@ -199,12 +199,12 @@ bool StatMgr::open() - close(); - - m_socket = net_open(m_host, NULL, m_port); -- return m_socket != INVALID_SOCKET; -+ return m_socket >= 0; - } - - void StatMgr::close() - { -- if (m_socket != INVALID_SOCKET) { -+ if (m_socket != INVALID_SOCKET && m_socket >= 0) { - net_close(m_socket); - m_socket = INVALID_SOCKET; - } diff --git a/apcupsd.spec b/apcupsd.spec index 800526f..91e8ebb 100644 --- a/apcupsd.spec +++ b/apcupsd.spec @@ -1,6 +1,6 @@ Name: apcupsd -Version: 3.14.13 -Release: 5%{?dist} +Version: 3.14.14 +Release: 1%{?dist} Summary: APC UPS Power Control Daemon for Linux Group: System Environment/Daemons @@ -18,7 +18,6 @@ Patch3: apcupsd-3.14.8-systemd.patch # fix crash in gui, rhbz#578276 Patch4: apcupsd-3.14.9-fixgui.patch -Patch5: apcupsd-3.14.13-netopenfix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -67,7 +66,6 @@ A GUI interface to the APC UPS monitoring daemon. %patch1 -p1 -b .shutdown %patch3 -p1 -b .systemd %patch4 -p1 -b .fixgui -%patch5 -p1 -b .netopenfix #we will handle fedora/redhat part ourselfs printf 'install:\n\techo skipped\n' >platforms/redhat/Makefile @@ -75,7 +73,9 @@ 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="$CPPFLAGS -DNETSNMP_NO_LEGACY_DEFINITIONS" +export CPPFLAGS="$RPM_OPT_FLAGS -DNETSNMP_NO_LEGACY_DEFINITIONS -Wno-format-security -Wno-error=format-security" +export CXXFLAGS="$CPPFLAGS" +export CFLAGS="$CPPFLAGS" %configure \ --sysconfdir="%{_sysconfdir}/apcupsd" \ --with-cgi-bin="%{_localstatedir}/www/apcupsd" \ @@ -187,6 +187,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Jun 02 2016 Michal Hlavinka - 3.14.14-1 +- updated to 3.14.14 + * Wed Feb 03 2016 Fedora Release Engineering - 3.14.13-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild diff --git a/sources b/sources index 290d693..4cc7ee2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c291d9d3923b4d9c0e600b755ad4f489 apcupsd-3.14.13.tar.gz +cc8f5ced77f38906a274787acb9bc980 apcupsd-3.14.14.tar.gz