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: Fri, 28 May 2021 15:52:09
Message-Id: 1622217120.d0773ba2ddd7da40940873e9bbfa91be7b98b062.prometheanfire@gentoo
1 commit: d0773ba2ddd7da40940873e9bbfa91be7b98b062
2 Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
3 AuthorDate: Fri May 28 15:51:44 2021 +0000
4 Commit: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
5 CommitDate: Fri May 28 15:52:00 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d0773ba2
7
8 net-analyzer/icinga2: 2.12.4 bump
9
10 Package-Manager: Portage-3.0.18, Repoman-3.0.2
11 Signed-off-by: Matthew Thode <prometheanfire <AT> gentoo.org>
12
13 net-analyzer/icinga2/Manifest | 1 +
14 net-analyzer/icinga2/icinga2-2.12.4.ebuild | 148 +++++++++++++++++++++++++++++
15 2 files changed, 149 insertions(+)
16
17 diff --git a/net-analyzer/icinga2/Manifest b/net-analyzer/icinga2/Manifest
18 index e92368b9b6f..bd822b23fcf 100644
19 --- a/net-analyzer/icinga2/Manifest
20 +++ b/net-analyzer/icinga2/Manifest
21 @@ -1 +1,2 @@
22 DIST icinga2-2.12.3.tar.gz 7534454 BLAKE2B 021f940b3885c90cc43b4708c83430685fdb692d5ce95ed0f667a95b7dd2f4817b30fb7b05f1e214ba3aa31cef806af0f83e68447ece94916d806fb95f66526e SHA512 28b87e03a8ffeb7a1d19ddf9555151b826f7bf1fd33b0139c2fc8abe7c89d66d96089d5b32d0aaccc3876040514b2bfbde9970416d5ec4ea3b023b17c0fb1799
23 +DIST icinga2-2.12.4.tar.gz 7535804 BLAKE2B 495a53fc0887ff2e1b5e058c52af63c155da600b4c82e38653a56c4b1dab497ef477254b19727c6c366b48c41a052b68c9910cb4bc4782605612a3d63ccf646c SHA512 3a817eb6f1be256f6eca5136e3d74c49e1cc2a7af382a906abebc6d573579e755decf72bfce62fad48f9c5a37fe6bc304c5849d1008ab7ce4939213f720ab37b
24
25 diff --git a/net-analyzer/icinga2/icinga2-2.12.4.ebuild b/net-analyzer/icinga2/icinga2-2.12.4.ebuild
26 new file mode 100644
27 index 00000000000..655d8049880
28 --- /dev/null
29 +++ b/net-analyzer/icinga2/icinga2-2.12.4.ebuild
30 @@ -0,0 +1,148 @@
31 +# Copyright 1999-2021 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 +PATCHES=(
80 + # https://github.com/Icinga/icinga2/issues/8185#issuecomment-680875875
81 + "${FILESDIR}/${PN}-2.12.1-boost-1.74.0.patch"
82 +)
83 +
84 +src_configure() {
85 + local mycmakeargs=(
86 + -DICINGA2_UNITY_BUILD=$(usex jumbo-build)
87 + -DCMAKE_INSTALL_SYSCONFDIR=/etc
88 + -DCMAKE_INSTALL_LOCALSTATEDIR=/var
89 + -DICINGA2_SYSCONFIGFILE=/etc/conf.d/icinga2
90 + -DICINGA2_PLUGINDIR="/usr/$(get_libdir)/nagios/plugins"
91 + -DICINGA2_USER=icinga
92 + -DICINGA2_GROUP=icingacmd
93 + -DICINGA2_COMMAND_GROUP=icingacmd
94 + -DICINGA2_RUNDIR=/run
95 + -DINSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT=ON
96 + -DUSE_SYSTEMD=$(usex systemd)
97 + -DLOGROTATE_HAS_SU=ON
98 + -DICINGA2_LTO_BUILD=$(usex lto)
99 + )
100 + # default to off if minimal, allow the flags to be set otherwise
101 + if use minimal; then
102 + mycmakeargs+=(
103 + -DICINGA2_WITH_MYSQL=OFF
104 + -DICINGA2_WITH_PGSQL=OFF
105 + )
106 + else
107 + mycmakeargs+=(
108 + -DICINGA2_WITH_PGSQL=$(usex postgres)
109 + -DICINGA2_WITH_MYSQL=$(usex mysql yes $(usex mariadb))
110 + )
111 + fi
112 +
113 + cmake_src_configure
114 +}
115 +
116 +src_install() {
117 + cmake_src_install
118 +
119 + newinitd "${FILESDIR}"/icinga2.initd-3 icinga2
120 +
121 + if use mysql || use mariadb; then
122 + docinto schema
123 + newdoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_mysql/schema/mysql.sql mysql.sql
124 + docinto schema/upgrade
125 + dodoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_mysql/schema/upgrade/*
126 + fi
127 + if use postgres; then
128 + docinto schema
129 + newdoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_pgsql/schema/pgsql.sql pgsql.sql
130 + docinto schema/upgrade
131 + dodoc "${WORKDIR}"/icinga2-${PV}/lib/db_ido_pgsql/schema/upgrade/*
132 + fi
133 +
134 + keepdir /etc/icinga2
135 + keepdir /var/lib/icinga2/api/zones
136 + keepdir /var/lib/icinga2/api/repository
137 + keepdir /var/lib/icinga2/api/log
138 + keepdir /var/spool/icinga2/perfdata
139 +
140 + rm -r "${D}/run" || die "failed to remove /run"
141 + rm -r "${D}/var/cache" || die "failed to remove /var/cache"
142 +
143 + fowners root:icinga /etc/icinga2
144 + fperms 0750 /etc/icinga2
145 + fowners icinga:icinga /var/lib/icinga2
146 + fowners icinga:icinga /var/spool/icinga2
147 + fowners -R icinga:icingacmd /var/lib/icinga2/api
148 + fowners icinga:icinga /var/spool/icinga2/perfdata
149 + fowners icinga:icingacmd /var/log/icinga2
150 +
151 + fperms ug+rwX,o-rwx /etc/icinga2
152 + fperms ug+rwX,o-rwx /var/lib/icinga2
153 + fperms ug+rwX,o-rwx /var/spool/icinga2
154 + fperms ug+rwX,o-rwx /var/log/icinga2
155 +
156 + if use vim-syntax; then
157 + insinto /usr/share/vim/vimfiles
158 + doins -r "${WORKDIR}"/${P}/tools/syntax/vim/ftdetect
159 + doins -r "${WORKDIR}"/${P}/tools/syntax/vim/syntax
160 + fi
161 +
162 + if use nano-syntax; then
163 + insinto /usr/share/nano
164 + doins "${WORKDIR}"/${P}/tools/syntax/nano/icinga2.nanorc
165 + fi
166 +}
167 +
168 +pkg_postinst() {
169 + if [[ "${PV}" != 9999 ]]; then
170 + local v
171 + for v in ${REPLACING_VERSIONS}; do
172 + if ver_test "${PV}" -gt "${v}"; then
173 + elog "DB IDO schema upgrade may be required."
174 + elog "https://www.icinga.com/docs/icinga2/latest/doc/16-upgrading-icinga-2/"
175 + fi
176 + done
177 + fi
178 +}