check_oracle_health: update to 1.9.3.5
[omd.git] / packages / nagios / Makefile
blobab84015fa0874a8f91f742e736cd3e138b5dc396
1 include ../../Makefile.omd
3 NAME = nagios
4 VERSION = 3.5.0
5 DIR = $(NAME)-$(VERSION)
7 # Configure options for Nagios. Since we want to compile
8 # as non-root, we use our own user and group for compiling.
9 # All files will be packaged as user 'root' later anyway.
10 CONFIGUREOPTS = \
11 --sbindir=$(OMD_ROOT)/lib/nagios/cgi-bin \
12 --bindir=$(OMD_ROOT)/bin \
13 --datadir=$(OMD_ROOT)/share/nagios/htdocs \
14 --with-nagios-user=$$(id -un) \
15 --with-nagios-group=$$(id -gn) \
16 --with-perlcache \
17 --enable-embedded-perl \
19 build:
20 $(MAKE) prep
21 $(MAKE) compile
23 prep:
24 $(MAKE) unpack
25 $(MAKE) patch
27 compile:
28 cd $(DIR) ; ./configure $(CONFIGUREOPTS)
29 $(MAKE) -C $(DIR) all
31 unpack:
32 rm -rf $(DIR)
33 tar xzf $(DIR).tar.gz
34 mv nagios $(DIR)
36 patch:
37 set -e ; for p in patches/*.dif ; do \
38 echo "applying $$p..." ; \
39 ( cd $(DIR) ; patch -p1 -b ) < $$p ; \
40 done
44 install:
45 $(MAKE) DESTDIR=$(DESTDIR) -C $(DIR) install-base install-cgis install-html install-classicui
46 rm -f $(DESTDIR)$(OMD_ROOT)/share/nagios/htdocs/config.php.inc
48 # Install Themes
49 mkdir -p $(DESTDIR)$(OMD_ROOT)/share/nagios/htdocs/themes/classicui
50 cp -a $(DESTDIR)$(OMD_ROOT)/share/nagios/htdocs/stylesheets $(DESTDIR)$(OMD_ROOT)/share/nagios/htdocs/themes/classicui/
51 cp -a $(DESTDIR)$(OMD_ROOT)/share/nagios/htdocs/images $(DESTDIR)$(OMD_ROOT)/share/nagios/htdocs/themes/classicui/
52 $(MAKE) DESTDIR=$(DESTDIR) -C $(DIR) install-exfoliation
53 mkdir -p $(DESTDIR)$(OMD_ROOT)/share/nagios/htdocs/themes/exfoliation
54 cp -a $(DESTDIR)$(OMD_ROOT)/share/nagios/htdocs/stylesheets $(DESTDIR)$(OMD_ROOT)/share/nagios/htdocs/themes/exfoliation/
55 cp -a $(DESTDIR)$(OMD_ROOT)/share/nagios/htdocs/images $(DESTDIR)$(OMD_ROOT)/share/nagios/htdocs/themes/exfoliation/
56 # remove original files
57 rm -rf $(DESTDIR)$(OMD_ROOT)/share/nagios/htdocs/stylesheets
58 rm -rf $(DESTDIR)$(OMD_ROOT)/share/nagios/htdocs/images
59 # Link ClassicUI
60 cd $(DESTDIR)$(OMD_ROOT)/share/nagios/htdocs; rm -rf styleshets; ln -sfn themes/classicui/stylesheets
61 cd $(DESTDIR)$(OMD_ROOT)/share/nagios/htdocs; rm -rf images; ln -sfn themes/classicui/images
63 mkdir -p $(DESTDIR)$(OMD_ROOT)/lib/nagios
64 install -m 664 $(DIR)/p1.pl $(DESTDIR)$(OMD_ROOT)/lib/nagios
66 mkdir -p $(DESTDIR)$(OMD_ROOT)/share/nagios/htdocs/ssi
67 install -m 755 ssi-wrapper.pl $(DESTDIR)$(OMD_ROOT)/share/nagios/htdocs/ssi
69 for f in common avail cmd config extinfo histogram history notifications outages showlog status statusmap statuswml statuswrl summary tac trends ; do \
70 ln -sfn ssi-wrapper.pl $(DESTDIR)$(OMD_ROOT)/share/nagios/htdocs/ssi/$$f-header.ssi ; \
71 ln -sfn ssi-wrapper.pl $(DESTDIR)$(OMD_ROOT)/share/nagios/htdocs/ssi/$$f-footer.ssi ; \
72 done
74 # Copy package documentations to have these information in the binary packages
75 mkdir -p $(DESTDIR)$(OMD_ROOT)/share/doc/$(NAME)
76 for file in README THANKS LEGAL LICENSE ; do \
77 install -m 644 $(DIR)/$$file $(DESTDIR)$(OMD_ROOT)/share/doc/$(NAME); \
78 done
80 mkdir -p $(DESTDIR)$(OMD_ROOT)/bin
81 install -m 755 merge-nagios-config $(DESTDIR)$(OMD_ROOT)/bin
83 # Install the diskspace cleanup plugin
84 mkdir -p $(DESTDIR)$(OMD_ROOT)/share/diskspace
85 install -m 644 diskspace $(DESTDIR)$(OMD_ROOT)/share/diskspace/nagios
87 clean:
88 rm -rf $(DIR)
90 testpatches:
91 @rm -rf $(DIR)
92 @tar xzf $(DIR).tar.gz
93 @set -e ; for p in patches/*.dif ; do \
94 rm -rf $(DIR).orig; \
95 cp -rp $(DIR) $(DIR).orig; \
96 ( cd $(DIR) ; patch -sNt -p1 -r - ) < $$p > /dev/null; \
97 find $(DIR) -name \*.orig -exec rm {} \;; \
98 [ $$(diff -wr $(DIR).orig/. $(DIR)/. | wc -l) = 0 ] && echo "-> patch $$p did not change anything (already applied or broken)" || echo -n ""; \
99 done
100 @rm -rf $(DIR).orig
101 @echo "all patches tested"