Hello community,

here is the log from the commit of package nsca for openSUSE:Factory checked in 
at 2017-11-10 14:56:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nsca (Old)
 and      /work/SRC/openSUSE:Factory/.nsca.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "nsca"

Fri Nov 10 14:56:49 2017 rev:7 rq:539625 version:2.9.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/nsca/nsca.changes        2017-03-20 
17:08:43.312994410 +0100
+++ /work/SRC/openSUSE:Factory/.nsca.new/nsca.changes   2017-11-10 
14:57:13.880438564 +0100
@@ -1,0 +2,17 @@
+Tue Nov  7 09:38:47 UTC 2017 - [email protected]
+
+- Fixed E: nsca implicit-fortify-decl ./nsca.c:495 via
+  nsca-2.9.2-implicit-fortify-decl.patch
+
+-------------------------------------------------------------------
+Thu Jun 29 16:05:30 UTC 2017 - [email protected]
+
+- added nsca-2.9.2-implicit_functions.patch to add missing includes
+  crabbed out by the compiler
+- enable and support systemd
+- fix copy and paste error in triggerun and run for the old name
+  (nagios-nsca) of this package  
+- rebase all patches and add/correct the comments for them in the
+  spec file
+
+-------------------------------------------------------------------

New:
----
  nsca-2.9.2-implicit-fortify-decl.patch
  nsca-2.9.2-implicit_functions.patch
  nsca.service

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ nsca.spec ++++++
--- /var/tmp/diff_new_pack.HvBDTY/_old  2017-11-10 14:57:15.008397766 +0100
+++ /var/tmp/diff_new_pack.HvBDTY/_new  2017-11-10 14:57:15.012397621 +0100
@@ -16,6 +16,12 @@
 #
 
 
+%if 0%{?suse_version} >= 1230
+%bcond_without systemd
+%else
+%bcond_with systemd
+%endif
+
 Name:           nsca
 Version:        2.9.2
 Release:        0
@@ -30,12 +36,18 @@
 Source4:        send_nsca.1
 Source5:        nsca.1
 Source6:        usr.bin.nsca
-# PATCH-MISSING-TAG -- See http://en.opensuse.org/Packaging/Patches
+Source7:        nsca.service
+# PATCH-FIX-UPSTREAM fix some compiler warnings that might become errors
 Patch1:         nsca.abuild.patch
-# PATCH-MISSING-TAG -- See http://en.opensuse.org/Packaging/Patches
+# PATCH-FIX-OPENSUSE disable the xinetd service per default - in that case it 
is also not
+# needed to bind on any specific address
 Patch2:         nsca.xinetd.patch
-# PATCH-MISSING-TAG -- See http://en.opensuse.org/Packaging/Patches
+# PATCH-FIX-OPENSUSE adapt the spool directory to follow openSUSE guidelines
 Patch3:         nsca.spooldir.patch
+# PATCH-FIX-UPSTREAM add missing includes for special functions
+Patch4:         nsca-2.9.2-implicit_functions.patch
+# PATCH-FIX-UPSTREAM fixed implicit-fortify-decl
+Patch5:         nsca-2.9.2-implicit-fortify-decl.patch
 BuildRequires:  libmcrypt-devel
 BuildRequires:  nagios-rpm-macros
 BuildRequires:  tcpd-devel
@@ -43,7 +55,12 @@
 Recommends:     monitoring_daemon
 Provides:       nagios-nsca = %{version}
 Obsoletes:      nagios-nsca < 2.9.0
+%if %{with systemd}
+BuildRequires:  systemd
+%{?systemd_requires}
+%else
 PreReq:         %insserv_prereq
+%endif
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
 %description
@@ -65,9 +82,11 @@
 
 %prep
 %setup -q
-%patch1
-%patch2
-%patch3
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
 
 %build
 export CFLAGS="%{optflags}"
@@ -93,8 +112,14 @@
 install -m 644 sample-config/nsca.cfg %{buildroot}%{_sysconfdir}/
 install -m 644 sample-config/send_nsca.cfg %{buildroot}%{_sysconfdir}/
 install -m 644 sample-config/nsca.xinetd 
%{buildroot}%{_sysconfdir}/xinetd.d/nsca
+# startup scripts
+%if %{with systemd}
+install -Dm0644 %{SOURCE7} %{buildroot}%{_unitdir}/%{name}.service
+ln -s -f %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
+%else
 install -m 755 %{SOURCE1}    %{buildroot}%{_sysconfdir}/init.d/nsca
 ln -sf ../../%{_sysconfdir}/init.d/nsca %{buildroot}%{_sbindir}/rcnsca
