summaryrefslogtreecommitdiff
path: root/net-analyzer/icinga2
diff options
context:
space:
mode:
Diffstat (limited to 'net-analyzer/icinga2')
-rw-r--r--net-analyzer/icinga2/Manifest2
-rw-r--r--net-analyzer/icinga2/files/icinga2-2.13.6-boost-1.81.patch93
-rw-r--r--net-analyzer/icinga2/icinga2-2.13.6-r1.ebuild149
3 files changed, 244 insertions, 0 deletions
diff --git a/net-analyzer/icinga2/Manifest b/net-analyzer/icinga2/Manifest
index 59e40a86098f..32b414ef7208 100644
--- a/net-analyzer/icinga2/Manifest
+++ b/net-analyzer/icinga2/Manifest
@@ -1,6 +1,8 @@
+AUX icinga2-2.13.6-boost-1.81.patch 3325 BLAKE2B 8eda4f4ff774baafcdbb12d6e0ee978f3d12bfd659a5662ef0613512b299530fe4ea8afc50114f24e8698797443430da5d6b2774da08004b7f0d4889463bcaaa SHA512 00f0332a7cbdf205f6f01d5fcebb182ce0b0d68d5038a6646c6b76fbfe5416daa59f7bad9e8bf312f5ccb5c39ae4fce6888dc35718acca8b84cddee0d6d28f11
AUX icinga2.initd 2276 BLAKE2B 9573c876cb1fc6ff641d4503d5446840725d94ac2a824cd124872af84032519a5ee1237b0ebc38783e673cb87169feb48b7690978e9b7d2e38549a7272f403fc SHA512 5b31f748eda8f52d8efe2c744c3c1adacffdb40c04d93cdaf7ee82129d632783362f6ea51b5a4c05ca9cd98d3343abfcfc86c98e99afd429d6bce390b9ffd082
AUX icinga2.initd-3 2390 BLAKE2B 1ead1dd958d978324dfa043abcc58be7ed389207e2bf4dc4786bd2705f94c70a03b84f34a55435f6d9dfcc0483e35da60c1f536dec1060bdc232108c622e0615 SHA512 a43911717fe891e70690647daa57426f70d10f9cb02c721962be4c13cfe8a95bc3ff84b9ba2a293adafc8ddacf8ea6771bd66e7ff6dabe3e732176bf6e6e474a
DIST icinga2-2.13.6.tar.gz 9666870 BLAKE2B 50fd463ddb5d5d01ae96cb8457f2c4044c126c308f3d142bb6eb5ac95cf1f5704cd911236acd71ed7b77a596c07e65a96bbebce028bd666126324447d4f91aad SHA512 5fcf480c305487c7988d6cacfcb64c768c0f0e749704247c3d0ded746284ff5485e0a3d25c82fba1305414d47067a9eb80f84de594267ddf050a0b913825cd71
+EBUILD icinga2-2.13.6-r1.ebuild 4033 BLAKE2B a4e8f10d6dbe72a2d7432e56a6dc0caffdbc9ab5831b52df963bc9369b630010938e1f2f669c73714c40dd63f0e44300c58f5d7044b486c70447eab651c524cb SHA512 62c3e63c711ea16d0081f1b0be4610b6f1d19d613d18cf733ffb751894e75f272d8c22354f30792c391d38626cd72a52ef81c2adbed785717dff5eeda1ab85ef
EBUILD icinga2-2.13.6.ebuild 3983 BLAKE2B 0d4ac0f6455d2ff0193463bfa8472c5dbd8a7115b46efd7721e79b382a29cf0919cc87b85696b39299458fea6cd1739b23b855babc2ea63ec8a00b5a6d46cd03 SHA512 809bf739c2779af8102d3ef01fb34526997284f5446622a90a58de4116d60868688771c4f73eb2ef6ac8e8bce60569298d3c05ef45549760a63f699f8448032c
EBUILD icinga2-9999.ebuild 3985 BLAKE2B 5f573b61590cdd31f5c3d18b0f58bc3f5639de5b2fa47462fe75b45f9b5d9c6efdf59816477accf950cbbe427f950dfb81a8e1f2990be8728e04a2012dc67595 SHA512 b53e41c683b2492e42f7ed0fc5f92ff1ead0e24e6fd4966b314f8d94af63468b7c71345017407e8f95c0f3ed340e58f4e6050c845f2c44f83abd07de0c05d058
MISC metadata.xml 871 BLAKE2B ffd6aeebf603ed90bfa4cc34d557e947e435d204c84e062532cedecd3e811710d9bd39f9f43dd70afd575104be5661b5f7e7de3f79365a961d45f61835a602c6 SHA512 3ca0916252061c1705d194066a30a8fc19cfe4341911646b7ed797e131e02f40eeddc91c2449a5b049888be749d16a5103e70678e5d6c1604db0ac3fe9f4e0d7
diff --git a/net-analyzer/icinga2/files/icinga2-2.13.6-boost-1.81.patch b/net-analyzer/icinga2/files/icinga2-2.13.6-boost-1.81.patch
new file mode 100644
index 000000000000..426dc5a1daa5
--- /dev/null
+++ b/net-analyzer/icinga2/files/icinga2-2.13.6-boost-1.81.patch
@@ -0,0 +1,93 @@
+https://bugs.gentoo.org/888063
+https://github.com/Icinga/icinga2/issues/9618
+https://github.com/Icinga/icinga2/pull/9624
+
+From 5bcbc96e221bb3aafc370449941bfbd70939915c Mon Sep 17 00:00:00 2001
+From: "Alexander A. Klimov" <alexander.klimov@icinga.com>
+Date: Wed, 4 Jan 2023 17:02:19 +0100
+Subject: [PATCH 1/2] Handle boost::beast::http::basic_fields#set() signature
+ change (v1.81)
+
+Make String convertible to boost::beast::string_view (always working),
+not boost::string_view (broken).
+--- a/lib/base/string.cpp
++++ b/lib/base/string.cpp
+@@ -128,15 +128,15 @@ String::operator const std::string&() const
+ }
+
+ /**
+- * Conversion function to boost::string_view.
++ * Conversion function to boost::beast::string_view.
+ *
+ * This allows using String as the value for HTTP headers in boost::beast::http::basic_fields::set.
+ *
+- * @return A boost::string_view representing this string.
++ * @return A boost::beast::string_view representing this string.
+ */
+-String::operator boost::string_view() const
++String::operator boost::beast::string_view() const
+ {
+- return boost::string_view(m_Data);
++ return boost::beast::string_view(m_Data);
+ }
+
+ const char *String::CStr() const
+--- a/lib/base/string.hpp
++++ b/lib/base/string.hpp
+@@ -5,6 +5,7 @@
+
+ #include "base/i2-base.hpp"
+ #include "base/object.hpp"
++#include <boost/beast/core.hpp>
+ #include <boost/range/iterator.hpp>
+ #include <boost/utility/string_view.hpp>
+ #include <functional>
+@@ -73,7 +74,7 @@ class String
+ bool operator<(const String& rhs) const;
+
+ operator const std::string&() const;
+- operator boost::string_view() const;
++ operator boost::beast::string_view() const;
+
+ const char *CStr() const;
+
+
+From 99c2d69dc85dfcd044e4a83d4894aa52eedfe09d Mon Sep 17 00:00:00 2001
+From: "Alexander A. Klimov" <alexander.klimov@icinga.com>
+Date: Wed, 4 Jan 2023 17:34:49 +0100
+Subject: [PATCH 2/2] Handle boost::beast::http::basic_fields#operator[]()
+ signature change (v1.81)
+
+Use always working std::string(x), not broken x.to_string().
+(x is a return value.)
+--- a/lib/remote/httphandler.cpp
++++ b/lib/remote/httphandler.cpp
+@@ -58,7 +58,7 @@ void HttpHandler::ProcessRequest(
+ Dictionary::Ptr node = m_UrlTree;
+ std::vector<HttpHandler::Ptr> handlers;
+
+- Url::Ptr url = new Url(request.target().to_string());
++ Url::Ptr url = new Url(std::string(request.target()));
+ auto& path (url->GetPath());
+
+ for (std::vector<String>::size_type i = 0; i <= path.size(); i++) {
+--- a/lib/remote/httpserverconnection.cpp
++++ b/lib/remote/httpserverconnection.cpp
+@@ -246,7 +246,7 @@ bool HandleAccessControl(
+ if (!allowedOrigins.empty()) {
+ auto& origin (request[http::field::origin]);
+
+- if (allowedOrigins.find(origin.to_string()) != allowedOrigins.end()) {
++ if (allowedOrigins.find(std::string(origin)) != allowedOrigins.end()) {
+ response.set(http::field::access_control_allow_origin, origin);
+ }
+
+@@ -536,7 +536,7 @@ void HttpServerConnection::ProcessMessages(boost::asio::yield_context yc)
+ if (!authenticatedUser) {
+ CpuBoundWork fetchingAuthenticatedUser (yc);
+
+- authenticatedUser = ApiUser::GetByAuthHeader(request[http::field::authorization].to_string());
++ authenticatedUser = ApiUser::GetByAuthHeader(std::string(request[http::field::authorization]));
+ }
+
+ Log logMsg (LogInformation, "HttpServerConnection");
diff --git a/net-analyzer/icinga2/icinga2-2.13.6-r1.ebuild b/net-analyzer/icinga2/icinga2-2.13.6-r1.ebuild
new file mode 100644
index 000000000000..6eb6102ef4c9
--- /dev/null
+++ b/net-analyzer/icinga2/icinga2-2.13.6-r1.ebuild
@@ -0,0 +1,149 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake systemd
+
+if [[ ${PV} != 9999 ]]; then
+ SRC_URI="https://github.com/Icinga/icinga2/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="amd64 ~arm64 x86"
+else
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/Icinga/icinga2.git"
+fi
+
+DESCRIPTION="Distributed, general purpose, network monitoring engine"
+HOMEPAGE="https://icinga.com/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="console jumbo-build lto mail mariadb minimal +mysql nano-syntax +plugins postgres systemd +vim-syntax"
+
+# Add accounts to DEPEND because of fowners in src_install
+DEPEND="
+ dev-libs/openssl:0=
+ dev-libs/boost:=[context]
+ console? ( dev-libs/libedit )
+ mariadb? ( dev-db/mariadb-connector-c:= )
+ mysql? ( dev-db/mysql-connector-c:= )
+ postgres? ( dev-db/postgresql:= )
+ dev-libs/yajl:=
+ acct-user/icinga
+ acct-group/icinga
+ acct-group/icingacmd"
+BDEPEND="
+ sys-devel/bison
+ >=sys-devel/flex-2.5.35"
+RDEPEND="
+ ${DEPEND}
+ plugins? ( || (
+ net-analyzer/monitoring-plugins
+ net-analyzer/nagios-plugins
+ ) )
+ mail? ( virtual/mailx )
+ acct-group/nagios"
+
+REQUIRED_USE="!minimal? ( || ( mariadb mysql postgres ) )"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-boost-1.81.patch
+)
+
+src_configure() {
+ local mycmakeargs=(
+ -DICINGA2_UNITY_BUILD=$(usex jumbo-build)
+ -DCMAKE_INSTALL_SYSCONFDIR=/etc
+ -DCMAKE_INSTALL_LOCALSTATEDIR=/var
+ -DICINGA2_SYSCONFIGFILE=/etc/conf.d/icinga2
+ -DICINGA2_PLUGINDIR="/usr/$(get_libdir)/nagios/plugins"
+ -DICINGA2_USER=icinga
+ -DICINGA2_GROUP=icingacmd
+ -DICINGA2_COMMAND_GROUP=icingacmd
+ -DICINGA2_RUNDIR=/run
+ -DINSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT=ON
+ -DUSE_SYSTEMD=$(usex systemd)
+ -DLOGROTATE_HAS_SU=ON
+ -DICINGA2_LTO_BUILD=$(usex lto)
+ )
+ # default to off if minimal, allow the flags to be set otherwise
+ if use minimal; then
+ mycmakeargs+=(
+ -DICINGA2_WITH_MYSQL=OFF
+ -DICINGA2_WITH_PGSQL=OFF
+ )
+ else
+ mycmakeargs+=(
+ -DICINGA2_WITH_PGSQL=$(usex postgres)
+ -DICINGA2_WITH_MYSQL=$(usex mysql yes $(usex mariadb))
+ )
+ fi
+
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+
+ newinitd "${FILESDIR}"/icinga2.initd-3 icinga2
+
+ if use mysql || use mariadb; then
+ docinto schema
+ newdoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_mysql/schema/mysql.sql mysql.sql
+ docinto schema/upgrade
+ dodoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_mysql/schema/upgrade/*
+ fi
+ if use postgres; then
+ docinto schema
+ newdoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_pgsql/schema/pgsql.sql pgsql.sql
+ docinto schema/upgrade
+ dodoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_pgsql/schema/upgrade/*
+ fi
+
+ keepdir /etc/icinga2
+ keepdir /var/lib/icinga2/api/zones
+ keepdir /var/lib/icinga2/api/repository
+ keepdir /var/lib/icinga2/api/log
+ keepdir /var/spool/icinga2/perfdata
+
+ rm -r "${D}/run" || die "failed to remove /run"
+ rm -r "${D}/var/cache" || die "failed to remove /var/cache"
+
+ fowners -R icinga:icinga /etc/icinga2
+ fperms 0750 /etc/icinga2
+ fowners icinga:icinga /var/lib/icinga2
+ fowners -R icinga:icingacmd /var/lib/icinga2/api
+ fowners -R icinga:icingacmd /var/lib/icinga2/certificate-requests
+ fowners -R icinga:icingacmd /var/lib/icinga2/certs
+ fowners icinga:icinga /var/spool/icinga2
+ fowners icinga:icinga /var/spool/icinga2/perfdata
+ fowners icinga:icingacmd /var/log/icinga2
+
+ fperms ug+rwX,o-rwx /etc/icinga2
+ fperms ug+rwX,o-rwx /var/lib/icinga2
+ fperms ug+rwX,o-rwx /var/spool/icinga2
+ fperms ug+rwX,o-rwx /var/log/icinga2
+
+ if use vim-syntax; then
+ insinto /usr/share/vim/vimfiles
+ doins -r "${WORKDIR}"/${P}/tools/syntax/vim/ftdetect
+ doins -r "${WORKDIR}"/${P}/tools/syntax/vim/syntax
+ fi
+
+ if use nano-syntax; then
+ insinto /usr/share/nano
+ doins "${WORKDIR}"/${P}/tools/syntax/nano/icinga2.nanorc
+ fi
+}
+
+pkg_postinst() {
+ if [[ "${PV}" != 9999 ]]; then
+ local v
+ for v in ${REPLACING_VERSIONS}; do
+ if ver_test "${PV}" -gt "${v}"; then
+ elog "DB IDO schema upgrade may be required."
+ elog "https://www.icinga.com/docs/icinga2/latest/doc/16-upgrading-icinga-2/"
+ fi
+ done
+ fi
+}