1 include ..
/..
/Makefile.omd
6 DIR
= $(NAME
)-$(VERSION
)
7 EDIR
= mkeventd-
$(VERSION
)
13 tar xzf
$(EDIR
).
tar.gz
17 export bindir='$(OMD_ROOT)/bin' ; \
18 export sharedir
='$(OMD_ROOT)/share/check_mk' ; \
19 export checksdir
='$(OMD_ROOT)/share/check_mk/checks' ; \
20 export modulesdir
='$(OMD_ROOT)/share/check_mk/modules' ; \
21 export web_dir
='$(OMD_ROOT)/share/check_mk/web' ; \
22 export mibsdir
='$(OMD_ROOT)/share/snmp/mibs' ; \
23 export docdir
='$(OMD_ROOT)/share/doc/check_mk' ; \
24 export checkmandir
='$(OMD_ROOT)/share/check_mk/checkman' ; \
25 export agentsdir
='$(OMD_ROOT)/share/check_mk/agents' ; \
26 export agentslibdir
='/usr/lib/check_mk_agent' ; \
27 export nagios_binary
='$(OMD_ROOT)/bin/nagios' ; \
28 export check_icmp_path
='$(OMD_ROOT)/lib/nagios/plugins/check_icmp' ; \
29 export pnptemplates
='$(OMD_ROOT)/share/check_mk/pnp-templates' ; \
30 export livebackendsdir
='$(OMD_ROOT)/share/check_mk/livestatus' ; \
31 export libdir='$(OMD_ROOT)/lib/check_mk' ; \
32 export confdir
='$(OMD_ROOT)/skel/etc/check_mk' ; \
33 export pnpconfdir
='$(OMD_ROOT)/skel/etc/pnp4nagios' ; \
34 export pnprraconf
='$(OMD_ROOT)/share/check_mk/pnp-rraconf' ; \
35 export apache_config_dir
='/REMOVE/skel/etc/apache' ; \
36 export agentsconfdir
='/etc/check_mk' ; \
37 export vardir
='/REMOVE/var/lib/check_mk' ; \
38 export nagios_config_file
='/REMOVE/etc/nagios/nagios.cfg' ; \
39 export nagconfdir
='/REMOVE/etc/nagios/conf.d' ; \
40 export htpasswd_file
='/REMOVE/etc/nagios/htpasswd' ; \
41 export nagios_startscript
='/REMOVE/etc/init.d/nagios' ; \
42 export nagpipe
='/REMOVE/var/run/nagios/rw/nagios.cmd' ; \
43 export rrddir
='/REMOVE/var/lib/nagios/rrd' ; \
44 export nagios_status_file
='/REMOVE/var/spool/nagios/status.dat' ; \
45 export livesock
='/REMOVE/var/run/nagios/rw/live' ; \
46 export checkmk_web_uri
='/nag01/check_mk' ; \
47 export nagiosurl
='/nag01/nagios' ; \
48 export cgiurl
='/nag01/nagios/cgi-bin' ; \
49 export pnp_url
='/nag01/pnp4nagios/' ; \
50 export enable_livestatus
='no' ; \
51 export nagios_auth_name
='Nagios Access' ; \
52 export nagiosuser
='nagios' ; \
53 export wwwgroup
='nagios' ; \
54 cd
$(DIR
) ; DESTDIR
=$(DESTDIR
) .
/setup.sh
--yes
56 # Delete files we do not want to package
57 rm -rf
$(DESTDIR
)/REMOVE
58 rm -f
$(DESTDIR
)$(OMD_ROOT
)/skel
/etc
/check_mk
/*-*.mk
60 # Install special version of check_mk dealing with site specific defaults
61 install -m
755 check_mk
$(DESTDIR
)$(OMD_ROOT
)/bin
62 ln
-sfn check_mk
$(DESTDIR
)$(OMD_ROOT
)/bin
/cmk
63 echo
-e
'#!/bin/sh\nexec check_mk -P "$$@"' > $(DESTDIR
)$(OMD_ROOT
)/bin
/mkp
64 chmod
755 $(DESTDIR
)$(OMD_ROOT
)/bin
/mkp
66 # defaults.py for Multisite which redirects to site specific defaults
67 install -m
644 defaults.py
$(DESTDIR
)$(OMD_ROOT
)/share
/check_mk
/web
/htdocs
70 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/bin
71 install -m
755 $(EDIR
)/bin
/* $(DESTDIR
)$(OMD_ROOT
)/bin
72 install -m
755 $(EDIR
)/src
/mkevent
$(DESTDIR
)$(OMD_ROOT
)/bin
73 install -m
755 $(EDIR
)/src
/mkeventd_open514
$(DESTDIR
)$(OMD_ROOT
)/bin
74 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/lib
/nagios
/plugins
75 install -m
755 $(EDIR
)/lib
/* $(DESTDIR
)$(OMD_ROOT
)/lib
/nagios
/plugins
76 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/share
/check_mk
/checks
77 install -m
644 $(EDIR
)/checks
/* $(DESTDIR
)$(OMD_ROOT
)/share
/check_mk
/checks
78 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/share
/check_mk
/web
79 cp
-pr
$(EDIR
)/web
/* $(DESTDIR
)$(OMD_ROOT
)/share
/check_mk
/web
81 # Install the diskspace cleanup plugin
82 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/share
/diskspace
83 install -m
644 diskspace
$(DESTDIR
)$(OMD_ROOT
)/share
/diskspace
/nagios
86 rm -f
$(SKEL
)/etc
/check_mk
/main.mk-
*
87 rm -f
$(SKEL
)/etc
/check_mk
/multisite.mk-
*
90 rm -rf check_mk-
*.
*.
*[0-9]
91 rm -rf mkeventd-
*.
*.
*[0-9]
93 # Get new upstream version (as in VERSION)
94 # Adapt configuration files for skeleton from upstream version
96 if
[ ! -e check_mk-
$(VERSION
).
tar.gz
] ; then
rm -f check_mk-
*.
tar.gz
; wget http
://mathias-kettner.de
/download
/check_mk-
$(VERSION
).
tar.gz
; fi
97 if
[ ! -e mkeventd-
$(VERSION
).
tar.gz
] ; then
rm -f mkeventd-
*.
tar.gz
; wget http
://mathias-kettner.de
/download
/mkeventd-
$(VERSION
).
tar.gz
; fi
98 # check_mk_templates.cfg -> enter correct URLs and paths
99 if
tar tvzf check_mk-
$(VERSION
).
tar.gz | grep check_mk-
$(VERSION
)/share.
tar.gz
>/dev
/null
2>&1; then \
100 tar xzf check_mk-
$(VERSION
).
tar.gz
--to-stdout check_mk-
$(VERSION
)/share.
tar.gz | \
101 tar xzf
- --to-stdout check_mk_templates.cfg | \
102 sed
-e
's-@CHECK_ICMP@-$$USER4$$/lib/nagios/plugins/check_icmp-g' \
103 -e
's-@BINDIR@/--g' \
104 -e
's-@VARDIR@-$$USER4$$/var/check_mk-g' \
105 -e
's-@PNPURL@-/###SITE###/pnp4nagios/-g' \
106 -e
's-@CGIURL@-/###SITE###/nagios/cgi\-bin-g' > \
107 skel
/etc
/nagios
/conf.d
/check_mk_templates.cfg
; \
109 tar xzf check_mk-
$(VERSION
).
tar.gz
--to-stdout check_mk-
$(VERSION
)/doc.
tar.gz | \
110 tar xzf
- --to-stdout check_mk_templates.cfg | \
111 sed
-e
's-@CHECK_ICMP@-$$USER4$$/lib/nagios/plugins/check_icmp-g' \
112 -e
's-@BINDIR@/--g' \
113 -e
's-@VARDIR@-$$USER4$$/var/check_mk-g' \
114 -e
's-@PNPURL@-/###SITE###/pnp4nagios/-g' \
115 -e
's-@CGIURL@-/###SITE###/nagios/cgi\-bin-g' > \
116 skel
/etc
/nagios
/conf.d
/check_mk_templates.cfg
; \
119 # multisite.mk - replace nagiosadmin with omadmin
120 tar xzf check_mk-
$(VERSION
).
tar.gz
--to-stdout check_mk-
$(VERSION
)/conf.
tar.gz | \
121 tar xzf
- --to-stdout multisite.mk-
$(VERSION
) | \
122 sed
-e
's/nagiosadmin/omdadmin/g' \
123 -e
's@^nagvis_base_url.*@nagvis_base_url = "/###SITE###/nagvis"@' \
124 > skel
/etc
/check_mk
/multisite.mk
126 # Add correct version number
127 sed
-i
"s/^check_mk_version.*/check_mk_version = '$(VERSION)'/" skel
/etc
/check_mk
/defaults
129 git add check_mk-
$(VERSION
).
tar.gz
130 git add mkeventd-
$(VERSION
).
tar.gz