3
# Sample debian/rules that uses debhelper.
4
# This file was originally written by Joey Hess and Craig Small.
5
# As a special exception, when this file is copied by dh-make into a
6
# dh-make output file, you may use that output file without restriction.
7
# This special exception was added by Craig Small in version 0.37 of dh-make.
9
# Uncomment this to turn on verbose mode.
16
configure: configure-stamp
19
# Add here commands to configure the package.
21
tar -xzf agents.tar.gz -C agents
23
tar -xzf doc.tar.gz -C docs
25
tar -xzf conf.tar.gz -C config
32
build-stamp: patch-stamp configure-stamp
35
# Add here commands to compile the package.
37
#docbook-to-man debian/check-mk.sgml > check-mk.1
41
clean: clean-patched unpatch
45
rm -f build-stamp configure-stamp
47
# Add here commands to clean up after the build process.
48
rm -rf agents docs config livestatus.src livestatus.log
58
DESTDIR=debian/tmp ./setup.sh --yes
59
#don't use the statically linked binary.
60
rm debian/tmp/usr/share/check_mk/agents/waitmax
61
gcc -s -o debian/tmp/usr/share/check_mk/agents/waitmax debian/tmp/usr/share/check_mk/agents/waitmax.c
62
cp -a livestatus.src/debian/tmp/* debian/tmp/
63
# We need 2 different "defaults" files for Icinga and Nagios3
64
rm debian/tmp/usr/share/check_mk/modules/defaults
65
rm debian/tmp/usr/share/check_mk/web/htdocs/defaults.py
66
mkdir -p debian/check-mk-config-icinga/usr/share/check_mk/modules/
67
cp debian/defaults.icinga debian/check-mk-config-icinga/usr/share/check_mk/modules/defaults
68
mkdir -p debian/check-mk-config-nagios3/usr/share/check_mk/modules/
69
cp debian/defaults.nagios3 debian/check-mk-config-nagios3/usr/share/check_mk/modules/defaults
70
# We need 2 different Apache configs
71
mkdir -p debian/check-mk-config-icinga/etc/apache2/conf.d/
72
cp debian/apache.icinga debian/check-mk-config-icinga/etc/apache2/conf.d/check-mk-multisite.conf
73
mkdir -p debian/check-mk-config-nagios3/etc/apache2/conf.d/
74
cp debian/apache.nagios3 debian/check-mk-config-nagios3/etc/apache2/conf.d/check-mk-multisite.conf
76
# sed -i 's#/nagios/cgi-bin/#/cgi-bin/icinga/#' debian/tmp/check-mk-config-icinga/etc/icinga/objects/check_mk_templates.cfg
77
# sed -i 's#/nagios/cgi-bin/#/cgi-bin/nagios3/#' debian/tmp/check-mk-config-nagios3/etc/nagios3/conf.d/check_mk_templates.cfg
79
cp debian/tmp/usr/share/check_mk/agents/check_mk_agent.linux debian/check-mk-agent/usr/bin/check_mk_agent
80
chmod +x debian/check-mk-agent/usr/bin/check_mk_agent
81
cp debian/tmp/usr/share/check_mk/agents/xinetd.conf debian/check-mk-agent/etc/xinetd.d/check_mk
82
# xinetd: Disable service
83
sed -i 's#disable\s*=\s*no#disable = yes#' debian/check-mk-agent/etc/xinetd.d/check_mk
87
# Build architecture-independent files here.
88
binary-indep: build install
92
# We have nothing to do by default.
94
# Build architecture-dependent files here.
95
binary-arch: build install
98
dh_installchangelogs ChangeLog
102
chmod +x debian/check-mk-server/usr/share/check_mk/checks/*
103
sed -i -e 's/nagiosadmin/icingaadmin/g' debian/check-mk-config-icinga/etc/check_mk/multisite.mk
106
# dh_installlogrotate
130
dpatch --with-cpp apply-all
131
dpatch --with-cpp cat-all >patch-stamp
135
dpatch --with-cpp deapply-all
136
rm -rf patch-stamp debian/patched
138
binary: binary-indep binary-arch
139
.PHONY: build clean binary-indep binary-arch binary install configure