+%endif
 chmod 644 README
 # install SuSEfirewall2 script
 %if 0%{?suse_version} > 1020
@@ -106,15 +131,46 @@
 # install apparmor profile
 install -Dm644 %{SOURCE6} %{buildroot}%{_sysconfdir}/apparmor.d/usr.bin.nsca
 
+%pre
+%service_add_pre %{name}.service
+
+%post
+%service_add_post %{name}.service
+
 %preun
+%if %{with systemd}
+%service_del_preun %{name}.service
+%else
 %stop_on_removal nsca
+%endif
 
 %postun
+%if %{with systemd}
+%service_del_postun %{name}.service
+%else
 %restart_on_update nsca
 %insserv_cleanup
+%endif
 
-%triggerpostun -- nagios-nrpe < 2.9.2
+%triggerun -- nagios-nsca < 2.9.2
 STATUS='/var/adm/update-scripts/%{name}'
+%if %{with systemd}
+if [ -x %{_bindir}/systemctl ]; then
+       %{_bindir}/systemctl status nsca.service >/dev/null
+       if test $? = 0; then
+               echo "%{_bindir}/systemctl restart nsca.service" >> "$STATUS"
+       else
+        touch "$STATUS"
+    fi
+       %{_bindir}/systemctl status xinetd.service >/dev/null
+       if test $? = 0; then
+               echo "%{_bindir}/systemctl try-restart xinetd.service" >> 
"$STATUS"
+       else
+        touch "$STATUS"
+    fi
+    chmod +x "$STATUS"
+fi
+%else
 if [ -x %{_sysconfdir}/init.d/nsca ]; then
        %{_sysconfdir}/init.d/nsca status >/dev/null
        if test $? = 0; then
@@ -133,16 +189,16 @@
     fi
     chmod +x "$STATUS"
 fi
+%endif
 
 %triggerpostun -- nagios-nsca < 2.9.2
 # Move /etc/nagios/nsca.conf to /etc/nsca.conf when updating from an old 
version
 # and inform the admin about the move.
-pushd %{_sysconfdir}
+cd %{_sysconfdir}
 if test -e nagios/nsca.conf.rpmsave -a ! -e nsca.conf.rpmnew; then
     mv nsca/nsca.conf nsca.conf.rpmnew
     mv nagios/nsca.conf.rpmsave nsca.conf
     test -L %{nagios_sysconfdir}/nsca.conf || ln -s %{_sysconfdir}/nsca.conf 
%{nagios_sysconfdir}/nsca.conf
-       %restart_on_update nsca
 fi
 sed -i "s|%{nagios_sysconfdir}/nsca.cfg|%{_sysconfdir}/nsca.cfg|g" 
%{_sysconfdir}/xinetd.d/nsca || :
 if [ -e /var/adm/update-scripts/%{name} ]; then
@@ -153,7 +209,7 @@
 %triggerpostun -- nagios-nsca-client < 2.9.2
 # Move /etc/nagios/send_nsca.cfg to /etc/send_nsca.cfg when updating from an 
old version
 # and inform the admin about the move.
-pushd %{_sysconfdir}
+cd %{_sysconfdir}
 if test -e nagios/send_nsca.cfg.rpmsave -a ! -e send_nsca.cfg.rpmnew; then
        mv nsca/send_nsca.cfg send_nsca.cfg.rpmnew
        mv nagios/send_nsca.cfg send_nsca.cfg
@@ -165,16 +221,20 @@
 
 %files
 %defattr(-,root,root)
+%doc Changelog README SECURITY LEGAL
 %dir %{_sysconfdir}/apparmor.d
 %{_bindir}/nsca
+%if %{with systemd}
+%{_unitdir}/%{name}.service
+%else
 %{_sysconfdir}/init.d/nsca
+%endif
 %{_sbindir}/rcnsca
 %config(noreplace) %{_sysconfdir}/apparmor.d/usr.bin.nsca
 %config(noreplace) %{_sysconfdir}/nsca.cfg
 %config(noreplace) %{_sysconfdir}/xinetd.d/nsca
 %config(noreplace) %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name}
 %{_mandir}/man1/nsca.1*
-%doc Changelog README SECURITY LEGAL
 
 %files client
 %defattr(-,root,root)

++++++ nsca-2.9.2-implicit-fortify-decl.patch ++++++
diff -Naur nsca-2.9.2.orig/src/nsca.c nsca-2.9.2/src/nsca.c
--- nsca-2.9.2.orig/src/nsca.c  2016-12-07 17:00:07.000000000 +0100
+++ nsca-2.9.2/src/nsca.c       2017-11-07 10:36:59.328120296 +0100
@@ -16,6 +16,7 @@
  * 
  
