summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD81
1 files changed, 57 insertions, 24 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 5a500bcaa9c..218cb3aba0e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,36 +1,47 @@
-# Maintainer: Tom Moore <t.moore01@gmail.com>
+# Maintainer: Georg Pichler <georg.pichler@gmail.com>
_rtfm=n # you want documentation? (y / n)
_other_agents=n # you want agents for other operating systems? (y / n)
+_agent=n # agent is in seperate package check_mk-agent
pkgname=check_mk
-pkgver=1.2.6p16
+pkgver=1.2.8p13
pkgrel=1
pkgdesc="A comprehensive IT monitoring solution in the tradition of Nagios"
license=('GPL2')
arch=('any')
url="http://mathias-kettner.com/check_mk.html"
-depends=('python2' 'nagios' 'nagios-plugins' 'xinetd' 'mod_python' 'apache')
+depends=( 'python2'
+ 'nagios>=4.0.0'
+ 'nagios-plugins'
+ 'xinetd'
+ 'mod_python2'
+ 'apache'
+ 'monitoring-plugins'
+ )
+optdepends=('pnp4nagios: Graphing performance data')
source=(
- "https://mathias-kettner.de/support/${pkgver}/${pkgname}-${pkgver}.cre.tar.gz"
- #'files_shebang.txt'
- #'check_mk_templates.cfg.patch'
- #'index.py.patch'
- #'mkp.patch'
- #'check_mk.patch'
-)
-sha256sums=(
- '102461b4ebba1ffa5620f9f2d21328a78183a537cf7bcb91e3e6c6db63bbadf7'
-# '4eb6e74e1e0bda172e6e11de5087ed29409f2cc38292e32de131c6c3fd687411'
-# 'f0bb81a195347ab0d46c8b34921021200f67f490fbe4be538e5d0c99b21e1400'
-# '7488ab4d5d5e0686f477a14456585015a9d2c9cdb3cdeea383507b70db8a060a'
-# 'f68f4593e15010004b3abf1c8fd92638efd34c92e0a93e7810b3a972ce0bfee7'
-# 'e577f3549b5f3a39e974aa9ab979c67722f8ef0a8bbb434cf6b1b5ca165fe473'
+ "https://mathias-kettner.de/download/${pkgname}-${pkgver}.tar.gz"
+ 'check_mk_templates.cfg.patch'
+ 'mkp.patch'
+ 'check_mk.patch'
+ 'setup.sh.patch'
)
+md5sums=('df04190dea014f586f2723a6fb6b5419'
+ 'e10a352fff0563bddeb788c7f9aee759'
+ '5e8cb4a9ca2b7e17c1c902be43808653'
+ 'dff7c1d42947b4b54e2953dd31def78a'
+ '7c426024053ec772d21ce042776f9497')
+
install="${pkgname}.install"
+backup=( 'etc/nagios/htpasswd.users' )
package() {
cd "${srcdir}/${pkgname}-${pkgver}"
+
+ # patch setup file
+ patch "./setup.sh" "${srcdir}/setup.sh.patch"
+
DESTDIR="${pkgdir}" \
wwwuser='http' \
nagios_binary='/usr/bin/nagios' \
@@ -38,28 +49,45 @@ package() {
nagpipe='/var/nagios/rw/nagios.cmd' \
check_result_path='/var/nagios/spool/checkresults' \
nagios_status_file='/var/nagios/status.dat' \
- check_icmp_path='/usr/share/nagios/libexec/check_icmp' \
+ check_icmp_path='/usr/lib/monitoring-plugins/check_icmp' \
apache_config_dir='/etc/httpd/conf/extra' \
livesock='/var/nagios/rw/live' \
+ nagios_version='4.2.2' \
./setup.sh
+
# Fix python shebangs:
cd "${pkgdir}"
- for f in `cat "${srcdir}/files_shebang.txt"`; do
- echo "#!/usr/bin/python2" > "${f}.new"
- cat "${f}" | tail -n +2 >> "${f}.new"
- cat "${f}.new" > "${f}"
- rm -f "${f}.new"
+ for f in `grep -rl '#!/usr/bin/python' .`; do
+ sed -i 's_#!/usr/bin/python_#!/usr/bin/env python2_g' "${f}"
done
# Fix other python2 stuff:
patch "./usr/share/check_mk/check_mk_templates.cfg" "${srcdir}/check_mk_templates.cfg.patch"
- patch "./usr/share/check_mk/web/htdocs/index.py" "${srcdir}/index.py.patch"
patch "./usr/bin/mkp" "${srcdir}/mkp.patch"
patch "./usr/bin/check_mk" "${srcdir}/check_mk.patch"
+
# Add symlinks for the agent:
mkdir -p "./usr/bin" "./etc/xinetd.d"
ln -s "/usr/share/check_mk/agents/check_mk_agent.linux" "./usr/bin/check_mk_agent"
ln -s "/usr/share/check_mk/agents/xinetd.conf" "./etc/xinetd.d/check_mk"
ln -s "/usr/share/check_mk/agents/waitmax" "./usr/bin/waitmax"
+
+ # Use proper webapps directory for apache config
+ mkdir -p "./etc/webapps/check_mk"
+ mv "./etc/httpd/conf/extra/zzz_check_mk.conf" "./etc/webapps/check_mk/apache.example.conf"
+
+ # Fixing directory permissions
+ chmod 0775 "./etc/nagios"
+ chmod 0775 "./etc/nagios/objects"
+ chmod 0750 "./etc/sudoers.d"
+
+ # Change directory owners
+ chown -R nagios:nagios "var/lib/check_mk"
+ chmod -R 0775 "var/lib/check_mk"
+ chown nagios:nagios "etc/check_mk/conf.d"
+ chmod 0775 "etc/check_mk/conf.d"
+ chown nagios:nagios "etc/check_mk/multisite.d"
+ chmod 0775 "etc/check_mk/multisite.d"
+
# Remove docs if the user wants it:
[[ "${_rtfm}" = "n" ]] && rm -rf "./usr/share/doc"
# Remove agents if the user wants it:
@@ -67,4 +95,9 @@ package() {
rm -rf "./usr/share/check_mk/agents/windows/"
rm -f "./usr/share/check_mk/agents/check_mk_agent."{freebsd,macosx,openvms,netbsd,aix,hpux,solaris,openbsd}
fi
+ # Remove agent if the user wants it:
+ if [[ "${_agent}" = "n" ]]; then
+ rm -rf "./etc/xinetd.d/"
+ rm -f "./usr/bin/check_mk_agent"
+ fi
}