Merge branch 'master' of mathias-kettner.de:omd
[omd.git] / packages / thruk / Makefile
blob6cfec8239569a316fc783012d32820ade071bab0
1 include ../../Makefile.omd
3 NAME = thruk
4 VERSION = 2.10
5 DIR = $(NAME)-$(VERSION)
6 PERLARCH = $(shell $(PERL) -e 'use Config; print $$Config{archname}')
8 .PHONY: skel
10 build:
11 rm -rf $(DIR)
12 tar xzf $(DIR)*.tar.gz
13 for p in patches/*.patch ; do \
14 echo "applying $$p..." ; \
15 ( cd $(DIR) ; patch -p1 ) < $$p || exit 1; \
16 done
17 find $(DIR) -name \*.orig -exec rm {} \;
20 install:
21 mkdir -p $(DESTDIR)$(OMD_ROOT)/share
22 mkdir -p $(DESTDIR)$(OMD_ROOT)/bin
23 rm -rf $(DESTDIR)$(OMD_ROOT)/share/thruk
24 cp -rp $(DIR)/script/thruk $(DESTDIR)$(OMD_ROOT)/bin/thruk
25 cp -rp $(DIR)/script/naglint $(DESTDIR)$(OMD_ROOT)/bin/naglint
26 cp -rp $(DIR) $(DESTDIR)$(OMD_ROOT)/share/thruk
27 mkdir -p $(DESTDIR)$(OMD_ROOT)/skel/etc/thruk
28 rm -rf $(DESTDIR)$(OMD_ROOT)/share/thruk/plugins-enabled
29 rm -rf $(DESTDIR)$(OMD_ROOT)/share/thruk/themes-enabled
30 rm -rf $(DESTDIR)$(OMD_ROOT)/share/thruk/t
31 mv $(DESTDIR)$(OMD_ROOT)/share/thruk/script/thruk $(DESTDIR)$(OMD_ROOT)/bin/thruk
32 chmod 755 $(DESTDIR)$(OMD_ROOT)/bin/thruk
33 chmod 755 $(DESTDIR)$(OMD_ROOT)/bin/naglint
34 PHANTOM_VERSION='2.1.1'; ARCH='i686'; \
35 if [ `uname -m` = 'x86_64' ]; then \
36 ARCH='x86_64'; \
37 elif [ `uname -m` = 'armv7l' ]; then \
38 ARCH='armv7l'; \
39 PHANTOM_VERSION='1.9.1'; \
40 fi; \
41 if [ $(DISTRO_NAME) = "SLES" ] && [ $(DISTRO_VERSION) = "11SP1" ]; then \
42 PHANTOM_VERSION='1.9.1'; \
43 fi; \
44 cp -p phantomjs-$$PHANTOM_VERSION-$$ARCH $(DESTDIR)$(OMD_ROOT)/bin/phantomjs;
45 mkdir -p $(DESTDIR)$(OMD_ROOT)/lib/omd/scripts/post-update
46 install -m 755 thruk.post-update $(DESTDIR)$(OMD_ROOT)/lib/omd/scripts/post-update/thruk
49 skel:
50 # logfile has to be group writeable for shared apache
51 mkdir -p $(SKEL)/var/log $(SKEL)/var/thruk $(SKEL)/etc/init.d
52 touch $(SKEL)/var/log/thruk.log
53 mkdir -p $(SKEL)/etc/thruk/plugins-enabled
54 # set links for enabled plugins
55 for link in `ls -1 $(DIR)/plugins/plugins-enabled/`; do cd $(SKEL)/etc/thruk/plugins-enabled && ln -sfn ../../../share/thruk/plugins/plugins-available/$$link $$link; done
56 # set links for enabled themes
57 mkdir -p $(SKEL)/etc/thruk/themes-enabled
58 for link in `ls -1 $(DIR)/themes/themes-enabled/`; do cd $(SKEL)/etc/thruk/themes-enabled && ln -sfn ../../../share/thruk/themes/themes-available/$$link $$link; done
59 cp $(DIR)/support/thruk.init $(SKEL)/etc/init.d/thruk
60 mkdir -p $(SKEL)/etc/nagios/conf.d
61 cp $(DIR)/support/thruk_templates.cfg $(SKEL)/etc/nagios/conf.d/
62 cp $(DIR)/support/fcgid_env.sh $(SKEL)/etc/thruk/fcgid_env.sh
63 cp $(DIR)/thruk.conf $(SKEL)/etc/thruk/thruk.conf
64 cp -rp $(DIR)/root/thruk/usercontent $(SKEL)/etc/thruk
65 for p in patches/*.skel_patch ; do \
66 echo "applying $$p..." ; \
67 ( cd $(SKEL) ; patch -p1 -b ) < $$p || exit 1; \
68 done
69 find $(SKEL) -name \*.orig -exec rm {} \;
70 mkdir -p $(SKEL)/etc/thruk/bp/
71 cp $(DIR)/examples/bp_functions.pm $(SKEL)/etc/thruk/bp/
72 cp $(DIR)/ssi/status-header.ssi-pnp $(SKEL)/etc/thruk/ssi/status-header.ssi
73 cp $(DIR)/ssi/status-header.ssi-pnp $(SKEL)/etc/thruk/ssi/extinfo-header.ssi
74 cp $(DIR)/ssi/extinfo-header.ssi-tickets $(SKEL)/etc/thruk/ssi/extinfo-header.ssi-example
75 mkdir -p $(SKEL)/etc/thruk/panorama/
76 touch $(SKEL)/etc/thruk/panorama/.gitignore
78 clean:
79 rm -rf $(DIR)