* [gentoo-commits] repo/gentoo:master commit in: net-analyzer/icinga2/, net-analyzer/icinga2/files/
@ 2016-05-22 22:59 Matt Thode
0 siblings, 0 replies; 5+ messages in thread
From: Matt Thode @ 2016-05-22 22:59 UTC (permalink / raw
To: gentoo-commits
commit: 065af99120b96dc970d0e0e8fce60fd239b9dd2e
Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
AuthorDate: Sun May 22 22:58:48 2016 +0000
Commit: Matt Thode <prometheanfire <AT> gentoo <DOT> org>
CommitDate: Sun May 22 22:58:48 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=065af991
net-analyzer/icinga2: fix bug 583298 logrotate
Package-Manager: portage-2.2.28
net-analyzer/icinga2/files/logrotate.patch | 17 +++++++++++++++++
.../{icinga2-2.4.10.ebuild => icinga2-2.4.10-r1.ebuild} | 4 +++-
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/net-analyzer/icinga2/files/logrotate.patch b/net-analyzer/icinga2/files/logrotate.patch
new file mode 100644
index 0000000..93d493a
--- /dev/null
+++ b/net-analyzer/icinga2/files/logrotate.patch
@@ -0,0 +1,17 @@
+diff -ur icinga2-2.4.10/etc/logrotate.d/icinga2.cmake icinga2-2.4.10.new/etc/logrotate.d/icinga2.cmake
+--- icinga2-2.4.10/etc/logrotate.d/icinga2.cmake 2016-05-19 06:39:29.000000000 -0500
++++ icinga2-2.4.10.new/etc/logrotate.d/icinga2.cmake 2016-05-22 17:52:45.547568144 -0500
+@@ -1,4 +1,5 @@
+ @CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/icinga2.log @CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/debug.log {
++ su icinga icingacmd
+ daily
+ rotate 7@LOGROTATE_USE_SU@
+ compress
+@@ -12,6 +13,7 @@
+ }
+
+ @CMAKE_INSTALL_FULL_LOCALSTATEDIR@/log/icinga2/error.log {
++ su icinga icingacmd
+ daily
+ rotate 90@LOGROTATE_USE_SU@
+ compress
diff --git a/net-analyzer/icinga2/icinga2-2.4.10.ebuild b/net-analyzer/icinga2/icinga2-2.4.10-r1.ebuild
similarity index 98%
rename from net-analyzer/icinga2/icinga2-2.4.10.ebuild
rename to net-analyzer/icinga2/icinga2-2.4.10-r1.ebuild
index 3f6634a..2944374 100644
--- a/net-analyzer/icinga2/icinga2-2.4.10.ebuild
+++ b/net-analyzer/icinga2/icinga2-2.4.10-r1.ebuild
@@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
# $Id$
-EAPI=5
+EAPI=6
inherit cmake-utils depend.apache eutils systemd toolchain-funcs user
DESCRIPTION="Distributed, general purpose, network monitoring engine"
@@ -38,6 +38,8 @@ RDEPEND="
REQUIRED_USE="!minimal? ( || ( mysql postgres ) )"
+PATCHES=( "${FILESDIR}/logrotate.patch" )
+
want_apache2
pkg_setup() {
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-analyzer/icinga2/, net-analyzer/icinga2/files/
@ 2017-08-31 16:55 Matt Thode
0 siblings, 0 replies; 5+ messages in thread
From: Matt Thode @ 2017-08-31 16:55 UTC (permalink / raw
To: gentoo-commits
commit: ba9c60694d004d01b0426c8d3d33cb7551054acd
Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 31 16:49:14 2017 +0000
Commit: Matt Thode <prometheanfire <AT> gentoo <DOT> org>
CommitDate: Thu Aug 31 16:55:27 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba9c6069
net-analyzer/icinga2: fixing ownership of the config directory
Package-Manager: Portage-2.3.6, Repoman-2.3.3
RepoMan-Options: --force
net-analyzer/icinga2/Manifest | 2 -
net-analyzer/icinga2/files/icinga2.confd | 4 -
net-analyzer/icinga2/icinga2-2.6.2.ebuild | 176 ---------------------
net-analyzer/icinga2/icinga2-2.6.3-r1.ebuild | 175 --------------------
...cinga2-2.7.0.ebuild => icinga2-2.7.0-r1.ebuild} | 3 +-
net-analyzer/icinga2/icinga2-9999.ebuild | 9 +-
6 files changed, 7 insertions(+), 362 deletions(-)
diff --git a/net-analyzer/icinga2/Manifest b/net-analyzer/icinga2/Manifest
index e51208d8bbc..3f3288ae022 100644
--- a/net-analyzer/icinga2/Manifest
+++ b/net-analyzer/icinga2/Manifest
@@ -1,3 +1 @@
-DIST icinga2-2.6.2.tar.gz 2357220 SHA256 c2058c0e6c39860c52a57b8ce79224729f34b48bc96fb7b1ae2b742909e9b71b SHA512 733370fb120b79bbe3bdbf3d4b640083ff26d2a872c545f4efcd23be3462435f75e0b43b269b770296cb6de4a0529f2369fb766e06444d3fdb56f04db6a3dd03 WHIRLPOOL 0d28a429e5068a490a85ebced3b102780327519968f0cdc7eb3d939d91b6199ee285e0ca524d8596681b2c82832d8fc1909974f5f7e2ecbf0b7fe2ffc908327d
-DIST icinga2-2.6.3.tar.gz 2360602 SHA256 83d44871a70d1b368b1af717873ff9b1b185344d23fc79b83118e47a85da6d90 SHA512 c6512411689951611b19a5e80bf360b4cf5ddbf95dcb47cb393f90798e36c052c68b79a5a33a72cd6205ab58d4bb3ac44ec4cd82f9d1d17dc3c0e550723272b3 WHIRLPOOL 9e2c116be306cce35d780387cd2487a7a33b5819166308b83bb26d17cb856094f67d80ea110370b13e7fa19d84463b73da1a65fbf0de60663f2ad53e25c19108
DIST icinga2-2.7.0.tar.gz 2435398 SHA256 8f06d23e5d922ba7a74f92dbb9af792be063d06d3aea9011aba39370935c6980 SHA512 470dd4ffa4ef608a018ede5c25b41f16213bf18c679eed8aaeed155fe6adc74a70abcc2e8be42ca20bf60f9b4b620c971ebbc96d608de2a90e480d72b93111bb WHIRLPOOL c926086c296affaafc7d55471ea5c1414b2d2cb8545657215a53bb9744c3147c32f8398317ad670e0d12fb95c83b54f0712f061e5e93bab868c4f04d833c3b47
diff --git a/net-analyzer/icinga2/files/icinga2.confd b/net-analyzer/icinga2/files/icinga2.confd
deleted file mode 100644
index 5bfd8d72f04..00000000000
--- a/net-analyzer/icinga2/files/icinga2.confd
+++ /dev/null
@@ -1,4 +0,0 @@
-ICINGA2_ERROR_LOG=/var/log/icinga2/error.log
-ICINGA2_STARTUP_LOG=/var/log/icinga2/startup.log
-ICINGA2_LOG=/var/log/icinga2/icinga2.log
-ICINGA2_RUN_DIR=/run/icinga2
diff --git a/net-analyzer/icinga2/icinga2-2.6.2.ebuild b/net-analyzer/icinga2/icinga2-2.6.2.ebuild
deleted file mode 100644
index 36d3970dc4e..00000000000
--- a/net-analyzer/icinga2/icinga2-2.6.2.ebuild
+++ /dev/null
@@ -1,176 +0,0 @@
-# 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-2 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_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
- newconfd "${FILESDIR}"/icinga2.confd 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 icinga:icinga /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.6.3-r1.ebuild b/net-analyzer/icinga2/icinga2-2.6.3-r1.ebuild
deleted file mode 100644
index 5f0227d0451..00000000000
--- a/net-analyzer/icinga2/icinga2-2.6.3-r1.ebuild
+++ /dev/null
@@ -1,175 +0,0 @@
-# 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 ~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_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 icinga:icinga /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.0.ebuild b/net-analyzer/icinga2/icinga2-2.7.0-r1.ebuild
similarity index 98%
rename from net-analyzer/icinga2/icinga2-2.7.0.ebuild
rename to net-analyzer/icinga2/icinga2-2.7.0-r1.ebuild
index 35df65d8c19..8e9f5f4f36c 100644
--- a/net-analyzer/icinga2/icinga2-2.7.0.ebuild
+++ b/net-analyzer/icinga2/icinga2-2.7.0-r1.ebuild
@@ -144,7 +144,8 @@ src_install() {
rm -r "${D}/var/run" || die "failed to remove /var/run"
rm -r "${D}/var/cache" || die "failed to remove /var/cache"
- fowners icinga:icinga /etc/icinga2
+ 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
diff --git a/net-analyzer/icinga2/icinga2-9999.ebuild b/net-analyzer/icinga2/icinga2-9999.ebuild
index af171a68b51..644d451cfc6 100644
--- a/net-analyzer/icinga2/icinga2-9999.ebuild
+++ b/net-analyzer/icinga2/icinga2-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=5
@@ -24,7 +24,7 @@ WX_GTK_VER="3.0"
CDEPEND="
!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:0= )
- >=dev-libs/boost-1.41
+ >=dev-libs/boost-1.58-r1
console? ( dev-libs/libedit )
mysql? ( virtual/mysql )
postgres? ( dev-db/postgresql:= )"
@@ -69,6 +69,7 @@ src_configure() {
-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
@@ -121,7 +122,6 @@ src_install() {
einstalldocs
newinitd "${FILESDIR}"/icinga2.initd icinga2
- newconfd "${FILESDIR}"/icinga2.confd icinga2
if use mysql ; then
docinto schema
@@ -144,7 +144,8 @@ src_install() {
rm -r "${D}/var/run" || die "failed to remove /var/run"
rm -r "${D}/var/cache" || die "failed to remove /var/cache"
- fowners icinga:icinga /etc/icinga2
+ 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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-analyzer/icinga2/, net-analyzer/icinga2/files/
@ 2017-09-26 16:53 Matt Thode
0 siblings, 0 replies; 5+ messages in thread
From: Matt Thode @ 2017-09-26 16:53 UTC (permalink / raw
To: gentoo-commits
commit: be33105395d2bea6316505ca5533feae5e3f4b9e
Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 26 16:52:49 2017 +0000
Commit: Matt Thode <prometheanfire <AT> gentoo <DOT> org>
CommitDate: Tue Sep 26 16:52:49 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=be331053
net-analyzer/icinga2: 2.7.1, fix missing include for bug 631252
Package-Manager: Portage-2.3.8, Repoman-2.3.3
.../icinga2/files/fix-missing-include-2.7.1.patch | 22 ++++++++++++++++++++++
net-analyzer/icinga2/icinga2-2.7.1.ebuild | 4 ++++
2 files changed, 26 insertions(+)
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 00000000000..d170db478db
--- /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 <mcktr55@gmail.com>
+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 <BoostTestTargetConfig.h>
++#include <iostream>
+
+ using namespace icinga;
+
diff --git a/net-analyzer/icinga2/icinga2-2.7.1.ebuild b/net-analyzer/icinga2/icinga2-2.7.1.ebuild
index 875027fb0d7..237a6187d8b 100644
--- a/net-analyzer/icinga2/icinga2-2.7.1.ebuild
+++ b/net-analyzer/icinga2/icinga2-2.7.1.ebuild
@@ -46,6 +46,10 @@ RDEPEND="
REQUIRED_USE="!minimal? ( || ( mysql postgres ) )"
+PATCHES=(
+ "${FILESDIR}/fix-missing-include-2.7.1.patch"
+)
+
want_apache2
pkg_setup() {
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-analyzer/icinga2/, net-analyzer/icinga2/files/
@ 2018-07-21 21:24 Matt Thode
0 siblings, 0 replies; 5+ messages in thread
From: Matt Thode @ 2018-07-21 21:24 UTC (permalink / raw
To: gentoo-commits
commit: 9179024f51643e2909a6d84049e69f887eabd9f9
Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 21 21:24:03 2018 +0000
Commit: Matt Thode <prometheanfire <AT> gentoo <DOT> org>
CommitDate: Sat Jul 21 21:24:38 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9179024f
net-analyzer/icinga2: 2.9.0-r1 fix init script
Closes: https://bugs.gentoo.org/661490
Package-Manager: Portage-2.3.43, Repoman-2.3.10
net-analyzer/icinga2/files/icinga2.initd-2 | 91 ++++++++++++++++++++++
...cinga2-2.9.0.ebuild => icinga2-2.9.0-r1.ebuild} | 2 +-
net-analyzer/icinga2/icinga2-9999.ebuild | 2 +-
3 files changed, 93 insertions(+), 2 deletions(-)
diff --git a/net-analyzer/icinga2/files/icinga2.initd-2 b/net-analyzer/icinga2/files/icinga2.initd-2
new file mode 100644
index 00000000000..b12716d4d44
--- /dev/null
+++ b/net-analyzer/icinga2/files/icinga2.initd-2
@@ -0,0 +1,91 @@
+#!/sbin/openrc-run
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_started_commands="reload"
+
+# Set defaults, see /etc/conf.d/icinga2 to override
+: ${DAEMON:=/usr/sbin/icinga2}
+: ${ICINGA2_CONFIG_FILE:=/etc/icinga2/icinga2.conf}
+: ${ICINGA2_RUN_DIR:=/run/icinga2}
+: ${ICINGA2_STATE_DIR:=/var/cache/icinga2}
+: ${ICINGA2_PID_FILE:=${ICINGA2_RUN_DIR}/icinga2.pid}
+: ${ICINGA2_CMD_DIR:=${ICINGA2_RUN_DIR}/cmd}
+: ${ICINGA2_LOG_DIR:=/var/log/icinga2}
+: ${ICINGA2_ERROR_LOG:=/var/log/icinga2/error.log}
+: ${ICINGA2_STARTUP_LOG:=/var/log/icinga2/startup.log}
+: ${ICINGA2_LOG:=/var/log/icinga2/icinga2.log}
+: ${ICINGA2_CACHE_DIR:=/var/cache/icinga2}
+: ${ICINGA2_USER:=icinga}
+: ${ICINGA2_GROUP:=icingacmd}
+: ${ICINGA2_COMMAND_GROUP:=icingacmd}
+
+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.9.0.ebuild b/net-analyzer/icinga2/icinga2-2.9.0-r1.ebuild
similarity index 98%
rename from net-analyzer/icinga2/icinga2-2.9.0.ebuild
rename to net-analyzer/icinga2/icinga2-2.9.0-r1.ebuild
index 3085070c612..5911a041405 100644
--- a/net-analyzer/icinga2/icinga2-2.9.0.ebuild
+++ b/net-analyzer/icinga2/icinga2-2.9.0-r1.ebuild
@@ -107,7 +107,7 @@ src_install() {
einstalldocs
- newinitd "${FILESDIR}"/icinga2.initd icinga2
+ newinitd "${FILESDIR}"/icinga2.initd-2 icinga2
if use mysql ; then
docinto schema
diff --git a/net-analyzer/icinga2/icinga2-9999.ebuild b/net-analyzer/icinga2/icinga2-9999.ebuild
index 3085070c612..5911a041405 100644
--- a/net-analyzer/icinga2/icinga2-9999.ebuild
+++ b/net-analyzer/icinga2/icinga2-9999.ebuild
@@ -107,7 +107,7 @@ src_install() {
einstalldocs
- newinitd "${FILESDIR}"/icinga2.initd icinga2
+ newinitd "${FILESDIR}"/icinga2.initd-2 icinga2
if use mysql ; then
docinto schema
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-analyzer/icinga2/, net-analyzer/icinga2/files/
@ 2020-10-16 11:49 Louis Sautier
0 siblings, 0 replies; 5+ messages in thread
From: Louis Sautier @ 2020-10-16 11:49 UTC (permalink / raw
To: gentoo-commits
commit: 0b287203f0d9b05f226aa9b58018842cb8dbe199
Author: Louis Sautier <sbraz <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 16 10:31:46 2020 +0000
Commit: Louis Sautier <sbraz <AT> gentoo <DOT> org>
CommitDate: Fri Oct 16 11:49:20 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0b287203
net-analyzer/icinga2: bump to 2.12.1, fix build with boost 1.74.0
Also:
* Switch to EAPI=7, cmake.eclass.
* Separate dependencies into DEPEND and BDEPEND.
* Move accounts to DEPEND because of fowners in src_install.
* Remove unused apache2 flag.
* Remove unused eutils, toolchain-funcs and wxwidgets inherits.
* Remove explicit git branch name.
* Remove pthread sed, should not be needed since
https://github.com/Icinga/icinga2/commit/9e9298f4face56f891054c25675b05e6f6771faa
* Simplify usex calls.
* Simplify USE=lto handling.
* Simplify schema install, properly set ICINGA2_WITH_MYSQL with USE=mariadb.
* Stop setting CMAKE_BUILD_TYPE to let the default "Gentoo" type be used.
* Let the eclass handle CMAKE_VERBOSE_MAKEFILE.
* Introduce USE=jumbo-build to optionally enable unity builds.
* Add sub-slot operator to dev-libs/yajl.
* Stop calling einstalldocs.
* Fix elog message, account for REPLACING_VERSIONS being a list.
* Update HOMEPAGE.
Closes: https://bugs.gentoo.org/738234
Closes: https://bugs.gentoo.org/665944
Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org>
net-analyzer/icinga2/Manifest | 1 +
.../files/icinga2-2.12.1-boost-1.74.0.patch | 436 +++++++++++++++++++++
net-analyzer/icinga2/icinga2-2.12.1.ebuild | 149 +++++++
net-analyzer/icinga2/metadata.xml | 1 +
4 files changed, 587 insertions(+)
diff --git a/net-analyzer/icinga2/Manifest b/net-analyzer/icinga2/Manifest
index bff12455281..2a6c58ace85 100644
--- a/net-analyzer/icinga2/Manifest
+++ b/net-analyzer/icinga2/Manifest
@@ -1,3 +1,4 @@
DIST icinga2-2.11.5.tar.gz 7478038 BLAKE2B 309d090e9dab5fb79b411ee75bdcdc3351b559a434543937b3486bc0d45a25fc320609985e4130c2cca83972e4be15180f85bc4c78851fcecbc96ae523ca6bcd SHA512 22b0902818ee840c5c50da3768d6fc6dadf574d8fb5884eb45a2184b9e516888caa2e09ece4f8880139fb0931f131786002f494de702925a6f458968c3cee144
DIST icinga2-2.11.6.tar.gz 7480970 BLAKE2B d247a4c0272227e0dfa2df46f91d84c7630c56df8d77d7de30aea715509b68fddbe74ef58c9b50acb4965e7108c3f9c23cf4e9c0f1a572763c34dd87cfaae1ec SHA512 e455d10612721ef6090256618c5a87e2f06e6284c2b2d137b85058bb5cdc30f3524fbcab5559acbe891e37d90f862c1b117115451bb3b59b8a2f67bb9d027e6e
DIST icinga2-2.12.0.tar.gz 7530104 BLAKE2B 6f4a37d638449596d163add4ee070d24c1eb5f483e32f6c666454353578e6399a04cda949cb51b135516be7b437196e5beeff0e5e24a7bc26b855de87e24a797 SHA512 2a0ead159cfd71ebb662b909d8c4a64bdf13235b14d37b67057034da4fbf8764167b175e20f635989a98faafabb5da4f71321a4f8592172bed5cbb3ee557b276
+DIST icinga2-2.12.1.tar.gz 7532104 BLAKE2B addb3bb6f81cb41e1ec23e989d6151af6f39fdded5a76a791806114cc2ba46c786b5d6674e9e0e86eb701cb5132f766cdf3cbdfbbcc0f9263db3a7ba844705c6 SHA512 8c266db67fb7aa27dc86e9dc28fa0e1ff7b11260ed529d3963c5cf25a5230fc9f02d7d44076948fbde6e39e2cb02f2d99c2c5b72396154baf95aaa5eba461529
diff --git a/net-analyzer/icinga2/files/icinga2-2.12.1-boost-1.74.0.patch b/net-analyzer/icinga2/files/icinga2-2.12.1-boost-1.74.0.patch
new file mode 100644
index 00000000000..e6ad4807993
--- /dev/null
+++ b/net-analyzer/icinga2/files/icinga2-2.12.1-boost-1.74.0.patch
@@ -0,0 +1,436 @@
+From c30bae2994f1e5f33f6da51eb96d423e9bf0f75c Mon Sep 17 00:00:00 2001
+From: Louis Sautier <sautier.louis@gmail.com>
+Date: Thu, 20 Aug 2020 18:25:48 +0200
+Subject: [PATCH] =?UTF-8?q?Fix=20=E2=80=98fs::copy=5Foption=E2=80=99=20has?=
+ =?UTF-8?q?=20not=20been=20declared=20with=20boost=201.74.0?=
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It was deprecated in
+https://github.com/boostorg/filesystem/commit/f199152b7df036ff1606c85e4ea1b28edfeda6cc
+---
+ lib/base/utility.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/lib/base/utility.cpp b/lib/base/utility.cpp
+index 1add7616c6..d8e6f20b0c 100644
+--- a/lib/base/utility.cpp
++++ b/lib/base/utility.cpp
+@@ -725,7 +725,11 @@ void Utility::CopyFile(const String& source, const String& target)
+ {
+ namespace fs = boost::filesystem;
+
++#if BOOST_VERSION >= 107400
++ fs::copy_file(fs::path(source.Begin(), source.End()), fs::path(target.Begin(), target.End()), fs::copy_options::overwrite_existing);
++#else /* BOOST_VERSION */
+ fs::copy_file(fs::path(source.Begin(), source.End()), fs::path(target.Begin(), target.End()), fs::copy_option::overwrite_if_exists);
++#endif /* BOOST_VERSION */
+ }
+
+ /*
+From 45dd71e0f9a93369e08d6cb26f97940f9c9594aa Mon Sep 17 00:00:00 2001
+From: "Alexander A. Klimov" <alexander.klimov@icinga.com>
+Date: Wed, 26 Aug 2020 13:56:26 +0200
+Subject: [PATCH] Introduce HttpUtility::Set()
+
+refs #8185
+---
+ lib/cli/consolecommand.cpp | 9 ++++---
+ lib/perfdata/elasticsearchwriter.cpp | 13 ++++-----
+ lib/perfdata/influxdbwriter.cpp | 7 ++---
+ lib/remote/configfileshandler.cpp | 4 +--
+ lib/remote/eventshandler.cpp | 2 +-
+ lib/remote/httpserverconnection.cpp | 40 ++++++++++++++--------------
+ lib/remote/httputility.cpp | 4 +--
+ lib/remote/httputility.hpp | 28 +++++++++++++++++++
+ lib/remote/infohandler.cpp | 6 ++---
+ plugins/check_nscp_api.cpp | 9 ++++---
+ 10 files changed, 77 insertions(+), 45 deletions(-)
+
+diff --git a/lib/cli/consolecommand.cpp b/lib/cli/consolecommand.cpp
+index 41b6590e4c..42c5c63133 100644
+--- a/lib/cli/consolecommand.cpp
++++ b/lib/cli/consolecommand.cpp
+@@ -3,6 +3,7 @@
+ #include "cli/consolecommand.hpp"
+ #include "config/configcompiler.hpp"
+ #include "remote/consolehandler.hpp"
++#include "remote/httputility.hpp"
+ #include "remote/url.hpp"
+ #include "base/configwriter.hpp"
+ #include "base/serializer.hpp"
+@@ -580,11 +581,11 @@ Dictionary::Ptr ConsoleCommand::SendRequest()
+
+ http::request<http::string_body> request(http::verb::post, std::string(l_Url->Format(false)), 10);
+
+- request.set(http::field::user_agent, "Icinga/DebugConsole/" + Application::GetAppVersion());
+- request.set(http::field::host, l_Url->GetHost() + ":" + l_Url->GetPort());
++ HttpUtility::Set(request, http::field::user_agent, "Icinga/DebugConsole/" + Application::GetAppVersion());
++ HttpUtility::Set(request, http::field::host, l_Url->GetHost() + ":" + l_Url->GetPort());
+
+- request.set(http::field::accept, "application/json");
+- request.set(http::field::authorization, "Basic " + Base64::Encode(l_Url->GetUsername() + ":" + l_Url->GetPassword()));
++ HttpUtility::Set(request, http::field::accept, "application/json");
++ HttpUtility::Set(request, http::field::authorization, "Basic " + Base64::Encode(l_Url->GetUsername() + ":" + l_Url->GetPassword()));
+
+ try {
+ http::write(*l_TlsStream, request);
+diff --git a/lib/perfdata/elasticsearchwriter.cpp b/lib/perfdata/elasticsearchwriter.cpp
+index 6870198e45..3764bf536b 100644
+--- a/lib/perfdata/elasticsearchwriter.cpp
++++ b/lib/perfdata/elasticsearchwriter.cpp
+@@ -2,6 +2,7 @@
+
+ #include "perfdata/elasticsearchwriter.hpp"
+ #include "perfdata/elasticsearchwriter-ti.cpp"
++#include "remote/httputility.hpp"
+ #include "remote/url.hpp"
+ #include "icinga/compatutility.hpp"
+ #include "icinga/service.hpp"
+@@ -474,27 +475,27 @@ void ElasticsearchWriter::SendRequest(const String& body)
+
+ http::request<http::string_body> request (http::verb::post, std::string(url->Format(true)), 10);
+
+- request.set(http::field::user_agent, "Icinga/" + Application::GetAppVersion());
+- request.set(http::field::host, url->GetHost() + ":" + url->GetPort());
++ HttpUtility::Set(request, http::field::user_agent, "Icinga/" + Application::GetAppVersion());
++ HttpUtility::Set(request, http::field::host, url->GetHost() + ":" + url->GetPort());
+
+ /* Specify required headers by Elasticsearch. */
+- request.set(http::field::accept, "application/json");
++ HttpUtility::Set(request, http::field::accept, "application/json");
+
+ /* Use application/x-ndjson for bulk streams. While ES
+ * is able to handle application/json, the newline separator
+ * causes problems with Logstash (#6609).
+ */
+- request.set(http::field::content_type, "application/x-ndjson");
++ HttpUtility::Set(request, http::field::content_type, "application/x-ndjson");
+
+ /* Send authentication if configured. */
+ String username = GetUsername();
+ String password = GetPassword();
+
+ if (!username.IsEmpty() && !password.IsEmpty())
+- request.set(http::field::authorization, "Basic " + Base64::Encode(username + ":" + password));
++ HttpUtility::Set(request, http::field::authorization, "Basic " + Base64::Encode(username + ":" + password));
+
+ request.body() = body;
+- request.set(http::field::content_length, request.body().size());
++ HttpUtility::Set(request, http::field::content_length, request.body().size());
+
+ /* Don't log the request body to debug log, this is already done above. */
+ Log(LogDebug, "ElasticsearchWriter")
+diff --git a/lib/perfdata/influxdbwriter.cpp b/lib/perfdata/influxdbwriter.cpp
+index 4692b8b5df..0ddd582447 100644
+--- a/lib/perfdata/influxdbwriter.cpp
++++ b/lib/perfdata/influxdbwriter.cpp
+@@ -2,6 +2,7 @@
+
+ #include "perfdata/influxdbwriter.hpp"
+ #include "perfdata/influxdbwriter-ti.cpp"
++#include "remote/httputility.hpp"
+ #include "remote/url.hpp"
+ #include "icinga/service.hpp"
+ #include "icinga/macroprocessor.hpp"
+@@ -501,11 +502,11 @@ void InfluxdbWriter::Flush()
+
+ http::request<http::string_body> request (http::verb::post, std::string(url->Format(true)), 10);
+
+- request.set(http::field::user_agent, "Icinga/" + Application::GetAppVersion());
+- request.set(http::field::host, url->GetHost() + ":" + url->GetPort());
++ HttpUtility::Set(request, http::field::user_agent, "Icinga/" + Application::GetAppVersion());
++ HttpUtility::Set(request, http::field::host, url->GetHost() + ":" + url->GetPort());
+
+ request.body() = body;
+- request.set(http::field::content_length, request.body().size());
++ HttpUtility::Set(request, http::field::content_length, request.body().size());
+
+ try {
+ if (stream.first) {
+diff --git a/lib/remote/configfileshandler.cpp b/lib/remote/configfileshandler.cpp
+index d714f4d864..5c2bfdb405 100644
+--- a/lib/remote/configfileshandler.cpp
++++ b/lib/remote/configfileshandler.cpp
+@@ -82,9 +82,9 @@ bool ConfigFilesHandler::HandleRequest(
+
+ String content((std::istreambuf_iterator<char>(fp)), std::istreambuf_iterator<char>());
+ response.result(http::status::ok);
+- response.set(http::field::content_type, "application/octet-stream");
++ HttpUtility::Set(response, http::field::content_type, "application/octet-stream");
+ response.body() = content;
+- response.set(http::field::content_length, response.body().size());
++ HttpUtility::Set(response, http::field::content_length, response.body().size());
+ } catch (const std::exception& ex) {
+ HttpUtility::SendJsonError(response, params, 500, "Could not read file.",
+ DiagnosticInformation(ex));
+diff --git a/lib/remote/eventshandler.cpp b/lib/remote/eventshandler.cpp
+index e92b14a2d4..e41b4711c6 100644
+--- a/lib/remote/eventshandler.cpp
++++ b/lib/remote/eventshandler.cpp
+@@ -100,7 +100,7 @@ bool EventsHandler::HandleRequest(
+ server.StartStreaming();
+
+ response.result(http::status::ok);
+- response.set(http::field::content_type, "application/json");
++ HttpUtility::Set(response, http::field::content_type, "application/json");
+
+ IoBoundWorkSlot dontLockTheIoThread (yc);
+
+diff --git a/lib/remote/httpserverconnection.cpp b/lib/remote/httpserverconnection.cpp
+index d4eac7d074..688392c821 100644
+--- a/lib/remote/httpserverconnection.cpp
++++ b/lib/remote/httpserverconnection.cpp
+@@ -184,12 +184,12 @@ bool EnsureValidHeaders(
+ { "status", String("Bad Request: ") + errorMsg }
+ }));
+ } else {
+- response.set(http::field::content_type, "text/html");
++ HttpUtility::Set(response, http::field::content_type, "text/html");
+ response.body() = String("<h1>Bad Request</h1><p><pre>") + errorMsg + "</pre></p>";
+- response.set(http::field::content_length, response.body().size());
++ HttpUtility::Set(response, http::field::content_length, response.body().size());
+ }
+
+- response.set(http::field::connection, "close");
++ HttpUtility::Set(response, http::field::connection, "close");
+
+ boost::system::error_code ec;
+
+@@ -247,20 +247,20 @@ bool HandleAccessControl(
+ auto& origin (request[http::field::origin]);
+
+ if (allowedOrigins.find(origin.to_string()) != allowedOrigins.end()) {
+- response.set(http::field::access_control_allow_origin, origin);
++ HttpUtility::Set(response, http::field::access_control_allow_origin, origin);
+ }
+
+ allowOriginHeader.Done();
+
+- response.set(http::field::access_control_allow_credentials, "true");
++ HttpUtility::Set(response, http::field::access_control_allow_credentials, "true");
+
+ if (request.method() == http::verb::options && !request[http::field::access_control_request_method].empty()) {
+ response.result(http::status::ok);
+- response.set(http::field::access_control_allow_methods, "GET, POST, PUT, DELETE");
+- response.set(http::field::access_control_allow_headers, "Authorization, X-HTTP-Method-Override");
++ HttpUtility::Set(response, http::field::access_control_allow_methods, "GET, POST, PUT, DELETE");
++ HttpUtility::Set(response, http::field::access_control_allow_headers, "Authorization, X-HTTP-Method-Override");
+ response.body() = "Preflight OK";
+- response.set(http::field::content_length, response.body().size());
+- response.set(http::field::connection, "close");
++ HttpUtility::Set(response, http::field::content_length, response.body().size());
++ HttpUtility::Set(response, http::field::connection, "close");
+
+ boost::system::error_code ec;
+
+@@ -288,10 +288,10 @@ bool EnsureAcceptHeader(
+
+ if (request.method() != http::verb::get && request[http::field::accept] != "application/json") {
+ response.result(http::status::bad_request);
+- response.set(http::field::content_type, "text/html");
++ HttpUtility::Set(response, http::field::content_type, "text/html");
+ response.body() = "<h1>Accept header is missing or not set to 'application/json'.</h1>";
+- response.set(http::field::content_length, response.body().size());
+- response.set(http::field::connection, "close");
++ HttpUtility::Set(response, http::field::content_length, response.body().size());
++ HttpUtility::Set(response, http::field::connection, "close");
+
+ boost::system::error_code ec;
+
+@@ -320,8 +320,8 @@ bool EnsureAuthenticatedUser(
+ << "Unauthorized request: " << request.method_string() << ' ' << request.target();
+
+ response.result(http::status::unauthorized);
+- response.set(http::field::www_authenticate, "Basic realm=\"Icinga 2\"");
+- response.set(http::field::connection, "close");
++ HttpUtility::Set(response, http::field::www_authenticate, "Basic realm=\"Icinga 2\"");
++ HttpUtility::Set(response, http::field::connection, "close");
+
+ if (request[http::field::accept] == "application/json") {
+ HttpUtility::SendJsonBody(response, nullptr, new Dictionary({
+@@ -329,9 +329,9 @@ bool EnsureAuthenticatedUser(
+ { "status", "Unauthorized. Please check your user credentials." }
+ }));
+ } else {
+- response.set(http::field::content_type, "text/html");
++ HttpUtility::Set(response, http::field::content_type, "text/html");
+ response.body() = "<h1>Unauthorized. Please check your user credentials.</h1>";
+- response.set(http::field::content_length, response.body().size());
++ HttpUtility::Set(response, http::field::content_length, response.body().size());
+ }
+
+ boost::system::error_code ec;
+@@ -421,12 +421,12 @@ bool EnsureValidBody(
+ { "status", String("Bad Request: ") + ec.message() }
+ }));
+ } else {
+- response.set(http::field::content_type, "text/html");
++ HttpUtility::Set(response, http::field::content_type, "text/html");
+ response.body() = String("<h1>Bad Request</h1><p><pre>") + ec.message() + "</pre></p>";
+- response.set(http::field::content_length, response.body().size());
++ HttpUtility::Set(response, http::field::content_length, response.body().size());
+ }
+
+- response.set(http::field::connection, "close");
++ HttpUtility::Set(response, http::field::connection, "close");
+
+ http::async_write(stream, response, yc[ec]);
+ stream.async_flush(yc[ec]);
+@@ -511,7 +511,7 @@ void HttpServerConnection::ProcessMessages(boost::asio::yield_context yc)
+ parser.header_limit(1024 * 1024);
+ parser.body_limit(-1);
+
+- response.set(http::field::server, l_ServerHeader);
++ HttpUtility::Set(response, http::field::server, l_ServerHeader);
+
+ if (!EnsureValidHeaders(*m_Stream, buf, parser, response, m_ShuttingDown, yc)) {
+ break;
+diff --git a/lib/remote/httputility.cpp b/lib/remote/httputility.cpp
+index 91902ba501..e46e990ecf 100644
+--- a/lib/remote/httputility.cpp
++++ b/lib/remote/httputility.cpp
+@@ -56,9 +56,9 @@ void HttpUtility::SendJsonBody(boost::beast::http::response<boost::beast::http::
+ {
+ namespace http = boost::beast::http;
+
+- response.set(http::field::content_type, "application/json");
++ HttpUtility::Set(response, http::field::content_type, "application/json");
+ response.body() = JsonEncode(val, params && GetLastParameter(params, "pretty"));
+- response.set(http::field::content_length, response.body().size());
++ HttpUtility::Set(response, http::field::content_length, response.body().size());
+ }
+
+ void HttpUtility::SendJsonError(boost::beast::http::response<boost::beast::http::string_body>& response,
+diff --git a/lib/remote/httputility.hpp b/lib/remote/httputility.hpp
+index 6465b4af92..be600d4090 100644
+--- a/lib/remote/httputility.hpp
++++ b/lib/remote/httputility.hpp
+@@ -5,8 +5,12 @@
+
+ #include "remote/url.hpp"
+ #include "base/dictionary.hpp"
++#include "base/string.hpp"
+ #include <boost/beast/http.hpp>
++#include <boost/lexical_cast.hpp>
+ #include <string>
++#include <type_traits>
++#include <utility>
+
+ namespace icinga
+ {
+@@ -26,6 +30,30 @@ class HttpUtility
+ static void SendJsonBody(boost::beast::http::response<boost::beast::http::string_body>& response, const Dictionary::Ptr& params, const Value& val);
+ static void SendJsonError(boost::beast::http::response<boost::beast::http::string_body>& response, const Dictionary::Ptr& params, const int code,
+ const String& verbose = String(), const String& diagnosticInformation = String());
++
++ template<class Message, class Key, class Value, typename std::enable_if<std::is_arithmetic<Value>::value, int>::type = 0>
++ static void Set(Message& message, Key&& key, Value value)
++ {
++ Set(message, std::forward<Key>(key), boost::lexical_cast<std::string>(value));
++ }
++
++ template<class Message, class Key>
++ static void Set(Message& message, Key&& key, const String& value)
++ {
++ Set(message, std::forward<Key>(key), value.GetData());
++ }
++
++ template<class Message, class Key>
++ static void Set(Message& message, Key&& key, String&& value)
++ {
++ Set(message, std::forward<Key>(key), value.GetData());
++ }
++
++ template<class Message, class Key, class Value, typename std::enable_if<!std::is_arithmetic<Value>::value, int>::type = 0>
++ static void Set(Message& message, Key&& key, Value&& value)
++ {
++ message.set(std::forward<Key>(key), std::forward<Value>(value));
++ }
+ };
+
+ }
+diff --git a/lib/remote/infohandler.cpp b/lib/remote/infohandler.cpp
+index 18c18c0e04..daec628047 100644
+--- a/lib/remote/infohandler.cpp
++++ b/lib/remote/infohandler.cpp
+@@ -29,7 +29,7 @@ bool InfoHandler::HandleRequest(
+
+ if (url->GetPath().empty()) {
+ response.result(http::status::found);
+- response.set(http::field::location, "/v1");
++ HttpUtility::Set(response, http::field::location, "/v1");
+ return true;
+ }
+
+@@ -74,7 +74,7 @@ bool InfoHandler::HandleRequest(
+
+ HttpUtility::SendJsonBody(response, params, result);
+ } else {
+- response.set(http::field::content_type, "text/html");
++ HttpUtility::Set(response, http::field::content_type, "text/html");
+
+ String body = "<html><head><title>Icinga 2</title></head><h1>Hello from Icinga 2 (Version: " + Application::GetAppVersion() + ")!</h1>";
+ body += "<p>You are authenticated as <b>" + user->GetName() + "</b>. ";
+@@ -92,7 +92,7 @@ bool InfoHandler::HandleRequest(
+
+ body += R"(<p>More information about API requests is available in the <a href="https://icinga.com/docs/icinga2/latest/" target="_blank">documentation</a>.</p></html>)";
+ response.body() = body;
+- response.set(http::field::content_length, response.body().size());
++ HttpUtility::Set(response, http::field::content_length, response.body().size());
+ }
+
+ return true;
+diff --git a/plugins/check_nscp_api.cpp b/plugins/check_nscp_api.cpp
+index 3f6843ec29..ad15e62527 100644
+--- a/plugins/check_nscp_api.cpp
++++ b/plugins/check_nscp_api.cpp
+@@ -16,6 +16,7 @@
+ #include "base/tcpsocket.hpp" /* include global icinga::Connect */
+ #include "base/tlsstream.hpp"
+ #include "base/base64.hpp"
++#include "remote/httputility.hpp"
+ #include "remote/url.hpp"
+ #include <remote/url-characters.hpp>
+ #include <boost/program_options.hpp>
+@@ -365,11 +366,11 @@ static Dictionary::Ptr FetchData(const String& host, const String& port, const S
+
+ http::request<http::string_body> request (http::verb::get, std::string(url->Format(true)), 10);
+
+- request.set(http::field::user_agent, "Icinga/check_nscp_api/" + String(VERSION));
+- request.set(http::field::host, host + ":" + port);
++ HttpUtility::Set(request, http::field::user_agent, "Icinga/check_nscp_api/" + String(VERSION));
++ HttpUtility::Set(request, http::field::host, host + ":" + port);
+
+- request.set(http::field::accept, "application/json");
+- request.set("password", password);
++ HttpUtility::Set(request, http::field::accept, "application/json");
++ HttpUtility::Set(request, "password", password);
+
+ if (l_Debug) {
+ std::cout << "Sending request to " << url->Format(false, false) << "'.\n";
+From 7e62a68eadada58e762d3f4261750796adffd440 Mon Sep 17 00:00:00 2001
+From: "Alexander A. Klimov" <alexander.klimov@icinga.com>
+Date: Wed, 26 Aug 2020 13:48:39 +0200
+Subject: [PATCH] Define BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT
+
+refs #8185
+---
+ CMakeLists.txt | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 046f23cf22..46e765415e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -172,6 +172,9 @@ add_definitions(-DBOOST_COROUTINES_NO_DEPRECATION_WARNING)
+
+ add_definitions(-DBOOST_FILESYSTEM_NO_DEPRECATED)
+
++# Required for Boost v1.74+
++add_definitions(-DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
++
+ link_directories(${Boost_LIBRARY_DIRS})
+ include_directories(${Boost_INCLUDE_DIRS})
+
diff --git a/net-analyzer/icinga2/icinga2-2.12.1.ebuild b/net-analyzer/icinga2/icinga2-2.12.1.ebuild
new file mode 100644
index 00000000000..8ec76ee82fa
--- /dev/null
+++ b/net-analyzer/icinga2/icinga2-2.12.1.ebuild
@@ -0,0 +1,149 @@
+# Copyright 1999-2020 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 libressl lto mail mariadb minimal +mysql nano-syntax +plugins postgres systemd +vim-syntax"
+
+# Add accounts to DEPEND because of fowners in src_install
+DEPEND="
+ !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:=
+ 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=(
+ # https://github.com/Icinga/icinga2/issues/8185#issuecomment-680875875
+ "${FILESDIR}/${PN}-2.12.1-boost-1.74.0.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 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 ]]; 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
+}
diff --git a/net-analyzer/icinga2/metadata.xml b/net-analyzer/icinga2/metadata.xml
index 2916a688675..15c8f7859e8 100644
--- a/net-analyzer/icinga2/metadata.xml
+++ b/net-analyzer/icinga2/metadata.xml
@@ -8,6 +8,7 @@
<use>
<flag name="console">Adds support for line-editing in the console</flag>
<flag name="lto">Adds support for link time optimization</flag>
+ <flag name="jumbo-build">Combine source files to speed up build process (may speed up build but requires more memory)</flag>
<flag name="mail">Allows for mailing of alerts</flag>
<flag name="mariadb">Enable support for the mariadb database backend</flag>
<flag name="nano-syntax">Adds support for syntax used in the nano editor</flag>
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-10-16 11:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-22 22:59 [gentoo-commits] repo/gentoo:master commit in: net-analyzer/icinga2/, net-analyzer/icinga2/files/ Matt Thode
-- strict thread matches above, loose matches on Subject: below --
2017-08-31 16:55 Matt Thode
2017-09-26 16:53 Matt Thode
2018-07-21 21:24 Matt Thode
2020-10-16 11:49 Louis Sautier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox