Skip to content

Commit

Permalink
we embed mariadb connector and caching_sha2_password.so in centreon p…
Browse files Browse the repository at this point in the history
…ackages
  • Loading branch information
jean-christophe81 committed Jun 24, 2024
1 parent 4c16f99 commit cd68d10
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 16 deletions.
1 change: 0 additions & 1 deletion .github/docker/Dockerfile.centreon-collect-alma9
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ dnf --best install -y cmake \
openssh-server \
mariadb-server \
mariadb \
mariadb-connector-c-devel \
gnutls-devel \
libgcrypt-devel \
lua-devel \
Expand Down
1 change: 0 additions & 1 deletion .github/docker/Dockerfile.centreon-collect-debian-bullseye
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ apt-get -y install cmake \
mariadb-server \
openssh-server \
libmariadb3 \
libmariadb-dev \
librrd-dev \
libgnutls28-dev \
liblua5.3-dev \
Expand Down
1 change: 0 additions & 1 deletion .github/docker/Dockerfile.centreon-collect-mysql-alma9
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ dnf --best install -y cmake \
gdb \
gettext \
git \
mariadb-connector-c-devel \
ninja-build \
openssh-server \
mysql-server \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ dnf --best install -y gcc \
gdb \
git \
openssh-server \
mariadb-connector-c \
mysql-server \
mysql \
gnutls \
Expand Down
1 change: 1 addition & 0 deletions .github/scripts/collect-unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ else
CXXFLAGS="-Wall -Wextra" cmake3 -G "Ninja" -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DWITH_CENTREON_CLIB_INCLUDE_DIR=../clib/inc/ -DWITH_CENTREON_CLIB_LIBRARIES=centreon-clib/libcentreon_clib.so -DCMAKE_BUILD_TYPE=Debug -DWITH_PREFIX=/usr -DWITH_PREFIX_BIN=/usr/sbin -DWITH_USER_BROKER=centreon-broker -DWITH_USER_ENGINE=centreon-engine -DWITH_GROUP_BROKER=centreon-broker -DWITH_GROUP_ENGINE=centreon-engine -DWITH_TESTING=On -DWITH_PREFIX_MODULES=/usr/share/centreon/lib/centreon-broker -DWITH_PREFIX_CONF_BROKER=/etc/centreon-broker -DWITH_PREFIX_LIB_BROKER=/usr/lib64/nagios -DWITH_PREFIX_CONF_ENGINE=/etc/centreon-engine -DWITH_PREFIX_LIB_ENGINE=/usr/lib64/centreon-engine -DWITH_PREFIX_LIB_CLIB=/usr/lib64/ -DWITH_RW_DIR=/var/lib/centreon-engine/rw -DWITH_VAR_DIR=/var/log/centreon-engine -DWITH_MODULE_SIMU=On ..
fi


#Build
ninja -j 8
ninja -j 8 install
Expand Down
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@ set(CMAKE_PROGRAM_PATH ${CONAN_BIN_DIRS_PROTOBUF};${CMAKE_PROGRAM_PATH})

find_package(Protobuf REQUIRED)

include(FindPkgConfig)
pkg_check_modules(MARIADB REQUIRED libmariadb)

message(NOTICE "-- use protoc compiler: ${Protobuf_PROTOC_EXECUTABLE}")

include(GNUInstallDirs)
Expand Down
15 changes: 9 additions & 6 deletions broker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,30 +66,33 @@ endif()
if(OS_DISTRIBUTOR STREQUAL "Debian" OR OS_DISTRIBUTOR STREQUAL "Ubuntu")
message(STATUS "deb based os")
add_definitions("-DMYSQL_SOCKET=\"/var/run/mysqld/mysqld.sock\"")
add_definitions("-DDEFAULT_MARIADB_EXTENSION_DIR=\"/usr/lib/x86_64-linux-gnu/libmariadb3/plugin\"")
add_definitions("-DDEFAULT_MARIADB_EXTENSION_DIR=\"/usr/lib/x86_64-linux-gnu/centreon-broker\"")
elseif(OS_DISTRIBUTOR STREQUAL "CentOS" OR OS_DISTRIBUTOR STREQUAL "RedHat")
message(STATUS "rpm based os")
add_definitions("-DMYSQL_SOCKET=\"/var/lib/mysql/mysql.sock\"")
add_definitions("-DDEFAULT_MARIADB_EXTENSION_DIR=\"/usr/lib64/mariadb/plugin\"")
add_definitions("-DDEFAULT_MARIADB_EXTENSION_DIR=\"/usr/lib64/centreon-broker\"")
else()
message(STATUS "other os: ${OS_DISTRIBUTOR}")
add_definitions("-DMYSQL_SOCKET=\"/tmp/mysql.sock\"")
add_definitions("-DDEFAULT_MARIADB_EXTENSION_DIR=\"/usr/lib/x86_64-linux-gnu/libmariadb3/plugin\"")
add_definitions("-DDEFAULT_MARIADB_EXTENSION_DIR=\"/usr/lib/x86_64-linux-gnu/centreon-broker\"")
endif()

