check-mk/debian/rules

163 lines
5.0 KiB
Plaintext
Raw Normal View History

2017-01-27 08:20:02 +01:00
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
configure: configure-stamp
configure-stamp:
dh_testdir
# Add here commands to configure the package.
mkdir agents
tar -xzf agents.tar.gz -C agents
mkdir docs
tar -xzf doc.tar.gz -C docs
mkdir config
tar -xzf conf.tar.gz -C config
touch configure-stamp
build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
2017-05-24 11:48:38 +02:00
build-stamp: configure-stamp
2017-01-27 08:20:02 +01:00
dh_testdir
# Add here commands to compile the package.
#cd agents ; $(MAKE)
#docbook-to-man debian/check-mk.sgml > check-mk.1
touch $@
2017-05-24 11:45:34 +02:00
clean: clean-patched
2017-01-27 08:20:02 +01:00
clean-patched:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process.
rm -rf agents docs config livestatus.src livestatus.log
dh_clean
install: build
dh_testdir
dh_testroot
dh_prep
dh_installdirs
dh_installdebconf
mkdir -p debian/tmp
DESTDIR=debian/tmp ./setup.sh --yes
## clean up binaries shipped by upstream
# upstream agent deb and rpm
rm -rf debian/tmp/usr/share/check_mk/agent/check-mk-agent*.deb
rm -rf debian/tmp/usr/share/check_mk/agent/check-mk-agent*.rpm
# java jar and classes (we don't rebuild these, help if you want them)
rm -rf debian/tmp/usr/share/doc/check_mk/jasperreports
# Windows binaries (we don't rebuild these, help if you want them)
rm -rf debian/tmp/usr/share/check_mk/agents/windows
rm -rf debian/tmp/usr/share/doc/check_mk/treasures/windows_msi
# fsc-celsius 'treasure' tarball that includes binaries
rm -rf debian/tmp/usr/share/doc/check_mk/treasures/fsc-celsius*
# agent_modbus
rm debian/tmp/usr/share/doc/check_mk/treasures/modbus/agent_modbus
# remove waitmax binary, check_mk will use timeout if available
rm debian/tmp/usr/share/check_mk/agents/waitmax
rm debian/tmp/usr/share/check_mk/agents/z_os/waitmax
cp -a livestatus.src/debian/tmp/* debian/tmp/
## config files
# We need 2 different "defaults" files for Icinga and Nagios3
rm debian/tmp/usr/share/check_mk/modules/defaults
rm debian/tmp/usr/share/check_mk/web/htdocs/defaults.py
mkdir -p debian/check-mk-config-icinga/usr/share/check_mk/modules/
cp debian/defaults.icinga debian/check-mk-config-icinga/usr/share/check_mk/modules/defaults
# We need 2 different Apache configs
mkdir -p debian/check-mk-config-icinga/etc/apache2/conf-available/
cp debian/apache.icinga debian/check-mk-config-icinga/etc/apache2/conf-available/check-mk-multisite.conf
# Adjust path names
# sed -i 's#/nagios/cgi-bin/#/cgi-bin/icinga/#' debian/tmp/check-mk-config-icinga/etc/icinga/objects/check_mk_templates.cfg
# Prepare agent files
cp debian/tmp/usr/share/check_mk/agents/check_mk_agent.linux debian/check-mk-agent/usr/bin/check_mk_agent
chmod +x debian/check-mk-agent/usr/bin/check_mk_agent
# mkp wrapper script
mkdir -p debian/check-mk-server/usr/bin
cp debian/tmp/usr/bin/mkp debian/check-mk-server/usr/bin/
chmod +x debian/check-mk-server/usr/bin/mkp
# xinetd: provide config, but disabled by default
cp debian/tmp/usr/share/check_mk/agents/cfg_examples/xinetd.conf debian/check-mk-agent/etc/xinetd.d/check_mk
2017-05-24 15:19:58 +02:00
#sed -i 's#disable\s*=\s*no#disable = yes#' debian/check-mk-agent/etc/xinetd.d/check_mk
2017-01-27 08:20:02 +01:00
# move checks manpages (to be installed in -server)
mv debian/tmp/usr/share/doc/check_mk/checks debian/tmp/usr/share/check_mk/checks-man
# remove installed ChangeLog to avoid duplicate
rm debian/tmp/usr/share/doc/check_mk/ChangeLog
# remove installed COPYING, redundant
rm debian/tmp/usr/share/doc/check_mk/COPYING
# Build architecture-independent files here.
binary-indep: build install
dh_testdir -i
dh_install -i
dh_installdocs -i debian/README.Debian
dh_installchangelogs -i ChangeLog
dh_installexamples -i
dh_install -i
dh_installman -i
dh_link -i
dh_strip -i
dh_compress -i
dh_fixperms -i
dh_installdeb -i
dh_shlibdeps -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir -a
dh_testroot -a
dh_installchangelogs -a ChangeLog
dh_installdocs -a debian/README.Debian
dh_installexamples -a
dh_install -a
chmod +x debian/check-mk-server/usr/share/check_mk/checks/*
sed -i -e 's/nagiosadmin/icingaadmin/g' debian/check-mk-config-icinga/etc/check_mk/multisite.mk
# dh_installmenu
# dh_installdebconf
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_python
# dh_installinit
# dh_installcron
# dh_installinfo
dh_installman -a
dh_link -a
dh_strip -a
dh_compress -a
dh_fixperms -a
# dh_perl
# dh_makeshlibs
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure