pkgsrc/net/xymonclient/patches/patch-ac
spz 544cf480ee update xymon + xymonclient to 4.3.28
notable changes: OpenSSL 1.1.0 is now supported, and c-ares has been updated

While touching the package anyhow, it has been taught to pass down hardening
flags, so that the various PKGSRC_USE_ flags now have effect.
2017-09-28 10:40:35 +00:00

112 lines
5.8 KiB
Text

$NetBSD: patch-ac,v 1.7 2017/09/28 10:40:35 spz Exp $
pkgsrcify
allow hardening
--- client/Makefile.orig 2014-01-07 21:43:56.000000000 +0000
+++ client/Makefile
@@ -24,6 +24,25 @@ XYMONCLIENTCOMMLIBS = $(XYMONCLIENTCOMML
PROGRAMS=xymonlaunch logfetch clientupdate orcaxymon msgcache
COMMONTOOLS=xymon xymoncmd xymongrep xymoncfg xymondigest
+ifndef INSTALLBINDIR
+INSTALLBINDIR = $(XYMONHOME)/bin
+endif
+ifndef INSTALLETCDIR
+INSTALLETCDIR = $(XYMONHOME)/etc
+endif
+ifndef INSTALLEXTDIR
+INSTALLEXTDIR = $(XYMONHOME)/ext
+endif
+ifndef INSTALLLOCALDIR
+INSTALLLOCALDIR = $(XYMONHOME)/local
+endif
+ifndef INSTALLTMPDIR
+INSTALLTMPDIR = $(XYMONHOME)/tmp
+endif
+ifndef XYMONLOGDIR
+XYMONLOGDIR = $(XYMONHOME)/logs
+endif
+
all: $(PROGRAMS) $(COMMONTOOLS) xymonclient.cfg clientlaunch.cfg $(EXTRATOOLS)
xymonclient.cfg: xymonclient.cfg.DIST
@@ -38,46 +57,45 @@ else
endif
logfetch: logfetch.c $(XYMONCLIENTLIB)
- $(CC) $(CFLAGS) -o $@ logfetch.c $(XYMONCLIENTLIBS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ logfetch.c $(XYMONCLIENTLIBS)
clientupdate: clientupdate.c $(XYMONCLIENTCOMMLIB) $(XYMONCLIENTLIB)
- $(CC) $(CFLAGS) -o $@ clientupdate.c $(XYMONCLIENTCOMMLIBS) $(XYMONCLIENTLIBS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ clientupdate.c $(XYMONCLIENTCOMMLIBS) $(XYMONCLIENTLIBS)
orcaxymon: orcaxymon.c $(XYMONCLIENTCOMMLIB) $(XYMONCLIENTLIB)
- $(CC) $(CFLAGS) -o $@ orcaxymon.c $(XYMONCLIENTCOMMLIBS) $(XYMONCLIENTLIBS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ orcaxymon.c $(XYMONCLIENTCOMMLIBS) $(XYMONCLIENTLIBS)
msgcache: msgcache.c $(XYMONCLIENTLIB)
- $(CC) $(CFLAGS) -o $@ msgcache.c $(XYMONCLIENTCOMMLIBS) $(XYMONCLIENTLIBS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ msgcache.c $(XYMONCLIENTCOMMLIBS) $(XYMONCLIENTLIBS)
hpux-meminfo: hpux-meminfo.c
- $(CC) -o $@ hpux-meminfo.c
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ hpux-meminfo.c
freebsd-meminfo: freebsd-meminfo.c
- $(CC) -o $@ freebsd-meminfo.c
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ freebsd-meminfo.c
openbsd-meminfo: openbsd-meminfo.c
- $(CC) -o $@ openbsd-meminfo.c
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ openbsd-meminfo.c
netbsd-meminfo: netbsd-meminfo.c
- $(CC) -o $@ netbsd-meminfo.c
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ netbsd-meminfo.c
install:
- if test ! -d $(INSTALLROOT)$(XYMONHOME) ; then mkdir -p $(INSTALLROOT)$(XYMONHOME) ; chmod 755 $(INSTALLROOT)$(XYMONHOME) ; fi
- if test ! -d $(INSTALLROOT)$(XYMONHOME)/bin ; then mkdir -p $(INSTALLROOT)$(XYMONHOME)/bin ; chmod 755 $(INSTALLROOT)$(XYMONHOME)/bin ; fi
- if test ! -d $(INSTALLROOT)$(XYMONHOME)/etc ; then mkdir -p $(INSTALLROOT)$(XYMONHOME)/etc ; chmod 755 $(INSTALLROOT)$(XYMONHOME)/etc ; fi
- if test ! -d $(INSTALLROOT)$(XYMONHOME)/tmp ; then mkdir -p $(INSTALLROOT)$(XYMONHOME)/tmp ; chmod 755 $(INSTALLROOT)$(XYMONHOME)/tmp ; fi
- if test ! -d $(INSTALLROOT)$(XYMONHOME)/logs ; then mkdir -p $(INSTALLROOT)$(XYMONHOME)/logs ; chmod 755 $(INSTALLROOT)$(XYMONHOME)/logs ; fi
- if test ! -d $(INSTALLROOT)$(XYMONHOME)/ext ; then mkdir -p $(INSTALLROOT)$(XYMONHOME)/ext ; chmod 755 $(INSTALLROOT)$(XYMONHOME)/ext ; fi
- if test ! -d $(INSTALLROOT)$(XYMONHOME)/local ; then mkdir -p $(INSTALLROOT)$(XYMONHOME)/local ; chmod 755 $(INSTALLROOT)$(XYMONHOME)/local; fi
- if test ! -f $(INSTALLROOT)$(XYMONHOME)/etc/localclient.cfg ; then cp localclient.cfg $(INSTALLROOT)$(XYMONHOME)/etc/ ; chmod 644 $(INSTALLROOT)$(XYMONHOME)/etc/localclient.cfg; fi
- if test ! -f $(INSTALLROOT)$(XYMONHOME)/local/README; then cp README-local $(INSTALLROOT)$(XYMONHOME)/local/README ; chmod 644 $(INSTALLROOT)$(XYMONHOME)/local/README; fi
- chmod 755 runclient.sh $(PROGRAMS) xymonclient*.sh $(COMMONTOOLS) $(EXTRATOOLS)
- cp -fp runclient.sh $(INSTALLROOT)$(XYMONHOME)
- cp -fp $(PROGRAMS) xymonclient*.sh $(COMMONTOOLS) $(EXTRATOOLS) $(INSTALLROOT)$(XYMONHOME)/bin/
-
- ../build/merge-sects clientlaunch.cfg $(INSTALLROOT)$(XYMONHOME)/etc/clientlaunch.cfg
- ../build/merge-lines xymonclient.cfg $(INSTALLROOT)$(XYMONHOME)/etc/xymonclient.cfg
- chmod 644 $(INSTALLROOT)$(XYMONHOME)/etc/clientlaunch.cfg $(INSTALLROOT)$(XYMONHOME)/etc/xymonclient.cfg
+ if test ! -d $(INSTALLROOT)$(XYMONHOME) ; then mkdir -p $(INSTALLROOT)$(XYMONHOME) ; fi
+ if test ! -d $(INSTALLROOT)$(INSTALLBINDIR) ; then mkdir -p $(INSTALLROOT)$(INSTALLBINDIR) ; fi
+ if test ! -d $(INSTALLROOT)$(INSTALLETCDIR) ; then mkdir -p $(INSTALLROOT)$(INSTALLETCDIR) ; fi
+ if test ! -d $(INSTALLROOT)$(INSTALLTMPDIR) ; then mkdir -p $(INSTALLROOT)$(INSTALLTMPDIR) ; fi
+ if test ! -d $(INSTALLROOT)$(XYMONLOGDIR) ; then mkdir -p $(INSTALLROOT)$(XYMONLOGDIR) ; fi
+ if test ! -d $(INSTALLROOT)$(INSTALLEXTDIR) ; then mkdir -p $(INSTALLROOT)$(INSTALLEXTDIR) ; fi
+ if test ! -d $(INSTALLROOT)$(INSTALLLOCALDIR) ; then mkdir -p $(INSTALLROOT)$(INSTALLLOCALDIR) ; fi
+ if test ! -f $(INSTALLROOT)$(INSTALLETCDIR)/localclient.cfg ; then cp localclient.cfg $(INSTALLROOT)$(INSTALLETCDIR)/ ; fi
+ if test ! -f $(INSTALLROOT)$(INSTALLLOCALDIR)/README; then cp README-local $(INSTALLROOT)$(INSTALLLOCALDIR)/README ; chmod 644 $(INSTALLROOT)$(INSTALLLOCALDIR)/README; fi
+ cp -fp runclient.sh $(INSTALLROOT)$(INSTALLBINDIR)
+ cp -fp $(PROGRAMS) xymonclient*.sh $(COMMONTOOLS) $(EXTRATOOLS) $(INSTALLROOT)$(INSTALLBINDIR)
+ chmod ugo+x $(INSTALLROOT)$(INSTALLBINDIR)/*
+
+ ../build/merge-sects clientlaunch.cfg $(INSTALLROOT)$(INSTALLETCDIR)/clientlaunch.cfg
+ ../build/merge-lines xymonclient.cfg $(INSTALLROOT)$(INSTALLETCDIR)/xymonclient.cfg
ifndef PKGBUILD
chown -R $(XYMONUSER) $(INSTALLROOT)$(XYMONHOME)
@@ -87,7 +105,7 @@ endif
install-localclient:
chmod 755 xymond_client
- cp -fp xymond_client $(INSTALLROOT)$(XYMONHOME)/bin/
+ cp -fp xymond_client $(INSTALLROOT)$(INSTALLBINDIR)/
ifndef PKGBUILD
chown $(XYMONUSER) $(INSTALLROOT)$(XYMONHOME)/bin/xymond_client
chgrp `$(IDTOOL) -g $(XYMONUSER)` $(INSTALLROOT)$(XYMONHOME)/bin/xymond_client