#we have to provide caching_sha2_password.so generated by conan in order to avoid conflicts with other versions of openssl
configure_file(${CONAN_LIB_DIRS_MARIADB-CONNECTOR-C}/plugin/caching_sha2_password.so ${CMAKE_BINARY_DIR}/lib/caching_sha2_password.so COPYONLY)


include_directories(
"${PROJECT_SOURCE_DIR}/core/inc"
"${PROJECT_SOURCE_DIR}/neb/inc"
"${CMAKE_SOURCE_DIR}/engine/inc"
"${PROJECT_SOURCE_DIR}/core/multiplexing/inc"
"${PROJECT_SOURCE_DIR}/core/sql/inc"
"${MARIADB_INCLUDE_DIRS}")
"${PROJECT_SOURCE_DIR}/core/sql/inc")
set(INC_DIR "${PROJECT_SOURCE_DIR}/core/inc/com/centreon/broker")
set(SRC_DIR "${PROJECT_SOURCE_DIR}/core/src")
set(TEST_DIR "${PROJECT_SOURCE_DIR}/core/test")

add_definitions(-DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE)
add_definitions(${spdlog_DEFINITIONS})
add_definitions(${spdlog_DEFINITIONS} ${mariadb-connector-c_DEFINITIONS})

include_directories(${CONAN_INCLUDE_DIRS_MARIADB-CONNECTOR-C})

Expand Down
1 change: 1 addition & 0 deletions conanfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ grpc/1.54.3
gtest/cci.20210126
libcurl/8.0.1
libssh2/1.10.0
mariadb-connector-c/3.3.3
nlohmann_json/3.11.2
openssl/1.1.1t
opentelemetry-cpp/1.14.2
Expand Down
10 changes: 8 additions & 2 deletions packaging/centreon-broker-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ contents:
- src: "../lib/{10-neb,15-stats,20-bam,20-storage,20-unified_sql,50-tcp,50-grpc,60-tls,70-rrd,70-lua,80-sql}.so"
dst: "/usr/share/centreon/lib/centreon-broker/"

- src: "../lib/caching_sha2_password.so"
dst: "/usr/lib64/centreon-broker"
packager: rpm

- src: "../lib/caching_sha2_password.so"
dst: "/usr/lib/x86_64-linux-gnu/centreon-broker"
packager: deb

- src: "../broker/script/centreon-broker.logrotate"
dst: "/etc/logrotate.d/cbd"
type: config|noreplace
Expand All @@ -43,7 +51,6 @@ overrides:
- centreon-clib = ${VERSION}-${RELEASE}${DIST}
- centreon-broker = ${VERSION}-${RELEASE}${DIST}
- gnutls >= 3.3.29
- mariadb-connector-c >= 3.1.10
conflicts:
- centreon-broker-storage
- centreon-broker-core-devel
Expand All @@ -59,7 +66,6 @@ overrides:
- centreon-clib (= ${VERSION}-${RELEASE}${DIST})
- centreon-broker (= ${VERSION}-${RELEASE}${DIST})
- libgnutls30
- libmariadb3
conflicts:
- centreon-broker-storage
- centreon-broker-core-dev
Expand Down
6 changes: 5 additions & 1 deletion tests/broker-engine/big-metrics.robot
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
*** Settings ***
Documentation There tests are about big metric values
Resource ../resources/import.resource
Resource ../resources/resources.robot

Library ../resources/Engine.py
Library ../resources/Broker.py
Library ../resources/Common.py

Suite Setup Ctn Clean Before Suite
Suite Teardown Ctn Clean After Suite
Expand Down

0 comments on commit cd68d10

Please sign in to comment.