pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/56756: net/nagios-plugin-dumpdates fails to build on Solarish



>Number:         56756
>Category:       pkg
>Synopsis:       net/nagios-plugin-dumpdates fails to build on Solarish
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 16 21:10:00 +0000 2022
>Originator:     Claes Nästén
>Release:        trunk 2022-01-13
>Organization:
>Environment:
SunOS 5.10 sun4v sparc SUNW,SPARC-Enterprise-T2000

>Description:
net/nagios-plugin-dumpdates fails to build on Solarish, fails for me on Solaris 10 but is also failing on bulktracker SmartOS:

gcc -D_XOPEN_SOURCE=500  -c check_dumpdates.c
check_dumpdates.c: In function 'main':
check_dumpdates.c:149:20: error: 'DUMPINFMT' undeclared (first use in this function)
  149 |   (void)fscanf(fp, DUMPINFMT, name, &level, timebuf);
      |                    ^~~~~~~~~
check_dumpdates.c:149:20: note: each undeclared identifier is reported only once for each function it appears in

Makefile patch to iniclude LDFLAGS is there to add flexibility fixing Solaris 10 missing features, should not be required on SmartOS but would be nice to have there.
>How-To-Repeat:
Build net/nagios-plugin-dumpdates
>Fix:
diff --git a/net/nagios-plugin-dumpdates/Makefile b/net/nagios-plugin-dumpdates/Makefile
index b6d42dea025..a65b9c59c52 100644
--- a/net/nagios-plugin-dumpdates/Makefile
+++ b/net/nagios-plugin-dumpdates/Makefile
@@ -12,6 +12,8 @@ HOMEPAGE=     https://ftp.espci.fr/pub/nagios-local/
 COMMENT=       /etc/dumpdates monitoring plugin for Nagios
 LICENSE=       modified-bsd
 
+BUILDLINK_TRANSFORM.SunOS+=    opt:-D_XOPEN_SOURCE=500:-D__EXTENSIONS__
+
 INSTALLATION_DIRS+=    libexec/nagios
 
 do-install:
diff --git a/net/nagios-plugin-dumpdates/patches/patch-Makefile b/net/nagios-plugin-dumpdates/patches/patch-Makefile
new file mode 100644
index 00000000000..e6ea0b59817
--- /dev/null
+++ b/net/nagios-plugin-dumpdates/patches/patch-Makefile
@@ -0,0 +1,16 @@
+$NetBSD$
+
+--- Makefile.orig      2022-03-16 13:02:08.451189037 +0000
++++ Makefile
+@@ -1,9 +1,10 @@
+ CFLAGS=       -D_XOPEN_SOURCE=500
++LDFLAGS?=
+ 
+ all:  check_dumpdates
+ 
+ check_dumpdates:      check_dumpdates.o
+-      $(CC) -o check_dumpdates check_dumpdates.o
++      $(CC) $(LDFLAGS) -o check_dumpdates check_dumpdates.o
+ 
+ clean:
+       rm -f *.o *.core check_dumpdates
diff --git a/net/nagios-plugin-dumpdates/patches/patch-check__dumpdates.c b/net/nagios-plugin-dumpdates/patches/patch-check__dumpdates.c
new file mode 100644
index 00000000000..af9f1d6339e
--- /dev/null
+++ b/net/nagios-plugin-dumpdates/patches/patch-check__dumpdates.c
@@ -0,0 +1,17 @@
+$NetBSD$
+
+Add includes for DUMPINFMT on SunOS
+
+--- check_dumpdates.c.orig     2022-03-16 12:23:49.628692153 +0000
++++ check_dumpdates.c
+@@ -43,6 +43,10 @@
+ #include <ufs/ufs/dinode.h>
+ #include <protocols/dumprestore.h>
+ #endif
++#ifdef __sun
++#include <sys/fs/ufs_inode.h>
++#include <protocols/dumprestore.h>
++#endif
+ 
+ #ifndef _PATH_DUMPDATES
+ #define     _PATH_DUMPDATES "/etc/dumpdates"



Home | Main Index | Thread Index | Old Index