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