summaryrefslogtreecommitdiff
path: root/net/xymonclient/patches/patch-ac
blob: 76bf2e73719382fbf283b2115d9bce272d012020 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
$NetBSD: patch-ac,v 1.4 2012/08/07 06:51:58 sbd Exp $

--- client/Makefile.orig	2011-12-12 22:15:39.000000000 +0000
+++ client/Makefile
@@ -19,6 +19,25 @@ endif
 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
@@ -58,28 +77,58 @@ netbsd-meminfo: netbsd-meminfo.c
 
 install:
 	if test ! -d $(INSTALLROOT)$(XYMONHOME)       ; then mkdir -p $(INSTALLROOT)$(XYMONHOME)       ; fi
-	if test ! -d $(INSTALLROOT)$(XYMONHOME)/bin   ; then mkdir -p $(INSTALLROOT)$(XYMONHOME)/bin   ; fi
-	if test ! -d $(INSTALLROOT)$(XYMONHOME)/etc   ; then mkdir -p $(INSTALLROOT)$(XYMONHOME)/etc   ; fi
-	if test ! -d $(INSTALLROOT)$(XYMONHOME)/tmp   ; then mkdir -p $(INSTALLROOT)$(XYMONHOME)/tmp   ; fi
-	if test ! -d $(INSTALLROOT)$(XYMONHOME)/logs  ; then mkdir -p $(INSTALLROOT)$(XYMONHOME)/logs  ; fi
-	if test ! -d $(INSTALLROOT)$(XYMONHOME)/ext   ; then mkdir -p $(INSTALLROOT)$(XYMONHOME)/ext   ; fi
-	if test ! -d $(INSTALLROOT)$(XYMONHOME)/local ; then mkdir -p $(INSTALLROOT)$(XYMONHOME)/local ; fi
-	if test ! -f $(INSTALLROOT)$(XYMONHOME)/etc/localclient.cfg ; then cp localclient.cfg $(INSTALLROOT)$(XYMONHOME)/etc/ ; fi
-	if test ! -f $(INSTALLROOT)$(XYMONHOME)/local/README; then cp README-local $(INSTALLROOT)$(XYMONHOME)/local/README ; chmod 644 $(INSTALLROOT)$(XYMONHOME)/local/README; fi
-	cp -fp runclient.sh $(INSTALLROOT)$(XYMONHOME)
-	cp -fp $(PROGRAMS) xymonclient*.sh $(COMMONTOOLS) $(EXTRATOOLS) $(INSTALLROOT)$(XYMONHOME)/bin/
-	chmod ugo+x $(INSTALLROOT)$(XYMONHOME)/bin/*
+	if test ! -d $(INSTALLROOT)$(INSTALLBINDIR)   ; then mkdir -p $(INSTALLROOT)$(INSTALLBINDIR)   ; fi
+ifndef PKGBUILD
+ifneq ($(INSTALLBINDIR),$(XYMONHOME)/bin)
+	ln -sf $(INSTALLBINDIR) $(INSTALLROOT)$(XYMONHOME)/bin
+endif
+endif
+	if test ! -d $(INSTALLROOT)$(INSTALLETCDIR)   ; then mkdir -p $(INSTALLROOT)$(INSTALLETCDIR)   ; fi
+ifndef PKGBUILD
+ifneq ($(INSTALLETCDIR),$(XYMONHOME)/etc)
+	ln -sf $(INSTALLETCDIR) $(INSTALLROOT)$(XYMONHOME)/etc
+endif
+endif
+	if test ! -d $(INSTALLROOT)$(INSTALLTMPDIR)   ; then mkdir -p $(INSTALLROOT)$(INSTALLTMPDIR)   ; fi
+ifndef PKGBUILD
+ifneq ($(INSTALLTMPDIR),$(XYMONHOME)/tmp)
+	ln -sf $(INSTALLTMPDIR) $(INSTALLROOT)$(XYMONHOME)/tmp
+endif
+endif
+	if test ! -d $(INSTALLROOT)$(XYMONLOGDIR)  ; then mkdir -p $(INSTALLROOT)$(XYMONLOGDIR)  ; fi
+ifndef PKGBUILD
+ifneq ($(BBLOGDIR),$(XYMONHOME)/log)
+	ln -sf $(BBLOGDIR) $(INSTALLROOT)$(XYMONHOME)/log
+endif
+endif
+	if test ! -d $(INSTALLROOT)$(INSTALLEXTDIR)   ; then mkdir -p $(INSTALLROOT)$(INSTALLEXTDIR)   ; fi
+ifndef PKGBUILD
+ifneq ($(INSTALLEXTDIR),$(XYMONHOME)/ext)
+	ln -sf $(INSTALLEXTDIR) $(INSTALLROOT)$(XYMONHOME)/ext
+endif
+endif
+	if test ! -d $(INSTALLROOT)$(INSTALLLOCALDIR) ; then mkdir -p $(INSTALLROOT)$(INSTALLLOCALDIR) ; fi
+ifndef PKGBUILD
+ifneq ($(INSTALLLOCALDIR),$(XYMONHOME)/local)
+	ln -sf $(INSTALLLOCALDIR) $(INSTALLROOT)$(XYMONHOME)/local
+endif
+endif
+	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)$(XYMONHOME)/etc/clientlaunch.cfg
-	../build/merge-lines xymonclient.cfg $(INSTALLROOT)$(XYMONHOME)/etc/xymonclient.cfg
+	../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)
+	chown -R $(XYMONUSER) $(INSTALLROOT)$(XYMONHOME) $(INSTALLROOT)$(INSTALLETCDIR) $(INSTALLROOT)$(INSTALLEXADIR) $(INSTALLROOT)$(INSTALLEXTDIR) $(INSTALLROOT)$(INSTALLBINDIR) $(INSTALLROOT)$(INSTALLTMPDIR) $(INSTALLROOT)$(XYMONLOGDIR) $$(INSTALLROOT)$(INSTALLLOCALDIR)
 endif
 
 install-localclient:
-	cp -fp xymond_client $(INSTALLROOT)$(XYMONHOME)/bin/
+	cp -fp xymond_client $(INSTALLROOT)$(INSTALLBINDIR)
 ifndef PKGBUILD
-	chown $(XYMONUSER) $(INSTALLROOT)$(XYMONHOME)/bin/xymond_client
+	chown $(XYMONUSER) $(INSTALLROOT)$(INSTALLBINDIR)/xymond_client
 endif
 
 clean: