1 include ..
/..
/Makefile.omd
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.
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
) \
17 --enable-embedded-perl \
28 cd
$(DIR
) ; .
/configure
$(CONFIGUREOPTS
)
37 set
-e
; for p in patches
/*.dif
; do \
38 echo
"applying $$p..." ; \
39 ( cd
$(DIR
) ; patch
-p1
-b
) < $$p ; \
41 find
$(DIR
)/ -name \
*.orig
-exec
rm {} \
;
46 $(MAKE
) DESTDIR
=$(DESTDIR
) -C
$(DIR
) install-base install-cgis install-html install-classicui
47 rm -f
$(DESTDIR
)$(OMD_ROOT
)/share
/nagios
/htdocs
/config.php.inc
50 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/share
/nagios
/htdocs
/themes
/classicui
51 cp
-a
$(DESTDIR
)$(OMD_ROOT
)/share
/nagios
/htdocs
/stylesheets
$(DESTDIR
)$(OMD_ROOT
)/share
/nagios
/htdocs
/themes
/classicui
/
52 cp
-a
$(DESTDIR
)$(OMD_ROOT
)/share
/nagios
/htdocs
/images
$(DESTDIR
)$(OMD_ROOT
)/share
/nagios
/htdocs
/themes
/classicui
/
53 $(MAKE
) DESTDIR
=$(DESTDIR
) -C
$(DIR
) install-exfoliation
54 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/share
/nagios
/htdocs
/themes
/exfoliation
55 cp
-a
$(DESTDIR
)$(OMD_ROOT
)/share
/nagios
/htdocs
/stylesheets
$(DESTDIR
)$(OMD_ROOT
)/share
/nagios
/htdocs
/themes
/exfoliation
/
56 cp
-a
$(DESTDIR
)$(OMD_ROOT
)/share
/nagios
/htdocs
/images
$(DESTDIR
)$(OMD_ROOT
)/share
/nagios
/htdocs
/themes
/exfoliation
/
57 # remove original files
58 rm -rf
$(DESTDIR
)$(OMD_ROOT
)/share
/nagios
/htdocs
/stylesheets
59 rm -rf
$(DESTDIR
)$(OMD_ROOT
)/share
/nagios
/htdocs
/images
61 cd
$(DESTDIR
)$(OMD_ROOT
)/share
/nagios
/htdocs
; rm -rf styleshets
; ln
-sfn themes
/classicui
/stylesheets
62 cd
$(DESTDIR
)$(OMD_ROOT
)/share
/nagios
/htdocs
; rm -rf images
; ln
-sfn themes
/classicui
/images
64 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/lib
/nagios
65 install -m
664 $(DIR
)/p1.pl
$(DESTDIR
)$(OMD_ROOT
)/lib
/nagios
67 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/share
/nagios
/htdocs
/ssi
68 install -m
755 ssi-wrapper.pl
$(DESTDIR
)$(OMD_ROOT
)/share
/nagios
/htdocs
/ssi
70 for f in common avail cmd config extinfo histogram history notifications outages showlog status statusmap statuswml statuswrl summary tac trends
; do \
71 ln
-sfn ssi-wrapper.pl
$(DESTDIR
)$(OMD_ROOT
)/share
/nagios
/htdocs
/ssi
/$$f-header.ssi
; \
72 ln
-sfn ssi-wrapper.pl
$(DESTDIR
)$(OMD_ROOT
)/share
/nagios
/htdocs
/ssi
/$$f-footer.ssi
; \
75 # Copy package documentations to have these information in the binary packages
76 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/share
/doc
/$(NAME
)
77 for file in README THANKS LEGAL LICENSE
; do \
78 install -m
644 $(DIR
)/$$file $(DESTDIR
)$(OMD_ROOT
)/share
/doc
/$(NAME
); \
81 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/bin
82 install -m
755 merge-nagios-config
$(DESTDIR
)$(OMD_ROOT
)/bin
84 # Install the diskspace cleanup plugin
85 mkdir
-p
$(DESTDIR
)$(OMD_ROOT
)/share
/diskspace
86 install -m
644 diskspace
$(DESTDIR
)$(OMD_ROOT
)/share
/diskspace
/nagios
93 @
tar xzf
$(DIR
).
tar.gz
94 @set
-e
; for p in patches
/*.dif
; do \
96 cp
-rp
$(DIR
) $(DIR
).orig
; \
97 ( cd
$(DIR
) ; patch
-sNt
-p1
-r
- ) < $$p > /dev
/null
; \
98 find
$(DIR
) -name \
*.orig
-exec
rm {} \
;; \
99 [ $$(diff
-wr
$(DIR
).orig
/.
$(DIR
)/. | wc
-l
) = 0 ] && echo
"-> patch $$p did not change anything (already applied or broken)" || echo
-n
""; \
102 @echo
"all patches tested"