From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- net-analyzer/icinga2/Manifest | 11 ++ .../files/fix-missing-include-2.7.1-2.patch | 24 +++ .../icinga2/files/fix-missing-include-2.7.1.patch | 22 +++ net-analyzer/icinga2/files/icinga2.initd | 81 +++++++++ net-analyzer/icinga2/icinga2-2.7.0-r1.ebuild | 177 ++++++++++++++++++++ net-analyzer/icinga2/icinga2-2.7.1-r1.ebuild | 182 +++++++++++++++++++++ net-analyzer/icinga2/icinga2-9999.ebuild | 177 ++++++++++++++++++++ net-analyzer/icinga2/metadata.xml | 20 +++ 8 files changed, 694 insertions(+) create mode 100644 net-analyzer/icinga2/Manifest create mode 100644 net-analyzer/icinga2/files/fix-missing-include-2.7.1-2.patch create mode 100644 net-analyzer/icinga2/files/fix-missing-include-2.7.1.patch create mode 100644 net-analyzer/icinga2/files/icinga2.initd create mode 100644 net-analyzer/icinga2/icinga2-2.7.0-r1.ebuild create mode 100644 net-analyzer/icinga2/icinga2-2.7.1-r1.ebuild create mode 100644 net-analyzer/icinga2/icinga2-9999.ebuild create mode 100644 net-analyzer/icinga2/metadata.xml (limited to 'net-analyzer/icinga2') diff --git a/net-analyzer/icinga2/Manifest b/net-analyzer/icinga2/Manifest new file mode 100644 index 000000000000..7328cef9934d --- /dev/null +++ b/net-analyzer/icinga2/Manifest @@ -0,0 +1,11 @@ +AUX fix-missing-include-2.7.1-2.patch 680 SHA256 5aec7b797e39561fa523e069ed6225b28a40e5b7e3afc4cee0d1afbeb2d4288b SHA512 4d1fc39182029c4eb191298dcf4a39b0c5f2f806f8f2e0c6a1f98c64dd76d9181ca3b7090a73e63e66787c71cb337c76be3eae365d784903e79929ff0e644556 WHIRLPOOL 20aa072103e0f5b27d135897796bbbc3063fe3b7167fb830658bd2f6e51799ff0aa5aa4e2ed89e1668c91942c0e0bbef4a022b9836489b0e63efc612217fdb09 +AUX fix-missing-include-2.7.1.patch 597 SHA256 9616dc5c074379b5dbb4aabdb96a1b1e989ea360233ef4268b060d9e704d5dc2 SHA512 8d889b62d058cdbf318b47252abbb6a7a17e4463376868b94efb9fe875f386093dfa39026226c46a280486520c2e2fe136828810aad5fa2f7aebedc6ca8ee466 WHIRLPOOL 6b9fa0faa7d74d6bb796f3ff1c45738bfb49d0857b3d6e23b880a190b359f719c1d00aac7221d732cd0863f1c7cedcd8f4944548fb6929c5cd8b1f6786253bdc +AUX icinga2.initd 2276 SHA256 13a2603c0ba54aa095e17cb31489b9e30a4c9d0262c6b053d8dfd710b6784d8b SHA512 5b31f748eda8f52d8efe2c744c3c1adacffdb40c04d93cdaf7ee82129d632783362f6ea51b5a4c05ca9cd98d3343abfcfc86c98e99afd429d6bce390b9ffd082 WHIRLPOOL a78ca106fab9e3f9689abc6723656e49368ff499021f5fbdbede04a6933e54a252567c615d40c007f7311c9dd464632af2a6503866303fe45ad619d0479d8968 +DIST icinga2-2.7.0.tar.gz 2435398 SHA256 8f06d23e5d922ba7a74f92dbb9af792be063d06d3aea9011aba39370935c6980 SHA512 470dd4ffa4ef608a018ede5c25b41f16213bf18c679eed8aaeed155fe6adc74a70abcc2e8be42ca20bf60f9b4b620c971ebbc96d608de2a90e480d72b93111bb WHIRLPOOL c926086c296affaafc7d55471ea5c1414b2d2cb8545657215a53bb9744c3147c32f8398317ad670e0d12fb95c83b54f0712f061e5e93bab868c4f04d833c3b47 +DIST icinga2-2.7.1.tar.gz 2475348 SHA256 79f2cd2cba66b2d2a785d37cccd4a47611f7b0b7d52b9a625a22f0c7ff12f7f0 SHA512 8233c33b7191706569a236d583fff689b35eba750fca01a06cfd14ef636b01314b6b142d78777987bd08a9df1cc53f42652fd1c900532b73f0a0363aa220c6cd WHIRLPOOL be07801033b8e10d3a4aaa26e9cd6b75663aed4cf513f8d592b05ea13e0626ab3021d5a52ebeedfa754752057a1d3378fd54c1f8fd1ec5dc72338c891d6b9785 +EBUILD icinga2-2.7.0-r1.ebuild 4648 SHA256 33c144d265f50ac1e01216c28558a2cb45b8a14436d1af1d5e55b397ef40194f SHA512 aa2c2ac86a697c75a4ef4c14a8ae1f57164d7614e06082aadbed2b43bcd8762938ac8afd9beb64c982bfb4e29dc5d08b530987248132e218247b8c930195837f WHIRLPOOL a9d22e681fe0163b4e31cdf19a899f5915b87a296ffa5efbdbb3aba4d4fdbea7f97ee101eb757b91cd2d53ed6a517539295901750cf6f3c294b0e6535d113ffc +EBUILD icinga2-2.7.1-r1.ebuild 4760 SHA256 358c5155e922cd954ebbd4c14af4af549c6fe919f857db05dc62170b917111e6 SHA512 87fa97f3731c5c5c4e6801fd40d2a235fd43039ecf2ab78f969cea26c8115a20dc42d4499a9bfe987335131ceb053e6f7994db806466d932a9fe54119e34c734 WHIRLPOOL 94317744d6fd00389d7c4f7b10607f58114a8f6e6e0aef7d538c14cc7bc8de90cd439b5c9476bc285a020c6b9627130864090d08c053d1078d916fb2a384f3d0 +EBUILD icinga2-9999.ebuild 4628 SHA256 94fc1cc4ed70df5bb57236104943f875060c81f365da3fdf03ff64db90566e91 SHA512 45ba99e9812faf3859a9c7ec4e48c60a25536874d0e9e767fc68f66b70eba7cf5abb2119fd95bb452c11aa40c23ea390d1921700499671924c6b605d18351ee1 WHIRLPOOL 7028d665f67c1c5d107af412d6a6d52710939a1299cbd48c02c698e530c82d3791da7db529758aad6af20ebe0e015f4a055f1bbbcffc5da9b788c9be4a0736ad +MISC ChangeLog 12523 SHA256 6b33c1cd3ef131f9444c216ae86700732bf8d9c571ab558db1157b4d21c5abdf SHA512 5bd2ff47e0bf2714f6bdaf4339a3a7ed95a59b528bf25680831236be63d753603cc8e60de6ff7826c69e20154ba650c7c2b27a0775ac7f118b833a1d048c56f9 WHIRLPOOL 8858e1686faa46a57c300161254950d2332a632bf857e6394e3818ada73e40802a458a2ad61acd5715df35c94f8cd54df054486d1482b432eb798f0a41bf8d4f +MISC ChangeLog-2015 6716 SHA256 319e8121e497e7d44d8f115750f68283a6605b9a6ff1f0ade569b8b660a21e67 SHA512 e1618c3469eba79ff34786b5e357add06044f61154070cc726951eed6609f3e458656f61a1daed11caf42b13aaf7a91eced1924a1ad7491c4a12e91e50e39d10 WHIRLPOOL b715c79bc75d0613a864a7338e869bbd7fa6cab0e65e36e5c32e8124f2f4159ec45837195c5e2ca285249fd518ff04db10063065353a30ae49b4868a04f2d8c0 +MISC metadata.xml 816 SHA256 1936f6fa03ebee51be39b5ab1499db12128d6d161b66c217886bd0ac0beb3e0e SHA512 0d3ac2d9233f7ce53a8105caed0231cefa402861e26c760de3fb23163ea68c21b97f5ec0de65bc6953aaf2dd8fa90a9edc045a2fea8b622efdd1336959e9e60b WHIRLPOOL 118b4a5b65cd2fe6794f2e3ac5e052f4e4077bdb08a796d31a4b4dc5a3683b36429611ab1ce5941aeba36fd838b51b0e88d38523c9d32e7f49e060d8fb3f7211 diff --git a/net-analyzer/icinga2/files/fix-missing-include-2.7.1-2.patch b/net-analyzer/icinga2/files/fix-missing-include-2.7.1-2.patch new file mode 100644 index 000000000000..21779d140a4e --- /dev/null +++ b/net-analyzer/icinga2/files/fix-missing-include-2.7.1-2.patch @@ -0,0 +1,24 @@ +From 2d036e6886fb68707e861a6e5f75a6088d149832 Mon Sep 17 00:00:00 2001 +From: Michael +Date: Tue, 26 Sep 2017 22:01:07 +0200 +Subject: [PATCH] Fixed missing include statement in unit test + +This adds the missing iostream include to the notification unit test. + +refs #5613 +--- + test/icinga-notification.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/test/icinga-notification.cpp b/test/icinga-notification.cpp +index 8db93fa50..97f7838a1 100644 +--- a/test/icinga-notification.cpp ++++ b/test/icinga-notification.cpp +@@ -19,6 +19,7 @@ + + #include "icinga/notification.hpp" + #include ++#include + + using namespace icinga; + diff --git a/net-analyzer/icinga2/files/fix-missing-include-2.7.1.patch b/net-analyzer/icinga2/files/fix-missing-include-2.7.1.patch new file mode 100644 index 000000000000..d170db478db9 --- /dev/null +++ b/net-analyzer/icinga2/files/fix-missing-include-2.7.1.patch @@ -0,0 +1,22 @@ +From 631d1e85fc2575a26c700a15f309fccd9fb9ee4d Mon Sep 17 00:00:00 2001 +From: Michael +Date: Mon, 25 Sep 2017 01:07:50 +0200 +Subject: [PATCH] Fixed missing include statement in unit tests + +refs #5613 +--- + test/icinga-checkresult.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/test/icinga-checkresult.cpp b/test/icinga-checkresult.cpp +index 7f14dd365..a128e9519 100644 +--- a/test/icinga-checkresult.cpp ++++ b/test/icinga-checkresult.cpp +@@ -19,6 +19,7 @@ + + #include "icinga/host.hpp" + #include ++#include + + using namespace icinga; + diff --git a/net-analyzer/icinga2/files/icinga2.initd b/net-analyzer/icinga2/files/icinga2.initd new file mode 100644 index 000000000000..7faff11137d4 --- /dev/null +++ b/net-analyzer/icinga2/files/icinga2.initd @@ -0,0 +1,81 @@ +#!/sbin/openrc-run +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +extra_started_commands="reload" + +DAEMON="/usr/sbin/icinga2" +ICINGA2_CONFIG_FILE="/etc/icinga2/icinga2.conf" +ICINGA2_RUN_DIR="/run/icinga2" +ICINGA2_STATE_DIR="/var/cache/icinga2" +ICINGA2_CMD_DIR="${ICINGA2_RUN_DIR}/cmd" +ICINGA2_PID_FILE="${ICINGA2_RUN_DIR}/icinga2.pid" +ICINGA2_DAEMON_ARGS="daemon -c $ICINGA2_CONFIG_FILE -e $ICINGA2_ERROR_LOG -d" + +depend() { + need net +} + +checkconfig() { + if [ ! -e "$ICINGA2_CONFIG_FILE" ]; then + ewarn "Config file '$ICINGA2_CONFIG_FILE' does not exist." + eend 1 + fi + + ICINGA2_USER=$($DAEMON variable get --current RunAsUser) + if [ $? != 0 ]; then + eerror "Could not fetch RunAsUser variable: '$ICINGA2_USER'." + return 1 + fi + ICINGA2_GROUP=$($DAEMON variable get --current RunAsGroup) + if [ $? != 0 ]; then + eerror "Could not fetch RunAsGroup variable: '$ICINGA2_GROUP'." + return 1 + fi + + checkpath -d -m 0750 -o $ICINGA2_USER:$ICINGA2_GROUP $ICINGA2_RUN_DIR + checkpath -d -m 0750 -o $ICINGA2_USER:$ICINGA2_GROUP $ICINGA2_STATE_DIR + checkpath -d -m 2750 -o $ICINGA2_USER:$ICINGA2_GROUP $ICINGA2_CMD_DIR + + if ! $DAEMON daemon -c $ICINGA2_CONFIG_FILE -C > $ICINGA2_STARTUP_LOG 2>&1; then + eerror "Icinga2 detected configuration errors. Check '$ICINGA2_STARTUP_LOG' for details." + return 1 + fi +} + +start() { + checkconfig || return 1 + + ebegin "Starting icinga2" + start-stop-daemon --start --exec "${DAEMON}" \ + --pidfile "${ICINGA2_PID_FILE}" \ + -- $ICINGA2_DAEMON_ARGS > $ICINGA2_STARTUP_LOG 2>&1 + local retval=$? + if [ $retval -ne 0 ]; then + ewarn "Error starting icinga2. '$ICINGA2_STARTUP_LOG' for details." + fi + eend $retval +} + +stop() { + ebegin "Stopping icinga2" + start-stop-daemon \ + --stop \ + --pidfile $ICINGA2_PID_FILE \ + --retry "SIGTERM/15 SIGKILL/30" \ + --progress + eend $? +} + +reload() { + checkconfig || return 1 + + ebegin "Reloading icinga2" + start-stop-daemon --signal HUP --pidfile "$ICINGA2_PID_FILE" + + local retval=$? + if [ $retval -ne 0 ]; then + ewarn "Error reloading icinga2." + fi + eend $retval +} diff --git a/net-analyzer/icinga2/icinga2-2.7.0-r1.ebuild b/net-analyzer/icinga2/icinga2-2.7.0-r1.ebuild new file mode 100644 index 000000000000..8e9f5f4f36c8 --- /dev/null +++ b/net-analyzer/icinga2/icinga2-2.7.0-r1.ebuild @@ -0,0 +1,177 @@ +# Copyright 1999-2017 Gentoo Foundation +# 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 user wxwidgets + SRC_URI="https://github.com/Icinga/icinga2/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="amd64 ~arm ~arm64 ~ppc ~ppc64 x86" +else + inherit cmake-utils depend.apache eutils git-2 systemd toolchain-funcs user wxwidgets + EGIT_REPO_URI="https://github.com/Icinga/icinga2.git" + EGIT_BRANCH="master" + KEYWORDS="~ppc ~ppc64" +fi + +DESCRIPTION="Distributed, general purpose, network monitoring engine" +HOMEPAGE="http://icinga.org/icinga2" + +LICENSE="GPL-2" +SLOT="0" +IUSE="+mysql postgres classicui console libressl lto mail minimal nano-syntax +plugins studio +vim-syntax" +WX_GTK_VER="3.0" + +CDEPEND=" + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:0= ) + >=dev-libs/boost-1.58-r1 + console? ( dev-libs/libedit ) + mysql? ( virtual/mysql ) + postgres? ( dev-db/postgresql:= )" + +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 ) + classicui? ( net-analyzer/icinga[web] ) + studio? ( x11-libs/wxGTK:3.0 )" + +REQUIRED_USE="!minimal? ( || ( mysql postgres ) )" + +want_apache2 + +pkg_setup() { + depend.apache_pkg_setup + if use studio ; then + setup-wxwidgets + fi + enewgroup icinga + enewgroup icingacmd + enewgroup nagios # for plugins + enewuser icinga -1 -1 /var/lib/icinga2 "icinga,icingacmd,nagios" +} + +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_PREFIX=/usr + -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_USER=icinga + -DICINGA2_COMMAND_GROUP=icingacmd + -DINSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT=yes + -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 + # STUDIO + if use studio; then + mycmakeargs+=( + -DICINGA2_WITH_STUDIO=ON + ) + else + mycmakeargs+=( + -DICINGA2_WITH_STUDIO=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 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/* + elif 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. + http://docs.icinga.org/icinga2/snapshot/doc/module/icinga2/chapter/upgrading-icinga-2" + fi +} diff --git a/net-analyzer/icinga2/icinga2-2.7.1-r1.ebuild b/net-analyzer/icinga2/icinga2-2.7.1-r1.ebuild new file mode 100644 index 000000000000..2f4dc84145d7 --- /dev/null +++ b/net-analyzer/icinga2/icinga2-2.7.1-r1.ebuild @@ -0,0 +1,182 @@ +# Copyright 1999-2017 Gentoo Foundation +# 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 user wxwidgets + SRC_URI="https://github.com/Icinga/icinga2/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86" +else + inherit cmake-utils depend.apache eutils git-r3 systemd toolchain-funcs user wxwidgets + EGIT_REPO_URI="https://github.com/Icinga/icinga2.git" + EGIT_BRANCH="master" + KEYWORDS="~ppc ~ppc64" +fi + +DESCRIPTION="Distributed, general purpose, network monitoring engine" +HOMEPAGE="http://icinga.org/icinga2" + +LICENSE="GPL-2" +SLOT="0" +IUSE="+mysql postgres classicui console libressl lto mail minimal nano-syntax +plugins studio +vim-syntax" +WX_GTK_VER="3.0" + +CDEPEND=" + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:0= ) + >=dev-libs/boost-1.58-r1 + console? ( dev-libs/libedit ) + mysql? ( virtual/mysql ) + postgres? ( dev-db/postgresql:= )" + +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 ) + classicui? ( net-analyzer/icinga[web] ) + studio? ( x11-libs/wxGTK:3.0 )" + +REQUIRED_USE="!minimal? ( || ( mysql postgres ) )" + +PATCHES=( + "${FILESDIR}/fix-missing-include-2.7.1.patch" + "${FILESDIR}/fix-missing-include-2.7.1-2.patch" +) + +want_apache2 + +pkg_setup() { + depend.apache_pkg_setup + if use studio ; then + setup-wxwidgets + fi + enewgroup icinga + enewgroup icingacmd + enewgroup nagios # for plugins + enewuser icinga -1 -1 /var/lib/icinga2 "icinga,icingacmd,nagios" +} + +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_PREFIX=/usr + -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_USER=icinga + -DICINGA2_COMMAND_GROUP=icingacmd + -DINSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT=yes + -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 + # STUDIO + if use studio; then + mycmakeargs+=( + -DICINGA2_WITH_STUDIO=ON + ) + else + mycmakeargs+=( + -DICINGA2_WITH_STUDIO=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 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/* + elif 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. + http://docs.icinga.org/icinga2/snapshot/doc/module/icinga2/chapter/upgrading-icinga-2" + fi +} diff --git a/net-analyzer/icinga2/icinga2-9999.ebuild b/net-analyzer/icinga2/icinga2-9999.ebuild new file mode 100644 index 000000000000..32561101621d --- /dev/null +++ b/net-analyzer/icinga2/icinga2-9999.ebuild @@ -0,0 +1,177 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 +if [[ ${PV} != 9999 ]]; then + inherit cmake-utils depend.apache eutils systemd toolchain-funcs user wxwidgets + SRC_URI="https://github.com/Icinga/icinga2/archive/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~arm ~arm64 ~x86" +else + inherit cmake-utils depend.apache eutils git-r3 systemd toolchain-funcs user wxwidgets + EGIT_REPO_URI="https://github.com/Icinga/icinga2.git" + EGIT_BRANCH="master" + KEYWORDS="" +fi + +DESCRIPTION="Distributed, general purpose, network monitoring engine" +HOMEPAGE="http://icinga.org/icinga2" + +LICENSE="GPL-2" +SLOT="0" +IUSE="+mysql postgres classicui console libressl lto mail minimal nano-syntax +plugins studio +vim-syntax" +WX_GTK_VER="3.0" + +CDEPEND=" + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:0= ) + >=dev-libs/boost-1.58-r1 + console? ( dev-libs/libedit ) + mysql? ( virtual/mysql ) + postgres? ( dev-db/postgresql:= )" + +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 ) + classicui? ( net-analyzer/icinga[web] ) + studio? ( x11-libs/wxGTK:3.0 )" + +REQUIRED_USE="!minimal? ( || ( mysql postgres ) )" + +want_apache2 + +pkg_setup() { + depend.apache_pkg_setup + if use studio ; then + setup-wxwidgets + fi + enewgroup icinga + enewgroup icingacmd + enewgroup nagios # for plugins + enewuser icinga -1 -1 /var/lib/icinga2 "icinga,icingacmd,nagios" +} + +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_PREFIX=/usr + -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_USER=icinga + -DICINGA2_COMMAND_GROUP=icingacmd + -DINSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT=yes + -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 + # STUDIO + if use studio; then + mycmakeargs+=( + -DICINGA2_WITH_STUDIO=ON + ) + else + mycmakeargs+=( + -DICINGA2_WITH_STUDIO=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 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/* + elif 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. + http://docs.icinga.org/icinga2/snapshot/doc/module/icinga2/chapter/upgrading-icinga-2" + fi +} diff --git a/net-analyzer/icinga2/metadata.xml b/net-analyzer/icinga2/metadata.xml new file mode 100644 index 000000000000..b03390bc2e50 --- /dev/null +++ b/net-analyzer/icinga2/metadata.xml @@ -0,0 +1,20 @@ + + + + + prometheanfire@gentoo.org + Matthew Thode + + + Adds support for the old interface + Adds support for line-editing in the console + Adds support for link time optimization + Allows for mailing of alerts + Adds support for Icinga-studio + Adds support for syntax used in the nano editor + Adds support for nagios plugins + + + Icinga/icinga2 + + -- cgit v1.2.3