Skip to content
Permalink
Browse files

10311 Support for Red Hat 8 / CentOS 8

Change-Id: Ida2b90535bf2c245dbc77317229cd068c562b3b9
  • Loading branch information...
AZurhake committed Oct 8, 2019
1 parent fc00cc5 commit 8c708860af4102d67af1de2430c0696024fc4ac2
@@ -0,0 +1,11 @@
Title: Support for Red Hat 8 / CentOS 8
Class: feature
Compatible: compat
Component: distros
Date: 1570537226
Edition: cre
Knowledge: undoc
Level: 2
Version: 1.7.0i1


@@ -0,0 +1,74 @@
FROM centos:centos8

SHELL ["/bin/bash", "-c"]

RUN yum -y makecache \
&& yum -y --enablerepo=PowerTools install \
bind-utils \
boost-devel \
curl-devel \
expat-devel \
flex \
flex-devel \
freeradius-devel \
gcc \
gcc-c++ \
gd-devel \
gettext \
httpd-devel \
isl-devel \
kernel-headers \
libXpm-devel \
libdbi-devel \
libevent-devel \
libffi-devel \
libgsf-devel \
libiscsi-devel \
libjpeg-devel \
libmpc-devel \
libpcap-devel \
libstdc++-devel \
libstdc++-static \
libtool-ltdl \
libtool-ltdl-devel \
libuuid-devel \
libxml2-devel \
mariadb-devel \
mpfr-devel \
ncurses-devel \
openssh-clients \
openssl-devel \
pango-devel \
patch \
pcre-devel \
perl \
perl-ExtUtils-Embed \
perl-IO-Zlib \
perl-Locale-Maketext-Simple \
perl-Time-HiRes \
perl-devel \
php \
postgresql-devel \
readline-devel \
rpcbind \
rpm-build \
rrdtool-devel \
rrdtool-devel \
rsync \
samba-client \
sqlite-devel \
texinfo \
tk-devel \
wget \
which \
&& yum clean all
RUN yum -y makecache \
&& yum -y --enablerepo=PowerTools reinstall \
kernel-headers \
&& yum clean all

#COPY bw-build-gnu-toolchain.sh /usr/sbin
#RUN bw-build-gnu-toolchain.sh -b
#RUN mv /usr/bin/gcc /usr/bin/gcc-4 \
# && ln -s /usr/local/bin/gcc-8 /usr/local/bin/gcc \
# && ln -s /usr/local/bin/gcc-8 /usr/local/bin/cc
@@ -0,0 +1,47 @@
FROM centos:centos8

SHELL ["/bin/bash", "-c"]

ARG PACKAGES

RUN yum -y --enablerepo=PowerTools --allowerasing install \
epel-release \
&& yum -y --enablerepo=PowerTools --allowerasing install \
curl \
enchant \
gcc \
gcc-c++ \
git \
krb5-devel \
make \
mariadb \
mysql-devel \
nodejs \
npm \
openldap-devel \
postfix \
python2-devel \
python27 \
rrdtool-devel \
strace \
sudo \
vim \
which \
&& yum clean all

RUN ln -s /usr/bin/python2.7 /usr/bin/python \
&& python -V
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
&& python get-pip.py
RUN pip install --upgrade setuptools virtualenv \
&& pip install git+https://github.com/svenpanne/pipenv.git@41f30d7ac848fdfe3eb548ddd19b731bfa8c331a
RUN yum -y --enablerepo=PowerTools install \
$PACKAGES \
&& yum clean all

# Set Environment Variables to activate python27
ENV PATH=/opt/rh/python27/root/usr/bin${PATH:+:${PATH}}
ENV LD_LIBRARY_PATH=/opt/rh/python27/root/usr/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
ENV MANPATH=/opt/rh/python27/root/usr/share/man:${MANPATH}
ENV XDG_DATA_DIRS=/opt/rh/python27/root/usr/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}
ENV PKG_CONFIG_PATH=/opt/rh/python27/root/usr/lib64/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}
@@ -99,6 +99,9 @@ try {
'centos-7')
DISTRO_CODE='-el7-38.x86_64.rpm'
;;
'centos-8')
DISTRO_CODE='-el8-38.x86_64.rpm'
;;
*)
DISTRO_CODE_TMP=\$(echo $DISTRO | tr -d '-')
DISTRO_CODE="-\${DISTRO_CODE_TMP}-38.x86_64.rpm"
@@ -3,7 +3,7 @@
# This script determines the Linux distribution we are running
# on. It output two words: (1) The distro name and (2) the version
# Example output "UBUNTU 10.04"

