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 ; \
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
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
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
; \
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
); \
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
92 @
tar xzf
$(DIR
).
tar.gz
93 @set
-e
; for p in patches
/*.dif
; do \
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
""; \
101 @echo
"all patches tested"