summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-analyzer/icinga2')
-rw-r--r--net-analyzer/icinga2/Manifest1
-rw-r--r--net-analyzer/icinga2/icinga2-2.11.4.ebuild169
2 files changed, 170 insertions, 0 deletions
diff --git a/net-analyzer/icinga2/Manifest b/net-analyzer/icinga2/Manifest
index 4e30586e35ca..7032eeb37974 100644
--- a/net-analyzer/icinga2/Manifest
+++ b/net-analyzer/icinga2/Manifest
@@ -1 +1,2 @@
DIST icinga2-2.11.3.tar.gz 7475785 BLAKE2B baabe8c90170a7b2ddb3ae7e95ef3cd042e64f68dbfdb50f5a981bc63ae5aa1e8ec4082729456d1b3fc02c0c74a98e15383cc56e56c53a2ab6181db94125365c SHA512 616e938fabaa6565fb9ac4824649c09801dd53b3517c0a9b5b62307293bc838377c18818cc13dd40e240902f02455c421d433b6ee54671403598c5b7aeb78ea1
+DIST icinga2-2.11.4.tar.gz 7476667 BLAKE2B 99b004f12504dae57ae2eda37983ae17da359c6e6998d41bb408c11328d0e69b7dd87ee5bf888c64862d52fe198145e56b1ac24f53d06dfebd1241d16e61a016 SHA512 51b0170d334d4ebe2c9614e47f65a1ab59483b4d5de862ae3d90152bf547bfc0051d9fca2f6b86d301ec897980fdc0b503232eb6dd82ae603d8e809bd56b23c1
diff --git a/net-analyzer/icinga2/icinga2-2.11.4.ebuild b/net-analyzer/icinga2/icinga2-2.11.4.ebuild
new file mode 100644
index 000000000000..42ebd83d611d
--- /dev/null
+++ b/net-analyzer/icinga2/icinga2-2.11.4.ebuild
@@ -0,0 +1,169 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+if [[ ${PV} != 9999 ]]; then
+ inherit cmake-utils depend.apache eutils systemd toolchain-funcs wxwidgets
+ SRC_URI="https://github.com/Icinga/icinga2/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm64 ~x86"
+else
+ inherit cmake-utils depend.apache eutils git-r3 systemd toolchain-funcs wxwidgets
+ EGIT_REPO_URI="https://github.com/Icinga/icinga2.git"
+ EGIT_BRANCH="master"
+fi
+
+DESCRIPTION="Distributed, general purpose, network monitoring engine"
+HOMEPAGE="http://icinga.org/icinga2"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="console libressl lto mail mariadb minimal +mysql nano-syntax +plugins postgres systemd +vim-syntax"
+WX_GTK_VER="3.0"
+
+CDEPEND="
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:0= )
+ >=dev-libs/boost-1.66.0:=[context]
+ console? ( dev-libs/libedit )
+ mariadb? ( dev-db/mariadb-connector-c:= )
+ mysql? ( dev-db/mysql-connector-c:= )
+ postgres? ( dev-db/postgresql:= )
+ dev-libs/yajl"
+
+DEPEND="
+ ${CDEPEND}
+ sys-devel/bison
+ >=sys-devel/flex-2.5.35"
+
+RDEPEND="
+ ${CDEPEND}
+ plugins? ( || (
+ net-analyzer/monitoring-plugins
+ net-analyzer/nagios-plugins
+ ) )
+ mail? ( virtual/mailx )
+ acct-user/icinga
+ acct-group/icinga
+ acct-group/icingacmd
+ acct-group/nagios"
+
+REQUIRED_USE="!minimal? ( || ( mariadb mysql postgres ) )"
+
+want_apache2
+
+pkg_setup() {
+ depend.apache_pkg_setup
+}
+
+src_configure() {
+ sed -i 's/FLAGS\}\ \-g/FLAGS\}\ \-lpthread\ /g' CMakeLists.txt || die
+ local mycmakeargs=(
+ -DICINGA2_UNITY_BUILD=FALSE
+ -DCMAKE_VERBOSE_MAKEFILE=ON
+ -DCMAKE_BUILD_TYPE=None
+ -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
+ -DINSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT=yes
+ -DUSE_SYSTEMD=$(usex systemd ON OFF)
+ -DLOGROTATE_HAS_SU=ON
+ )
+ # 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 ON OFF)
+ -DICINGA2_WITH_MYSQL=$(usex mysql ON OFF)
+ )
+ fi
+ # LTO
+ if use lto; then
+ mycmakeargs+=(
+ -DICINGA2_LTO_BUILD=ON
+ )
+ else
+ mycmakeargs+=(
+ -DICINGA2_LTO_BUILD=OFF
+ )
+ fi
+
+ cmake-utils_src_configure
+}
+
+src_install() {
+ BUILDDIR="${WORKDIR}"/icinga2-${PV}_build
+ cd "${BUILDDIR}" || die
+
+ emake DESTDIR="${D}" install
+
+ einstalldocs
+
+ newinitd "${FILESDIR}"/icinga2.initd-3 icinga2
+
+ if use mysql ; 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 mariadb ; then # same as mysql
+ 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}/var/run" || die "failed to remove /var/run"
+ rm -r "${D}/var/cache" || die "failed to remove /var/cache"
+
+ fowners root:icinga /etc/icinga2
+ fperms 0750 /etc/icinga2
+ fowners icinga:icinga /var/lib/icinga2
+ fowners icinga:icinga /var/spool/icinga2
+ fowners -R icinga:icingacmd /var/lib/icinga2/api
+ 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 && -n ${REPLACING_VERSIONS} && ${REPLACING_VERSIONS} != ${PV} ]]; then
+ elog "DB IDO schema upgrade may be required required.
+ https://www.icinga.com/docs/icinga2/latest/doc/16-upgrading-icinga-2/"
+ fi
+}