-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa312e7
commit 2bd89d9
Showing
4 changed files
with
115 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
#!/bin/bash | ||
|
||
VERSION="2.1.0p2" | ||
CHECKMK_VERSION="2.1.0p15" | ||
SNAP7_VERSION="1.4.2" | ||
|
||
if [ $# -gt 0 ]; then | ||
VERSION="$1" | ||
CHECKMK_VERSION="$1" | ||
fi | ||
|
||
echo "building Check_MK ${VERSION}..." | ||
echo "building Check_MK ${CHECKMK_VERSION}..." | ||
|
||
# get check_mk sources and build dependencies | ||
# get check_mk build dependencies | ||
if [ ${INSTALL_DEPENDENCIES:-0} -eq 1 ]; then | ||
apt-get -y install apache2 build-essential chrpath cmake debhelper dnsutils dpatch flex fping freetds-dev git \ | ||
git-buildpackage make rpcbind rrdtool smbclient snmp apache2-dev default-libmysqlclient-dev dietlibc-dev \ | ||
|
@@ -19,11 +19,18 @@ if [ ${INSTALL_DEPENDENCIES:-0} -eq 1 ]; then | |
libsodium-dev libsqlite3-dev libssl-dev libxml2-dev libxmlsec1-dev patchelf python3-pip tk-dev uuid-dev | ||
fi | ||
|
||
wget -qO- https://download.checkmk.com/checkmk/${VERSION}/check-mk-raw-${VERSION}.cre.tar.gz | tar -xvz | ||
cd check-mk-raw-${VERSION}.cre | ||
# get check_mk sources | ||
if [ ! -f check-mk-raw-${CHECKMK_VERSION}.cre.tar.gz ]; then | ||
wget -q https://download.checkmk.com/checkmk/${CHECKMK_VERSION}/check-mk-raw-${CHECKMK_VERSION}.cre.tar.gz | ||
fi | ||
rm -rf check-mk-raw-${CHECKMK_VERSION}.cre | ||
tar xfz check-mk-raw-${CHECKMK_VERSION}.cre.tar.gz | ||
|
||
# configure check_mk | ||
cd check-mk-raw-${CHECKMK_VERSION}.cre | ||
./configure | ||
|
||
# patch files | ||
# apply patches | ||
patch -p0 < ../omd-Makefile-remove-module-navicli.patch | ||
patch -p0 < ../omdlib-reduce-certificate-maximum-validity-period.patch | ||
patch -p0 < ../python-make-add-fno-semantic-interposition.patch | ||
|
@@ -33,7 +40,7 @@ patch -p0 < ../pipfile-remove-pbr.patch | |
patch -p0 < ../pipfile-remove-playwright.patch | ||
|
||
# prepare snap7 | ||
tar -xvzf omd/packages/snap7/snap7-${SNAP7_VERSION}.tar.gz -C omd/packages/snap7 | ||
tar xvzf omd/packages/snap7/snap7-${SNAP7_VERSION}.tar.gz -C omd/packages/snap7 | ||
cp omd/packages/snap7/snap7-${SNAP7_VERSION}/build/unix/arm_v6_linux.mk omd/packages/snap7/snap7-${SNAP7_VERSION}/build/unix/armv6l_linux.mk | ||
ln -s arm_v6-linux omd/packages/snap7/snap7-${SNAP7_VERSION}/build/bin/armv6l-linux | ||
cp omd/packages/snap7/snap7-${SNAP7_VERSION}/build/unix/arm_v7_linux.mk omd/packages/snap7/snap7-${SNAP7_VERSION}/build/unix/armv7l_linux.mk | ||
|
@@ -48,7 +55,7 @@ make deb DEBFULLNAME="Christian Hofer" [email protected] | |
|
||
# cleanup | ||
if [ $? -eq 0 ]; then | ||
mv check-mk-raw-${VERSION}* .. | ||
mv check-mk-raw-${CHECKMK_VERSION}* .. | ||
cd .. | ||
rm -rf check-mk-raw-${VERSION}.cre | ||
rm -rf check-mk-raw-${CHECKMK_VERSION}.cre | ||
fi |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#!/bin/bash | ||
|
||
CHECKMK_VERSION="2.1.0p15" | ||
NAGIOS_VERSION="3.5.1" | ||
NSCA_VERSION="2.9.1" | ||
PNP4NAGIOS_VERSION="0.6.26" | ||
SNAP7_VERSION="1.4.2" | ||
|
||
if [ $# -gt 0 ]; then | ||
CHECKMK_VERSION="$1" | ||
fi | ||
|
||
echo "building Check_MK ${CHECKMK_VERSION}..." | ||
|
||
# get check_mk build dependencies | ||
if [ ${INSTALL_DEPENDENCIES:-0} -eq 1 ]; then | ||
sudo apt-get -y install apache2-dev build-essential cmake devscripts flex freetds-dev libcurl4-openssl-dev \ | ||
libffi-dev libglib2.0-dev libgsf-1-dev libjpeg-dev libkrb5-dev libldap2-dev libncurses5-dev libpango1.0-dev \ | ||
libpcap-dev libperl-dev libpq-dev libreadline-dev librrd-dev libsasl2-dev libsodium-dev libssl-dev libxml2-dev \ | ||
libxmlsec1-dev libxmlsec1-openssl libxslt-dev patchelf pipenv python3.9 python3.9-distutils python3.9-dev \ | ||
rsync zlib1g-dev | ||
fi | ||
|
||
# get check_mk sources | ||
if [ ! -f check-mk-raw-${CHECKMK_VERSION}.cre.tar.gz ]; then | ||
wget -q https://download.checkmk.com/checkmk/${CHECKMK_VERSION}/check-mk-raw-${CHECKMK_VERSION}.cre.tar.gz | ||
fi | ||
rm -rf check-mk-raw-${CHECKMK_VERSION}.cre | ||
tar xfz check-mk-raw-${CHECKMK_VERSION}.cre.tar.gz | ||
|
||
# configure check_mk | ||
cd check-mk-raw-${CHECKMK_VERSION}.cre | ||
./configure | ||
|
||
# apply patches | ||
patch -p0 < ../omd-Makefile-remove-module-navicli.patch | ||
patch -p0 < ../python-make-add-fno-semantic-interposition.patch | ||
patch -p0 < ../python-make-set-aarch64-architecture.patch | ||
patch -p0 < ../protobuf-make-add-latomic.patch | ||
patch -p0 < ../pipfile-remove-pbr.patch | ||
patch -p0 < ../pipfile-remove-playwright.patch | ||
|
||
# prepare nagios | ||
tar xvzf omd/packages/nagios/nagios-${NAGIOS_VERSION}.tar.gz -C /tmp | ||
cp /usr/share/misc/config.guess /tmp/nagios-${NAGIOS_VERSION}/ | ||
tar czf omd/packages/nagios/nagios-${NAGIOS_VERSION}.tar.gz -C /tmp nagios-${NAGIOS_VERSION} | ||
rm -rf /tmp/nagios-${NAGIOS_VERSION} | ||
|
||
# prepare nsca | ||
tar xzf omd/packages/nsca/nsca-${NSCA_VERSION}.tar.gz -C /tmp | ||
cp /usr/share/misc/config.guess /tmp/nsca-${NSCA_VERSION}/ | ||
tar czf omd/packages/nsca/nsca-${NSCA_VERSION}.tar.gz -C /tmp nsca-${NSCA_VERSION} | ||
rm -rf /tmp/nsca-${NSCA_VERSION} | ||
|
||
# prepare pnp4nagios | ||
tar xzf omd/packages/pnp4nagios/pnp4nagios-${PNP4NAGIOS_VERSION}.tar.gz -C /tmp | ||
cp /usr/share/misc/config.guess /tmp/pnp4nagios-${PNP4NAGIOS_VERSION}/ | ||
tar czf omd/packages/pnp4nagios/pnp4nagios-${PNP4NAGIOS_VERSION}.tar.gz -C /tmp pnp4nagios-${PNP4NAGIOS_VERSION} | ||
rm -rf /tmp/pnp4nagios-${PNP4NAGIOS_VERSION} | ||
|
||
# prepare snap7 | ||
tar xvzf omd/packages/snap7/snap7-${SNAP7_VERSION}.tar.gz -C /tmp | ||
cp /tmp/snap7-${SNAP7_VERSION}/build/unix/arm_v6_linux.mk /tmp/snap7-${SNAP7_VERSION}/build/unix/aarch64_linux.mk | ||
sed -i 's/arm_v6/aarch64/' /tmp/snap7-${SNAP7_VERSION}/build/unix/aarch64_linux.mk | ||
tar czf omd/packages/snap7/snap7-${SNAP7_VERSION}.tar.gz -C /tmp snap7-${SNAP7_VERSION} | ||
rm -rf /tmp/snap7-${SNAP7_VERSION} | ||
|
||
# setup pipenv | ||
sudo bash buildscripts/infrastructure/build-nodes/scripts/install-pipenv.sh | ||
|
||
# compile and package | ||
make deb DEBFULLNAME="Martin Petersen" [email protected] | ||
|
||
# cleanup | ||
if [ $? -eq 0 ]; then | ||
mv check-mk-raw-${CHECKMK_VERSION}* .. | ||
cd .. | ||
rm -rf check-mk-raw-${CHECKMK_VERSION}.cre | ||
fi |