******************************************************************************/
 
+#define _GNU_SOURCE
 #include "../include/common.h"
 #include "../include/config.h"
 #include "../include/netutils.h"
++++++ nsca-2.9.2-implicit_functions.patch ++++++
Index: nsca-2.9.2/src/nsca.c
===================================================================
--- nsca-2.9.2.orig/src/nsca.c
+++ nsca-2.9.2/src/nsca.c
@@ -21,7 +21,10 @@
 #include "../include/netutils.h"
 #include "../include/utils.h"
 #include "../include/nsca.h"
-
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/socket.h>
 
 static int server_port=DEFAULT_SERVER_PORT;
 static char server_address[16]="0.0.0.0";
++++++ nsca.abuild.patch ++++++
--- /var/tmp/diff_new_pack.HvBDTY/_old  2017-11-10 14:57:15.088394872 +0100
+++ /var/tmp/diff_new_pack.HvBDTY/_new  2017-11-10 14:57:15.088394872 +0100
@@ -1,6 +1,7 @@
-diff -rupN nsca-2.9.2.orig/src/nsca.c nsca-2.9.2/src/nsca.c
---- src/nsca.c.orig    2016-12-07 17:00:07.000000000 +0100
-+++ src/nsca.c 2016-12-16 08:00:05.584700722 +0100
+Index: nsca-2.9.2/src/nsca.c
+===================================================================
+--- nsca-2.9.2.orig/src/nsca.c
++++ nsca-2.9.2/src/nsca.c
 @@ -737,6 +737,7 @@ static int find_rhand(int fd){
        /* we couldn't find the read handler */
          syslog(LOG_ERR, "Handler stack corrupt - aborting");

++++++ nsca.service ++++++
[Unit]
Description=Nagios Service Check Acceptor
After=network.target syslog.target auditd.service
Wants=network.target
Requires=var-run.mount

[Service]
Type=forking
ExecStart=-/usr/bin/nsca -c /etc/nsca.cfg --single
ExecReload=/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target
++++++ nsca.spooldir.patch ++++++
--- /var/tmp/diff_new_pack.HvBDTY/_old  2017-11-10 14:57:15.120393715 +0100
+++ /var/tmp/diff_new_pack.HvBDTY/_new  2017-11-10 14:57:15.120393715 +0100
@@ -1,6 +1,8 @@
---- sample-config/nsca.cfg.in.a        2011-11-10 23:41:11.000000000 +0100
-+++ sample-config/nsca.cfg.in  2011-11-10 23:42:22.000000000 +0100
-@@ -73,7 +73,7 @@
+Index: nsca-2.9.2/sample-config/nsca.cfg.in
+===================================================================
+--- nsca-2.9.2.orig/sample-config/nsca.cfg.in
++++ nsca-2.9.2/sample-config/nsca.cfg.in
+@@ -73,7 +73,7 @@ nsca_group=@nsca_grp@
  # NOTE: if you specify this option, the command file will be opened
  #       relative to this directory.
  
@@ -9,7 +11,7 @@
  
  
  
-@@ -90,7 +90,7 @@
+@@ -90,7 +90,7 @@ debug=0
  # This is the location of the Nagios command file that the daemon
  # should write all service check results that it receives.
  
@@ -18,7 +20,7 @@
  
  
  # ALTERNATE DUMP FILE
-@@ -103,7 +103,7 @@
+@@ -103,7 +103,7 @@ command_file=@localstatedir@/rw/nagios.c
  # it starts Nagios.  Or you may simply choose to ignore any
  # check results received while Nagios was not running...
  

++++++ nsca.xinetd.patch ++++++
--- /var/tmp/diff_new_pack.HvBDTY/_old  2017-11-10 14:57:15.128393426 +0100
+++ /var/tmp/diff_new_pack.HvBDTY/_new  2017-11-10 14:57:15.132393281 +0100
@@ -1,5 +1,7 @@
---- sample-config/nsca.xinetd.in.a     2011-11-10 23:43:39.000000000 +0100
-+++ sample-config/nsca.xinetd.in       2011-11-10 23:45:15.000000000 +0100
+Index: nsca-2.9.2/sample-config/nsca.xinetd.in
+===================================================================
+--- nsca-2.9.2.orig/sample-config/nsca.xinetd.in
++++ nsca-2.9.2/sample-config/nsca.xinetd.in
 @@ -1,15 +1,17 @@
 -# default: on
 +# default: off


Reply via email to