Gentoo Archives: gentoo-commits

From: Matthew Thode <prometheanfire@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/icinga2/
Date: Thu, 30 Jun 2022 21:16:47
Message-Id: 1656623795.bfbc07799e5bcdf49630d566316033a548d297eb.prometheanfire@gentoo
1 commit: bfbc07799e5bcdf49630d566316033a548d297eb
2 Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jun 30 21:11:07 2022 +0000
4 Commit: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
5 CommitDate: Thu Jun 30 21:16:35 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bfbc0779
7
8 net-analyzer/icinga2: 2.13.4 bump
9
10 Package-Manager: Portage-3.0.30, Repoman-3.0.3
11 Signed-off-by: Matthew Thode <prometheanfire <AT> gentoo.org>
12
13 net-analyzer/icinga2/Manifest | 1 +
14 net-analyzer/icinga2/icinga2-2.13.4.ebuild | 145 +++++++++++++++++++++++++++++
15 2 files changed, 146 insertions(+)
16
17 diff --git a/net-analyzer/icinga2/Manifest b/net-analyzer/icinga2/Manifest
18 index 39ff02c1b6af..a09d4f7975b2 100644
19 --- a/net-analyzer/icinga2/Manifest
20 +++ b/net-analyzer/icinga2/Manifest
21 @@ -1 +1,2 @@
22 DIST icinga2-2.13.3.tar.gz 7529976 BLAKE2B f661919b0a7b420eba663d6cb01f2223c15b2be7f4ad649e1e09b7b4068d1122d63c6baac490ff3a0bd808066b759138748e70de364eea4d89f560168a448c72 SHA512 818eb565c6d46bfb538d70b9e33bb7424ab6fb98289da9eb947ec1f36b7e3b0e3869db789acd565b5e5b3d8b4819fe991000f4df362e28686dd9e3394cec3743
23 +DIST icinga2-2.13.4.tar.gz 9662432 BLAKE2B fdae71d081a646b2f70d768b43c56602221d585997a1fca96d2f6c30c27eb6344a443a1d12981c94542fdb77443b40be3c4ec87796a82bfcab1b53fe6b46e0ec SHA512 454eb03587c66de2697d0d604fab37ae4ce243653357cd3295998ab9b58287acefc27876e06e530b8bd6bb4d96c1289a1f05ef25f0b19573123a0cf1d99b5cfb
24
25 diff --git a/net-analyzer/icinga2/icinga2-2.13.4.ebuild b/net-analyzer/icinga2/icinga2-2.13.4.ebuild
26 new file mode 100644
27 index 000000000000..d9cef157f92b
28 --- /dev/null
29 +++ b/net-analyzer/icinga2/icinga2-2.13.4.ebuild
30 @@ -0,0 +1,145 @@
31 +# Copyright 1999-2022 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=7
35 +
36 +inherit cmake systemd
37 +
38 +if [[ ${PV} != 9999 ]]; then
39 + SRC_URI="https://github.com/Icinga/icinga2/archive/v${PV}.tar.gz -> ${P}.tar.gz"
40 + KEYWORDS="~amd64 ~arm64 ~x86"
41 +else
42 + inherit git-r3
43 + EGIT_REPO_URI="https://github.com/Icinga/icinga2.git"
44 +fi
45 +
46 +DESCRIPTION="Distributed, general purpose, network monitoring engine"
47 +HOMEPAGE="https://icinga.com/"
48 +
49 +LICENSE="GPL-2"
50 +SLOT="0"
51 +IUSE="console jumbo-build lto mail mariadb minimal +mysql nano-syntax +plugins postgres systemd +vim-syntax"
52 +
53 +# Add accounts to DEPEND because of fowners in src_install
54 +DEPEND="
55 + dev-libs/openssl:0=
56 + >=dev-libs/boost-1.66.0:=[context]
57 + console? ( dev-libs/libedit )
58 + mariadb? ( dev-db/mariadb-connector-c:= )
59 + mysql? ( dev-db/mysql-connector-c:= )
60 + postgres? ( dev-db/postgresql:= )
61 + dev-libs/yajl:=
62 + acct-user/icinga
63 + acct-group/icinga
64 + acct-group/icingacmd"
65 +BDEPEND="
66 + sys-devel/bison
67 + >=sys-devel/flex-2.5.35"
68 +RDEPEND="
69 + ${DEPEND}
70 + plugins? ( || (
71 + net-analyzer/monitoring-plugins
72 + net-analyzer/nagios-plugins
73 + ) )
74 + mail? ( virtual/mailx )
75 + acct-group/nagios"
76 +
77 +REQUIRED_USE="!minimal? ( || ( mariadb mysql postgres ) )"
78 +
79 +src_configure() {
80 + local mycmakeargs=(
81 + -DICINGA2_UNITY_BUILD=$(usex jumbo-build)
82 + -DCMAKE_INSTALL_SYSCONFDIR=/etc
83 + -DCMAKE_INSTALL_LOCALSTATEDIR=/var
84 + -DICINGA2_SYSCONFIGFILE=/etc/conf.d/icinga2
85 + -DICINGA2_PLUGINDIR="/usr/$(get_libdir)/nagios/plugins"
86 + -DICINGA2_USER=icinga
87 + -DICINGA2_GROUP=icingacmd
88 + -DICINGA2_COMMAND_GROUP=icingacmd
89 + -DICINGA2_RUNDIR=/run
90 + -DINSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT=ON
91 + -DUSE_SYSTEMD=$(usex systemd)
92 + -DLOGROTATE_HAS_SU=ON
93 + -DICINGA2_LTO_BUILD=$(usex lto)
94 + )
95 + # default to off if minimal, allow the flags to be set otherwise
96 + if use minimal; then
97 + mycmakeargs+=(
98 + -DICINGA2_WITH_MYSQL=OFF
99 + -DICINGA2_WITH_PGSQL=OFF
100 + )
101 + else
102 + mycmakeargs+=(
103 + -DICINGA2_WITH_PGSQL=$(usex postgres)
104 + -DICINGA2_WITH_MYSQL=$(usex mysql yes $(usex mariadb))
105 + )
106 + fi
107 +
108 + cmake_src_configure
109 +}
110 +
111 +src_install() {
112 + cmake_src_install
113 +
114 + newinitd "${FILESDIR}"/icinga2.initd-3 icinga2
115 +
116 + if use mysql || use mariadb; then
117 + docinto schema
118 + newdoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_mysql/schema/mysql.sql mysql.sql
119 + docinto schema/upgrade
120 + dodoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_mysql/schema/upgrade/*
121 + fi
122 + if use postgres; then
123 + docinto schema
124 + newdoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_pgsql/schema/pgsql.sql pgsql.sql
125 + docinto schema/upgrade
126 + dodoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_pgsql/schema/upgrade/*
127 + fi
128 +
129 + keepdir /etc/icinga2
130 + keepdir /var/lib/icinga2/api/zones
131 + keepdir /var/lib/icinga2/api/repository
132 + keepdir /var/lib/icinga2/api/log
133 + keepdir /var/spool/icinga2/perfdata
134 +
135 + rm -r "${D}/run" || die "failed to remove /run"
136 + rm -r "${D}/var/cache" || die "failed to remove /var/cache"
137 +
138 + fowners -R icinga:icinga /etc/icinga2
139 + fperms 0750 /etc/icinga2
140 + fowners icinga:icinga /var/lib/icinga2
141 + fowners -R icinga:icingacmd /var/lib/icinga2/api
142 + fowners -R icinga:icingacmd /var/lib/icinga2/certificate-requests
143 + fowners -R icinga:icingacmd /var/lib/icinga2/certs
144 + fowners icinga:icinga /var/spool/icinga2
145 + fowners icinga:icinga /var/spool/icinga2/perfdata
146 + fowners icinga:icingacmd /var/log/icinga2
147 +
148 + fperms ug+rwX,o-rwx /etc/icinga2
149 + fperms ug+rwX,o-rwx /var/lib/icinga2
150 + fperms ug+rwX,o-rwx /var/spool/icinga2
151 + fperms ug+rwX,o-rwx /var/log/icinga2
152 +
153 + if use vim-syntax; then
154 + insinto /usr/share/vim/vimfiles
155 + doins -r "${WORKDIR}"/${P}/tools/syntax/vim/ftdetect
156 + doins -r "${WORKDIR}"/${P}/tools/syntax/vim/syntax
157 + fi
158 +
159 + if use nano-syntax; then
160 + insinto /usr/share/nano
161 + doins "${WORKDIR}"/${P}/tools/syntax/nano/icinga2.nanorc
162 + fi
163 +}
164 +
165 +pkg_postinst() {
166 + if [[ "${PV}" != 9999 ]]; then
167 + local v
168 + for v in ${REPLACING_VERSIONS}; do
169 + if ver_test "${PV}" -gt "${v}"; then
170 + elog "DB IDO schema upgrade may be required."
171 + elog "https://www.icinga.com/docs/icinga2/latest/doc/16-upgrading-icinga-2/"
172 + fi
173 + done
174 + fi
175 +}