NetBSD Problem Report #56756
From www@netbsd.org Wed Mar 16 21:07:51 2022
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 662031A921F
for <gnats-bugs@gnats.NetBSD.org>; Wed, 16 Mar 2022 21:07:51 +0000 (UTC)
Message-Id: <20220316210749.C04041A9239@mollari.NetBSD.org>
Date: Wed, 16 Mar 2022 21:07:49 +0000 (UTC)
From: pekdon@gmail.com
Reply-To: pekdon@gmail.com
To: gnats-bugs@NetBSD.org
Subject: net/nagios-plugin-dumpdates fails to build on Solarish
X-Send-Pr-Version: www-1.0
>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"
(Contact us)
$NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.