set -x
# Ubuntu is detected with /etc/lsb-release
SEP=${1:- }
if [ -e /etc/lsb-release ]
@@ -48,6 +48,9 @@ then
elif [ "${VERSION:0:22}" = "CentOS Linux release 7" ]; then
echo "CENTOS${SEP}7"
exit 0
elif [ "${VERSION:0:22}" = "CentOS Linux release 8" ]; then
echo "CENTOS${SEP}8"
exit 0
fi
echo "CENTOS$SEP${VERSION:15:1}"
exit 0
@@ -0,0 +1,60 @@
DISTRO_CODE = el8
OS_PACKAGES =
OS_PACKAGES += libcap # needed for setting special file permissions
OS_PACKAGES += time # needed for mk-job
OS_PACKAGES += traceroute # needed for Check_MK parent scan
OS_PACKAGES += curl
OS_PACKAGES += dialog
OS_PACKAGES += expat
OS_PACKAGES += graphviz
OS_PACKAGES += graphviz-gd
OS_PACKAGES += httpd
OS_PACKAGES += libevent
OS_PACKAGES += libdbi
OS_PACKAGES += libtool-ltdl
OS_PACKAGES += rpcbind
OS_PACKAGES += pango
OS_PACKAGES += perl-Locale-Maketext-Simple
OS_PACKAGES += perl-IO-Zlib
OS_PACKAGES += perl-Net-Ping
OS_PACKAGES += php
OS_PACKAGES += php-cli
OS_PACKAGES += php-xml
OS_PACKAGES += php-mbstring
OS_PACKAGES += php-pdo
OS_PACKAGES += php-gd
OS_PACKAGES += readline
OS_PACKAGES += rsync
OS_PACKAGES += uuid
OS_PACKAGES += xinetd
OS_PACKAGES += cronie
OS_PACKAGES += freeradius-utils
OS_PACKAGES += libpcap # needed for ICMP of CMC
OS_PACKAGES += glib2 # needed by msitools/Agent Bakery
OS_PACKAGES += bind-utils # needed for check_dns
OS_PACKAGES += poppler-utils # needed for preview of PDF in reporting
OS_PACKAGES += libgsf # needed by msitools/Agent Bakery
OS_PACKAGES += cpio # needed for Agent bakery (solaris pkgs)
OS_PACKAGES += binutils # Needed by Check_MK Agent Bakery
OS_PACKAGES += rpm-build # Needed by Check_MK Agent Bakery
#OS_PACKAGES += pyOpenSSL # needed for Agent Bakery (deployment)
OS_PACKAGES += libffi # needed for pyOpenSSL and dependant
OS_PACKAGES += libpq
USERADD_OPTIONS = -M
ADD_USER_TO_GROUP = gpasswd -a %(user)s %(group)s
PACKAGE_INSTALL = yum -y makecache ; yum -y install
ACTIVATE_INITSCRIPT = chkconfig --add %s && chkconfig %s on
APACHE_CONF_DIR = /etc/httpd/conf.d
APACHE_INIT_NAME = httpd
APACHE_USER = apache
APACHE_GROUP = apache
APACHE_VERSION = 2.4.6
APACHE_CTL = /usr/sbin/apachectl
APACHE_MODULE_DIR = /usr/lib/httpd/modules
APACHE_MODULE_DIR_64 = /usr/lib64/httpd/modules
HTPASSWD_BIN = /usr/bin/htpasswd
PHP_FCGI_BIN = /usr/bin/php-cgi
APACHE_ENMOD = true %s
BECOME_ROOT = su -c
MOUNT_OPTIONS =
INIT_CMD = /usr/bin/systemctl %(action)s %(name)s.service
@@ -18,7 +18,7 @@ Requires:
%global __os_install_post %{nil}
# disable creating debug packages
%global debug_package %{nil}

%global _build_id_links none

