summaryrefslogtreecommitdiff
path: root/net-analyzer
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2025-04-11 08:43:59 +0100
committerV3n3RiX <venerix@koprulu.sector>2025-04-11 08:43:59 +0100
commitbb59556b3302a941db4630613c604644d5f7a617 (patch)
tree42e60b7ae227b0fe3af52dfac08d59653066a2db /net-analyzer
parent3cd09a18bad26aad2645241b868755cfdf41b6ae (diff)
gentoo auto-resync : 11:04:2025 - 08:43:58next
Diffstat (limited to 'net-analyzer')
-rw-r--r--net-analyzer/Manifest.gzbin43392 -> 43399 bytes
-rw-r--r--net-analyzer/icinga2/Manifest5
-rw-r--r--net-analyzer/icinga2/files/icinga2-2.14.5-boost-1.87.patch380
-rw-r--r--net-analyzer/icinga2/icinga2-2.14.5.ebuild154
-rw-r--r--net-analyzer/icinga2/icinga2-9999.ebuild31
5 files changed, 562 insertions, 8 deletions
diff --git a/net-analyzer/Manifest.gz b/net-analyzer/Manifest.gz
index 0c57ce1dfc31..326729247127 100644
--- a/net-analyzer/Manifest.gz
+++ b/net-analyzer/Manifest.gz
Binary files differ
diff --git a/net-analyzer/icinga2/Manifest b/net-analyzer/icinga2/Manifest
index 90a95d3c935d..493edebb7f7f 100644
--- a/net-analyzer/icinga2/Manifest
+++ b/net-analyzer/icinga2/Manifest
@@ -1,5 +1,8 @@
+AUX icinga2-2.14.5-boost-1.87.patch 13445 BLAKE2B 5ee0962363779c6604230737b6a7717cbaf04e5f29dac38e234acc490304a749b3db0a20e718705d168a0c4d6a53d4d0e5ef80fd805f71e1920ea623bd6a5184 SHA512 8a2ad3642d76de6c3309b3fd95141abddae625bb80b233348da8f8fdbfb8bc156d449db06c6f58689897b8301eb4c7340a43a4ec25117f535661016162d5e57e
AUX icinga2.initd-3 2390 BLAKE2B 1ead1dd958d978324dfa043abcc58be7ed389207e2bf4dc4786bd2705f94c70a03b84f34a55435f6d9dfcc0483e35da60c1f536dec1060bdc232108c622e0615 SHA512 a43911717fe891e70690647daa57426f70d10f9cb02c721962be4c13cfe8a95bc3ff84b9ba2a293adafc8ddacf8ea6771bd66e7ff6dabe3e732176bf6e6e474a
DIST icinga2-2.14.3.tar.gz 9397891 BLAKE2B 8808154d585a422d674c6384691f029fa2fe84615dc388648d948410c63c6ea30c96ba900b96f9af954654f0a65575d1875b472985733d8153bc6fc5e5ee00d5 SHA512 7285b32d353d0e68e9925a937feb922f4404557a7a72a03eb16991db207e5f8988cdbd7ca6f3871494be9e5027c70f8062c29fba88b8f0424c2548ca1b2805d6
+DIST icinga2-2.14.5.tar.gz 9413390 BLAKE2B 7e7e9c806d7d41f9e7627d3670709f3ec5594e1703548dc84b61140e60fc2d0a9c5801d6e25b7f4da228c8e1ca3d82a0364a29dd06c6b4e192a7d07adeb150f6 SHA512 841076e4207aa4c57d46ebff54e17b082490720b3aa194374448f2e1d06e9edb6823e59791bef769f38a14f463f216391666ecb21ccd5b6ca6f96f5b67030d2d
EBUILD icinga2-2.14.3.ebuild 3932 BLAKE2B 56c9a1775087985f0b65037864d981a8e983d4bec36d36b44cc9b876537263ff8172632885fa5fe73e0312d8eca9e9a5d3545423675fd06216d70bc25b20ad32 SHA512 dab9a37131c7811c471314101bc37a922baa28e3139a8102ebce9f7a057b94c1c72ec438a7e441d6893cee32028580a2875eacca4d26d31978742d86b0862567
-EBUILD icinga2-9999.ebuild 3838 BLAKE2B 96ca72a710f61218d4ac5b4a74623ab0464c2c60b5f3015b2e17a9475498726efda56c4cb07cdc541c18e5a8aee5810bd018f2fcf1621606fe4bdbf27c91f3ff SHA512 d5c00eaad4410af02d67266d9c1bedca6e09799296648d34e2524964fe72c1314d29f34fdbaf6313f86d2699642cf145b9627af7700870db92e53f3bfb8adb39
+EBUILD icinga2-2.14.5.ebuild 4217 BLAKE2B f6278e09a828ba2ca10ea6174ab55a5e143889a52f43aa7f6dd5a57bc1f018a06c8774d280dae135668ad63109cb7f70ee6d011669c7b10ceb6ebb58d8ab4bed SHA512 86164d093bba64d3900be0808c8671a61c8946e112ca0db32380d7b5856eac4e661bf99bb7ab51aec137d89d5e1baec55304ce243c3ed00b1840a5b467ac9d8a
+EBUILD icinga2-9999.ebuild 4217 BLAKE2B f6278e09a828ba2ca10ea6174ab55a5e143889a52f43aa7f6dd5a57bc1f018a06c8774d280dae135668ad63109cb7f70ee6d011669c7b10ceb6ebb58d8ab4bed SHA512 86164d093bba64d3900be0808c8671a61c8946e112ca0db32380d7b5856eac4e661bf99bb7ab51aec137d89d5e1baec55304ce243c3ed00b1840a5b467ac9d8a
MISC metadata.xml 805 BLAKE2B ac15e1296a3dd24de6f1483bfaa5ef2880a07270c35ee79d7092231dbde3565f87442e31eb69014b5bc99a328bcb29e35820aa427bbbfb75973a326b67fa0d33 SHA512 7fa390ed1571200a963cdea61e420c11da0e5a6697438e275afc32987e7c11b8e4c0a84ba9891935f46b24dfa73ed8606522fc0d39a297d937c24a3e20933c60
diff --git a/net-analyzer/icinga2/files/icinga2-2.14.5-boost-1.87.patch b/net-analyzer/icinga2/files/icinga2-2.14.5-boost-1.87.patch
new file mode 100644
index 000000000000..1c208f983a84
--- /dev/null
+++ b/net-analyzer/icinga2/files/icinga2-2.14.5-boost-1.87.patch
@@ -0,0 +1,380 @@
+https://bugs.gentoo.org/946671
+https://github.com/Icinga/icinga2/pull/10278
+
+From 69e4f295a6bd5cdafb295379b207ab611c8501a6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Alexander=20Aleksandrovi=C4=8D=20Klimov?=
+ <al2klimov@gmail.com>
+Date: Tue, 7 Jan 2025 15:53:20 +0100
+Subject: [PATCH 2/5] Don't use boost::asio::ip::tcp::resolver::query
+
+It was removed in Boost 1.87.
+---
+ lib/base/tcpsocket.hpp | 6 ++----
+ lib/remote/apilistener.cpp | 4 +---
+ 2 files changed, 3 insertions(+), 7 deletions(-)
+
+diff --git a/lib/base/tcpsocket.hpp b/lib/base/tcpsocket.hpp
+index 471ad8d2394..1cf1a235010 100644
+--- a/lib/base/tcpsocket.hpp
++++ b/lib/base/tcpsocket.hpp
+@@ -41,8 +41,7 @@ void Connect(Socket& socket, const String& node, const String& service)
+ using boost::asio::ip::tcp;
+
+ tcp::resolver resolver (IoEngine::Get().GetIoContext());
+- tcp::resolver::query query (node, service);
+- auto result (resolver.resolve(query));
++ auto result (resolver.resolve(node.CStr(), service.CStr()));
+ auto current (result.begin());
+
+ for (;;) {
+@@ -72,8 +71,7 @@ void Connect(Socket& socket, const String& node, const String& service, boost::a
+ using boost::asio::ip::tcp;
+
+ tcp::resolver resolver (IoEngine::Get().GetIoContext());
+- tcp::resolver::query query (node, service);
+- auto result (resolver.async_resolve(query, yc));
++ auto result (resolver.async_resolve(node.CStr(), service.CStr(), yc));
+ auto current (result.begin());
+
+ for (;;) {
+diff --git a/lib/remote/apilistener.cpp b/lib/remote/apilistener.cpp
+index 519469aafa4..7ef3acddda7 100644
+--- a/lib/remote/apilistener.cpp
++++ b/lib/remote/apilistener.cpp
+@@ -439,9 +439,7 @@ bool ApiListener::AddListener(const String& node, const String& service)
+
+ try {
+ tcp::resolver resolver (io);
+- tcp::resolver::query query (node, service, tcp::resolver::query::passive);
+-
+- auto result (resolver.resolve(query));
++ auto result (resolver.resolve(node.CStr(), service.CStr(), tcp::resolver::passive));
+ auto current (result.begin());
+
+ for (;;) {
+
+From 6e1bafad83a1d5cbd646a947575b29f00c23d130 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Alexander=20Aleksandrovi=C4=8D=20Klimov?=
+ <alexander.klimov@icinga.com>
+Date: Tue, 7 Jan 2025 17:53:42 +0100
+Subject: [PATCH 3/5] Don't use boost::asio::io_context::strand method removed
+ in Boost 1.87
+
+---
+ lib/remote/jsonrpcconnection.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/remote/jsonrpcconnection.cpp b/lib/remote/jsonrpcconnection.cpp
+index d49c0b359a0..8e95325feb3 100644
+--- a/lib/remote/jsonrpcconnection.cpp
++++ b/lib/remote/jsonrpcconnection.cpp
+@@ -212,7 +212,7 @@ void JsonRpcConnection::SendMessage(const Dictionary::Ptr& message)
+
+ Ptr keepAlive (this);
+
+- m_IoStrand.post([this, keepAlive, message]() { SendMessageInternal(message); });
++ boost::asio::post(m_IoStrand, [this, keepAlive, message] { SendMessageInternal(message); });
+ }
+
+ void JsonRpcConnection::SendRawMessage(const String& message)
+@@ -223,7 +223,7 @@ void JsonRpcConnection::SendRawMessage(const String& message)
+
+ Ptr keepAlive (this);
+
+- m_IoStrand.post([this, keepAlive, message]() {
++ boost::asio::post(m_IoStrand, [this, keepAlive, message] {
+ if (m_ShuttingDown) {
+ return;
+ }
+
+From 5e058f46289f603338d02ad61524886d6cc3e26a Mon Sep 17 00:00:00 2001
+From: "Alexander A. Klimov" <alexander.klimov@icinga.com>
+Date: Fri, 7 Mar 2025 16:22:50 +0100
+Subject: [PATCH 4/5] In a coroutine, re-throw everything ex. std::exception
+ (and inheritors)
+
+not just boost::coroutines::detail::forced_unwind.
+
+This is needed because as of Boost 1.87, boost::asio::spawn() uses Fiber, not Coroutine v1.
+https://github.com/boostorg/asio/commit/df973a85ed69f021
+
+This is safe because every actual exception shall inherit from std::exception. Except forced_unwind and its Fiber equivalent, so that `catch(const std::exception&)` doesn't catch them and only them.
+---
+ lib/base/io-engine.hpp | 13 ++++++----
+ lib/icingadb/redisconnection.cpp | 41 ++++----------------------------
+ lib/icingadb/redisconnection.hpp | 8 ++-----
+ 3 files changed, 14 insertions(+), 48 deletions(-)
+
+diff --git a/lib/base/io-engine.hpp b/lib/base/io-engine.hpp
+index 0350d45b83d..55a06fb6a67 100644
+--- a/lib/base/io-engine.hpp
++++ b/lib/base/io-engine.hpp
+@@ -106,14 +106,17 @@ class IoEngine
+
+ try {
+ f(yc);
+- } catch (const boost::coroutines::detail::forced_unwind &) {
+- // Required for proper stack unwinding when coroutines are destroyed.
+- // https://github.com/boostorg/coroutine/issues/39
+- throw;
+ } catch (const std::exception& ex) {
+ Log(LogCritical, "IoEngine") << "Exception in coroutine: " << DiagnosticInformation(ex);
+ } catch (...) {
+- Log(LogCritical, "IoEngine", "Exception in coroutine!");
++ try {
++ Log(LogCritical, "IoEngine", "Exception in coroutine!");
++ } catch (...) {
++ }
++
++ // Required for proper stack unwinding when coroutines are destroyed.
++ // https://github.com/boostorg/coroutine/issues/39
++ throw;
+ }
+ },
+ boost::coroutines::attributes(GetCoroutineStackSize()) // Set a pre-defined stack size.
+diff --git a/lib/icingadb/redisconnection.cpp b/lib/icingadb/redisconnection.cpp
+index a6b82187dd0..c1f73f5a0e6 100644
+--- a/lib/icingadb/redisconnection.cpp
++++ b/lib/icingadb/redisconnection.cpp
+@@ -377,8 +377,6 @@ void RedisConnection::Connect(asio::yield_context& yc)
+ }
+
+ break;
+- } catch (const boost::coroutines::detail::forced_unwind&) {
+- throw;
+ } catch (const std::exception& ex) {
+ Log(LogCritical, "IcingaDB")
+ << "Cannot connect to " << m_Host << ":" << m_Port << ": " << ex.what();
+@@ -408,17 +406,10 @@ void RedisConnection::ReadLoop(asio::yield_context& yc)
+ for (auto i (item.Amount); i; --i) {
+ ReadOne(yc);
+ }
+- } catch (const boost::coroutines::detail::forced_unwind&) {
+- throw;
+ } catch (const std::exception& ex) {
+ Log(LogCritical, "IcingaDB")
+ << "Error during receiving the response to a query which has been fired and forgotten: " << ex.what();
+
+- continue;
+- } catch (...) {
+- Log(LogCritical, "IcingaDB")
+- << "Error during receiving the response to a query which has been fired and forgotten";
+-
+ continue;
+ }
+
+@@ -432,9 +423,7 @@ void RedisConnection::ReadLoop(asio::yield_context& yc)
+
+ try {
+ reply = ReadOne(yc);
+- } catch (const boost::coroutines::detail::forced_unwind&) {
+- throw;
+- } catch (...) {
++ } catch (const std::exception&) {
+ promise.set_exception(std::current_exception());
+
+ continue;
+@@ -455,9 +444,7 @@ void RedisConnection::ReadLoop(asio::yield_context& yc)
+ for (auto i (item.Amount); i; --i) {
+ try {
+ replies.emplace_back(ReadOne(yc));
+- } catch (const boost::coroutines::detail::forced_unwind&) {
+- throw;
+- } catch (...) {
++ } catch (const std::exception&) {
+ promise.set_exception(std::current_exception());
+ break;
+ }
+@@ -551,19 +538,11 @@ void RedisConnection::WriteItem(boost::asio::yield_context& yc, RedisConnection:
+
+ try {
+ WriteOne(item, yc);
+- } catch (const boost::coroutines::detail::forced_unwind&) {
+- throw;
+ } catch (const std::exception& ex) {
+ Log msg (LogCritical, "IcingaDB", "Error during sending query");
+ LogQuery(item, msg);
+ msg << " which has been fired and forgotten: " << ex.what();
+
+- return;
+- } catch (...) {
+- Log msg (LogCritical, "IcingaDB", "Error during sending query");
+- LogQuery(item, msg);
+- msg << " which has been fired and forgotten";
+-
+ return;
+ }
+
+@@ -587,19 +566,11 @@ void RedisConnection::WriteItem(boost::asio::yield_context& yc, RedisConnection:
+ WriteOne(query, yc);
+ ++i;
+ }
+- } catch (const boost::coroutines::detail::forced_unwind&) {
+- throw;
+ } catch (const std::exception& ex) {
+ Log msg (LogCritical, "IcingaDB", "Error during sending query");
+ LogQuery(item[i], msg);
+ msg << " which has been fired and forgotten: " << ex.what();
+
+- return;
+- } catch (...) {
+- Log msg (LogCritical, "IcingaDB", "Error during sending query");
+- LogQuery(item[i], msg);
+- msg << " which has been fired and forgotten";
+-
+ return;
+ }
+
+@@ -618,9 +589,7 @@ void RedisConnection::WriteItem(boost::asio::yield_context& yc, RedisConnection:
+
+ try {
+ WriteOne(item.first, yc);
+- } catch (const boost::coroutines::detail::forced_unwind&) {
+- throw;
+- } catch (...) {
++ } catch (const std::exception&) {
+ item.second.set_exception(std::current_exception());
+
+ return;
+@@ -645,9 +614,7 @@ void RedisConnection::WriteItem(boost::asio::yield_context& yc, RedisConnection:
+ for (auto& query : item.first) {
+ WriteOne(query, yc);
+ }
+- } catch (const boost::coroutines::detail::forced_unwind&) {
+- throw;
+- } catch (...) {
++ } catch (const std::exception&) {
+ item.second.set_exception(std::current_exception());
+
+ return;
+diff --git a/lib/icingadb/redisconnection.hpp b/lib/icingadb/redisconnection.hpp
+index 3f963f3d37d..acc6e43810c 100644
+--- a/lib/icingadb/redisconnection.hpp
++++ b/lib/icingadb/redisconnection.hpp
+@@ -389,9 +389,7 @@ RedisConnection::Reply RedisConnection::ReadOne(StreamPtr& stream, boost::asio::
+
+ try {
+ return ReadRESP(*strm, yc);
+- } catch (const boost::coroutines::detail::forced_unwind&) {
+- throw;
+- } catch (...) {
++ } catch (const std::exception&) {
+ if (m_Connecting.exchange(false)) {
+ m_Connected.store(false);
+ stream = nullptr;
+@@ -427,9 +425,7 @@ void RedisConnection::WriteOne(StreamPtr& stream, RedisConnection::Query& query,
+ try {
+ WriteRESP(*strm, query, yc);
+ strm->async_flush(yc);
+- } catch (const boost::coroutines::detail::forced_unwind&) {
+- throw;
+- } catch (...) {
++ } catch (const std::exception&) {
+ if (m_Connecting.exchange(false)) {
+ m_Connected.store(false);
+ stream = nullptr;
+
+From 62221b2d60078dda09463a0d5ed96f1fdbacdaf0 Mon Sep 17 00:00:00 2001
+From: "Alexander A. Klimov" <alexander.klimov@icinga.com>
+Date: Fri, 7 Mar 2025 15:47:37 +0100
+Subject: [PATCH 5/5] Don't use removed boost::asio::spawn() overload if Boost
+ >= v1.87
+
+---
+ lib/base/io-engine.hpp | 13 +++++++++++++
+ test/base-io-engine.cpp | 10 +++++-----
+ 2 files changed, 18 insertions(+), 5 deletions(-)
+
+diff --git a/lib/base/io-engine.hpp b/lib/base/io-engine.hpp
+index 55a06fb6a67..2083b62f87d 100644
+--- a/lib/base/io-engine.hpp
++++ b/lib/base/io-engine.hpp
+@@ -16,11 +16,16 @@
+ #include <utility>
+ #include <vector>
+ #include <stdexcept>
++#include <boost/context/fixedsize_stack.hpp>
+ #include <boost/exception/all.hpp>
+ #include <boost/asio/deadline_timer.hpp>
+ #include <boost/asio/io_context.hpp>
+ #include <boost/asio/spawn.hpp>
+
++#if BOOST_VERSION >= 108700
++# include <boost/asio/detached.hpp>
++#endif // BOOST_VERSION >= 108700
++
+ namespace icinga
+ {
+
+@@ -102,6 +107,10 @@ class IoEngine
+ static void SpawnCoroutine(Handler& h, Function f) {
+
+ boost::asio::spawn(h,
++#if BOOST_VERSION >= 108700
++ std::allocator_arg,
++ boost::context::fixedsize_stack(GetCoroutineStackSize()),
++#endif // BOOST_VERSION >= 108700
+ [f](boost::asio::yield_context yc) {
+
+ try {
+@@ -119,7 +128,11 @@ class IoEngine
+ throw;
+ }
+ },
++#if BOOST_VERSION >= 108700
++ boost::asio::detached
++#else // BOOST_VERSION >= 108700
+ boost::coroutines::attributes(GetCoroutineStackSize()) // Set a pre-defined stack size.
++#endif // BOOST_VERSION >= 108700
+ );
+ }
+
+diff --git a/test/base-io-engine.cpp b/test/base-io-engine.cpp
+index 869688b1a67..3a251b1b421 100644
+--- a/test/base-io-engine.cpp
++++ b/test/base-io-engine.cpp
+@@ -17,7 +17,7 @@ BOOST_AUTO_TEST_CASE(timeout_run)
+ boost::asio::io_context::strand strand (io);
+ int called = 0;
+
+- boost::asio::spawn(strand, [&](boost::asio::yield_context yc) {
++ IoEngine::SpawnCoroutine(strand, [&](boost::asio::yield_context yc) {
+ boost::asio::deadline_timer timer (io);
+
+ Timeout timeout (strand, boost::posix_time::millisec(300), [&called] { ++called; });
+@@ -44,7 +44,7 @@ BOOST_AUTO_TEST_CASE(timeout_cancelled)
+ boost::asio::io_context::strand strand (io);
+ int called = 0;
+
+- boost::asio::spawn(strand, [&](boost::asio::yield_context yc) {
++ IoEngine::SpawnCoroutine(strand, [&](boost::asio::yield_context yc) {
+ boost::asio::deadline_timer timer (io);
+ Timeout timeout (strand, boost::posix_time::millisec(300), [&called] { ++called; });
+
+@@ -71,7 +71,7 @@ BOOST_AUTO_TEST_CASE(timeout_scope)
+ boost::asio::io_context::strand strand (io);
+ int called = 0;
+
+- boost::asio::spawn(strand, [&](boost::asio::yield_context yc) {
++ IoEngine::SpawnCoroutine(strand, [&](boost::asio::yield_context yc) {
+ boost::asio::deadline_timer timer (io);
+
+ {
+@@ -100,7 +100,7 @@ BOOST_AUTO_TEST_CASE(timeout_due_cancelled)
+ boost::asio::io_context::strand strand (io);
+ int called = 0;
+
+- boost::asio::spawn(strand, [&](boost::asio::yield_context yc) {
++ IoEngine::SpawnCoroutine(strand, [&](boost::asio::yield_context yc) {
+ boost::asio::deadline_timer timer (io);
+ Timeout timeout (strand, boost::posix_time::millisec(300), [&called] { ++called; });
+
+@@ -131,7 +131,7 @@ BOOST_AUTO_TEST_CASE(timeout_due_scope)
+ boost::asio::io_context::strand strand (io);
+ int called = 0;
+
+- boost::asio::spawn(strand, [&](boost::asio::yield_context yc) {
++ IoEngine::SpawnCoroutine(strand, [&](boost::asio::yield_context yc) {
+ boost::asio::deadline_timer timer (io);
+
+ {
diff --git a/net-analyzer/icinga2/icinga2-2.14.5.ebuild b/net-analyzer/icinga2/icinga2-2.14.5.ebuild
new file mode 100644
index 000000000000..0715e3ed4825
--- /dev/null
+++ b/net-analyzer/icinga2/icinga2-2.14.5.ebuild
@@ -0,0 +1,154 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake eapi9-ver
+
+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 mail mariadb minimal +mysql +plugins postgres systemd"
+
+# Add accounts to DEPEND because of fowners in src_install
+DEPEND="
+ dev-libs/openssl:=
+ 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="
+ app-alternatives/yacc
+ app-alternatives/lex
+"
+RDEPEND="
+ ${DEPEND}
+ acct-group/nagios
+ plugins? ( || (
+ net-analyzer/monitoring-plugins
+ net-analyzer/nagios-plugins
+ ) )
+ mail? ( virtual/mailx )
+"
+
+REQUIRED_USE="!minimal? ( || ( mariadb mysql postgres ) )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.14.5-boost-1.87.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
+ # only appends -flto
+ -DICINGA2_LTO_BUILD=OFF
+ )
+
+ # 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
+
+ # See messiness in bug #638686
+ keepdir /etc/icinga2
+ keepdir /var/lib/icinga2/api/log
+ keepdir /var/lib/icinga2/api/repository
+ keepdir /var/lib/icinga2/api/zones
+ keepdir /var/lib/icinga2/api/zones-stage
+ keepdir /var/lib/icinga2/certificate-requests
+ keepdir /var/lib/icinga2/certs
+ keepdir /var/log/icinga2
+ keepdir /var/log/icinga2/compat
+ keepdir /var/log/icinga2/compat/archives
+ keepdir /var/log/icinga2/crash
+ keepdir /var/spool/icinga2/perfdata
+ keepdir /var/spool/icinga2/tmp
+
+ 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
+
+ insinto /usr/share/vim/vimfiles
+ doins -r "${WORKDIR}"/${P}/tools/syntax/vim/ftdetect
+ doins -r "${WORKDIR}"/${P}/tools/syntax/vim/syntax
+
+ insinto /usr/share/nano
+ doins "${WORKDIR}"/${P}/tools/syntax/nano/icinga2.nanorc
+}
+
+pkg_postinst() {
+ if [[ "${PV}" != 9999 ]] && ver_replacing -lt "${PV}"; then
+ elog "DB IDO schema upgrade may be required."
+ elog "https://www.icinga.com/docs/icinga2/latest/doc/16-upgrading-icinga-2/"
+ fi
+}
diff --git a/net-analyzer/icinga2/icinga2-9999.ebuild b/net-analyzer/icinga2/icinga2-9999.ebuild
index e001d26c92ba..0715e3ed4825 100644
--- a/net-analyzer/icinga2/icinga2-9999.ebuild
+++ b/net-analyzer/icinga2/icinga2-9999.ebuild
@@ -1,7 +1,7 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
inherit cmake eapi9-ver
@@ -22,7 +22,7 @@ IUSE="console jumbo-build mail mariadb minimal +mysql +plugins postgres systemd"
# Add accounts to DEPEND because of fowners in src_install
DEPEND="
- dev-libs/openssl:0=
+ dev-libs/openssl:=
dev-libs/boost:=[context]
console? ( dev-libs/libedit )
mariadb? ( dev-db/mariadb-connector-c:= )
@@ -31,21 +31,28 @@ DEPEND="
dev-libs/yajl:=
acct-user/icinga
acct-group/icinga
- acct-group/icingacmd"
+ acct-group/icingacmd
+"
BDEPEND="
app-alternatives/yacc
- app-alternatives/lex"
+ app-alternatives/lex
+"
RDEPEND="
${DEPEND}
+ acct-group/nagios
plugins? ( || (
net-analyzer/monitoring-plugins
net-analyzer/nagios-plugins
) )
mail? ( virtual/mailx )
- acct-group/nagios"
+"
REQUIRED_USE="!minimal? ( || ( mariadb mysql postgres ) )"
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.14.5-boost-1.87.patch
+)
+
src_configure() {
local mycmakeargs=(
-DICINGA2_UNITY_BUILD=$(usex jumbo-build)
@@ -63,6 +70,7 @@ src_configure() {
# only appends -flto
-DICINGA2_LTO_BUILD=OFF
)
+
# default to off if minimal, allow the flags to be set otherwise
if use minimal; then
mycmakeargs+=(
@@ -97,11 +105,20 @@ src_install() {
dodoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_pgsql/schema/upgrade/*
fi
+ # See messiness in bug #638686
keepdir /etc/icinga2
- keepdir /var/lib/icinga2/api/zones
- keepdir /var/lib/icinga2/api/repository
keepdir /var/lib/icinga2/api/log
+ keepdir /var/lib/icinga2/api/repository
+ keepdir /var/lib/icinga2/api/zones
+ keepdir /var/lib/icinga2/api/zones-stage
+ keepdir /var/lib/icinga2/certificate-requests
+ keepdir /var/lib/icinga2/certs
+ keepdir /var/log/icinga2
+ keepdir /var/log/icinga2/compat
+ keepdir /var/log/icinga2/compat/archives
+ keepdir /var/log/icinga2/crash
keepdir /var/spool/icinga2/perfdata
+ keepdir /var/spool/icinga2/tmp
rm -r "${D}/run" || die "failed to remove /run"
rm -r "${D}/var/cache" || die "failed to remove /var/cache"