%description
Check_MK is a full featured system monitoring
@@ -18,7 +18,9 @@ $(NET_SNMP)-install: $(NET_SNMP_INSTALL)
$(NET_SNMP_BUILD): $(NET_SNMP_PATCHING) $(PYTHON_BUILD) $(PERL_MODULES_BUILD)
# Skip Perl-Modules because of build errors when MIB loading is disabled.
# Skip Python binding because we need to use our own python, see install target.
cd $(NET_SNMP_DIR) && ./configure \
cd $(NET_SNMP_DIR) \
&& if [ "$(DISTRO_CODE)" == "el8" ]; then export CFLAGS='-Wformat -I../../include -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'; fi \
&& ./configure \
--enable-ipv6 \
--disable-agent \
--disable-snmptrapd-subagent \
@@ -0,0 +1,33 @@
From 1c725e333e9d20b87346fb394a1d01fa5be4fbaf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Wed, 12 Oct 2016 10:46:22 +0200
Subject: [PATCH] Do not use SSLv2_client_method() with OpenSSL >= 1.1.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

SSLv2 support was removed from OpenSSL 1.1.0.

CPAN RT#118343

Signed-off-by: Petr Písař <ppisar@redhat.com>
---
SSLeay.xs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/SSLeay.xs b/SSLeay.xs
index 1560604..ba0dd24 100644
--- a/SSLeay.xs
+++ b/SSLeay.xs
@@ -152,7 +152,7 @@ SSL_CTX_new(packname, ssl_version)
ctx = SSL_CTX_new(SSLv3_client_method());
}
else {
-#ifndef OPENSSL_NO_SSL2
+#if !defined OPENSSL_NO_SSL2 && OPENSSL_VERSION_NUMBER < 0x10100000L
/* v2 is the default */
ctx = SSL_CTX_new(SSLv2_client_method());
#else
--
2.7.4

@@ -103,12 +103,26 @@ PERL_MODULES_LIST2 := \
Nagios-Plugin-0.36.tar.gz \
DateTime-1.18.tar.gz

$(PERL_MODULES_BUILD):
$(PACKAGE_DIR)/$(PERL_MODULES)/src/%-patched.tar.gz: $(PACKAGE_DIR)/$(PERL_MODULES)/src/%.tar.gz
tar xf $<
for P in $$($(LS) $(PACKAGE_DIR)/$(PERL_MODULES)/patches/$**.dif); do \
$(ECHO) "applying $$P..." ; \
$(PATCH) -p1 -b -d $* < $$P ; \
done
tar czf $@ $*


$(PERL_MODULES_BUILD): $(PACKAGE_DIR)/$(PERL_MODULES)/src/Crypt-SSLeay-0.72-patched.tar.gz
$(MKDIR) $(PACKAGE_PERL_MODULES_DESTDIR)/dest
$(MKDIR) $(PACKAGE_PERL_MODULES_DESTDIR)/src
echo $(PERL_MODULES)
$(RSYNC) $(PACKAGE_DIR)/$(PERL_MODULES)/src/. $(PACKAGE_PERL_MODULES_DESTDIR)/src/.
$(RSYNC) $(PACKAGE_DIR)/$(PERL_MODULES)/build_module.pl $(PACKAGE_DIR)/$(PERL_MODULES)/lib $(PACKAGE_PERL_MODULES_DESTDIR)/src/.
for F in $$(ls $(PACKAGE_PERL_MODULES_DESTDIR)/src/*-patched.tar.gz); do \
echo $$F; \
echo $${F/-patched/}; \
mv $$F $${F/-patched/}; \
done
echo "install --install_base $(PACKAGE_PERL_MODULES_DESTDIR)/dest" > $(PACKAGE_PERL_MODULES_DESTDIR)/dest/.modulebuildrc
unset LANG; \
unset PERL5LIB; \
@@ -145,4 +159,4 @@ $(PERL_MODULES_SKEL): $(PERL_MODULES_INSTALL)
$(TOUCH) $@

perl-modules-clean:
$(RM) -r src/inc $(PACKAGE_PERL_MODULES_DESTDIR) $(BUILD_HELPER_DIR)
$(RM) -r src/inc $(PACKAGE_PERL_MODULES_DESTDIR) $(BUILD_HELPER_DIR) $(PACKAGE_DIR)/$(PERL_MODULES)/src/*-patched.tar.gz

0 comments on commit 8c70886

Please sign in to comment.
You can’t perform that action at this time.