Gentoo Archives: gentoo-commits

From: "Miroslav Šulc" <fordfrog@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/zabbix/
Date: Wed, 31 Aug 2022 17:53:33
Message-Id: 1661968401.060a00327c390c4eb8f6eb1e64202cca1d3fe2a0.fordfrog@gentoo
1 commit: 060a00327c390c4eb8f6eb1e64202cca1d3fe2a0
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Wed Aug 31 17:53:21 2022 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 31 17:53:21 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=060a0032
7
8 net-analyzer/zabbix: bump to 5.0.27
9
10 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
11
12 net-analyzer/zabbix/Manifest | 2 +
13 net-analyzer/zabbix/zabbix-5.0.27.ebuild | 398 +++++++++++++++++++++++++++++++
14 2 files changed, 400 insertions(+)
15
16 diff --git a/net-analyzer/zabbix/Manifest b/net-analyzer/zabbix/Manifest
17 index c7f580a5c8bd..9859510d522b 100644
18 --- a/net-analyzer/zabbix/Manifest
19 +++ b/net-analyzer/zabbix/Manifest
20 @@ -1,6 +1,8 @@
21 DIST zabbix-4.0.43.tar.gz 17648025 BLAKE2B 1dbe0c8691d990278bcc540dcd57d7640a3d832021a9ec416dd67857a3e6e0724659ca13c6c59482e45e772cdb3c22f66810d0111e59d0371ed37f3d8b61275b SHA512 5d7f81a2e7dd8d060ab46c37622b4b73702d208e065bd99022f6c7e9598f2230b89347e73864238861eed7747d5439221ed1e4cc7ac99bf1e990d9550612dd7f
22 DIST zabbix-5.0.26-go-deps.tar.xz 34385532 BLAKE2B a52924f8bee464deb6f6812242c0d7d987e7b46d097f0a118e2cb429d6d3d26f8e116d66e594a26e22bc5bf81997d21fb66ef97151538a814f63fe2c55a7f729 SHA512 49727ccd5e26d28e577fe9ee1d7eaa2de3d5054e831ea82e5dc9d8177c63063cf957b575072c5dc68b294763d519fff9041700e2dc267394e6ec143d272b1dd7
23 DIST zabbix-5.0.26.tar.gz 21248951 BLAKE2B 9119e66acc71f5ed8baf07b6bc90a69152188e1e74058146a9c7eef7d36fc9f0363a5635518bdb696b76fb93c9777878b8d4411853c641dec809e86cba4cfa74 SHA512 b10b3eb849ea3646aeaf3d2a1dbf639e6effbd21a23c06e4f2686a177d2ae186537607ed0a76c3f520cb84f3bba3079f5d9f7e840077cf5e1a3eac4b46f0558b
24 +DIST zabbix-5.0.27-go-deps.tar.xz 34405712 BLAKE2B a24aa4bfde3726e04a6eb2664e4e9ab510ebaee55bd35ee61fe296cd961482d587305f461ca76a483d5441c3a2a8554dbb510bb00aabf3d60a0cc7342f48f61b SHA512 6f871b203247633253339db21015ad8610d905d9c7801ca34291af373fdc1a57b676b575da02b21968ab624fd3e87084cd4c4d234f43520d55a4a448c27d09e6
25 +DIST zabbix-5.0.27.tar.gz 21319138 BLAKE2B bd6d8986c3c1fbfb702fcda97ce1567701c4354cfed624978a3820b79643295e38c08370e43a2d2ae8b78f68118e4b443488903227197d3afd5fc298b806549e SHA512 e6c3f63e0f3999d723c6e46611cbdb33eea2c81cf33821bf6204ea1e3c31a8745a65641da037886798f918e8f775d97c326dd180dc4b26d66cc0af822e8697ad
26 DIST zabbix-6.0.7-go-deps.tar.xz 35327308 BLAKE2B eb95964650a58bd300218888e9207f3feb25e9e0c87ed459446d6494bc2388d21d501e73ea8e0a99e4feabbd6d6c12d18c11b096cc6dc1fb534acbe8b3b353ac SHA512 eff9ec6c170279aa228b05a83c5f1bb8d793216189575180d05255faf6a6062c2ab6366ff4aa4e2cd092636a984e6658be47c404628d24dbee209111d28a516e
27 DIST zabbix-6.0.7.tar.gz 34190093 BLAKE2B 781edbeaf5452f8e54b6fe91b77ad9dfc8ffcf4716e97f39f5ff8160f084d551cdee9bc34d67141ebcfc5eb0cb074a03c55e0dce36d06c6d589ee021c1c6dba6 SHA512 36e8e26edd104cfdd2510dd201b8020a41d7af3006ad04d6659083ebcc14574b3360c01f70c86a1e008f719c1078512c891ac525ffe7480816973b515f0dcc8f
28 DIST zabbix-6.0.8-go-deps.tar.xz 35354840 BLAKE2B bae764f1c66accc77171099c47432c8024c1e591286ac88cab7e25acb7c5f168ac69c5824d3e1e7281bfd2e26a1c80f5c77201368290424cc54fbb7134a76307 SHA512 f15d64e76c3ff037aa040fadd79805834b41c7494309c0d24f95c7d20c6c67c3d374f9079e2cc31a9af20a775d1691ef9cc57075cb895ee4e96f8b00cc41e2e6
29
30 diff --git a/net-analyzer/zabbix/zabbix-5.0.27.ebuild b/net-analyzer/zabbix/zabbix-5.0.27.ebuild
31 new file mode 100644
32 index 000000000000..d3c97bb80618
33 --- /dev/null
34 +++ b/net-analyzer/zabbix/zabbix-5.0.27.ebuild
35 @@ -0,0 +1,398 @@
36 +# Copyright 1999-2022 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +# To create the go modules tarball:
40 +# cd src/go
41 +# GOMODCACHE="${PWD}"/go-mod go mod download -modcacherw
42 +# tar -acf zabbix-${PV}-go-deps.tar.xz go-mod
43 +
44 +EAPI=8
45 +
46 +GO_OPTIONAL="yes"
47 +# needed to make webapp-config dep optional
48 +WEBAPP_OPTIONAL="yes"
49 +inherit webapp java-pkg-opt-2 systemd tmpfiles toolchain-funcs go-module user-info
50 +
51 +DESCRIPTION="ZABBIX is software for monitoring of your applications, network and servers"
52 +HOMEPAGE="https://www.zabbix.com/"
53 +MY_P=${P/_/}
54 +MY_PV=${PV/_/}
55 +SRC_URI="https://cdn.zabbix.com/${PN}/sources/stable/$(ver_cut 1-2)/${P}.tar.gz
56 + agent2? ( https://dev.gentoo.org/~fordfrog/distfiles/${P}-go-deps.tar.xz )
57 +"
58 +
59 +LICENSE="GPL-2"
60 +SLOT="0/$(ver_cut 1-2)"
61 +WEBAPP_MANUAL_SLOT="yes"
62 +KEYWORDS="~amd64 ~x86"
63 +IUSE="+agent +agent2 curl frontend gnutls ipv6 java ldap libxml2 mysql odbc openipmi +openssl oracle +postgres proxy server snmp sqlite ssh static"
64 +REQUIRED_USE="|| ( agent agent2 frontend proxy server )
65 + ?? ( gnutls openssl )
66 + proxy? ( ^^ ( mysql oracle postgres sqlite ) )
67 + server? ( ^^ ( mysql oracle postgres ) !sqlite )
68 + static? ( !oracle !snmp )"
69 +
70 +COMMON_DEPEND="
71 + curl? ( net-misc/curl )
72 + gnutls? ( net-libs/gnutls:0= )
73 + java? ( >=virtual/jdk-1.8:* )
74 + ldap? (
75 + =dev-libs/cyrus-sasl-2*
76 + net-libs/gnutls:=
77 + net-nds/openldap:=
78 + )
79 + libxml2? ( dev-libs/libxml2 )
80 + mysql? ( dev-db/mysql-connector-c:= )
81 + odbc? ( dev-db/unixODBC )
82 + openipmi? ( sys-libs/openipmi )
83 + openssl? ( dev-libs/openssl:=[-bindist(-)] )
84 + oracle? ( dev-db/oracle-instantclient[odbc,sdk] )
85 + postgres? ( dev-db/postgresql:* )
86 + proxy? (
87 + dev-libs/libevent:=
88 + sys-libs/zlib
89 + )
90 + server? (
91 + dev-libs/libevent:=
92 + sys-libs/zlib
93 + )
94 + snmp? ( net-analyzer/net-snmp:= )
95 + sqlite? ( dev-db/sqlite )
96 + ssh? ( net-libs/libssh2 )
97 +"
98 +
99 +RDEPEND="${COMMON_DEPEND}
100 + acct-group/zabbix
101 + acct-user/zabbix
102 + java? ( >=virtual/jre-1.8:* )
103 + mysql? ( virtual/mysql )
104 + proxy? (
105 + dev-libs/libpcre
106 + net-analyzer/fping[suid]
107 + )
108 + server? (
109 + app-admin/webapp-config
110 + dev-libs/libpcre
111 + net-analyzer/fping[suid]
112 + )
113 + frontend? (
114 + app-admin/webapp-config
115 + dev-lang/php:*[bcmath,ctype,sockets,gd,truetype,xml,session,xmlreader,xmlwriter,nls,sysvipc,unicode]
116 + media-libs/gd[png]
117 + virtual/httpd-php:*
118 + mysql? ( dev-lang/php[mysqli] )
119 + odbc? ( dev-lang/php[odbc] )
120 + oracle? ( dev-lang/php[oci8-instant-client] )
121 + postgres? ( dev-lang/php[postgres] )
122 + sqlite? ( dev-lang/php[sqlite] )
123 + )
124 +"
125 +DEPEND="${COMMON_DEPEND}
126 + static? (
127 + curl? ( net-misc/curl[static-libs] )
128 + ldap? (
129 + =dev-libs/cyrus-sasl-2*[static-libs]
130 + net-libs/gnutls[static-libs]
131 + net-nds/openldap[static-libs]
132 + )
133 + libxml2? ( dev-libs/libxml2[static-libs] )
134 + mysql? ( dev-db/mysql-connector-c[static-libs] )
135 + odbc? ( dev-db/unixODBC[static-libs] )
136 + postgres? ( dev-db/postgresql:*[static-libs] )
137 + sqlite? ( dev-db/sqlite[static-libs] )
138 + ssh? ( net-libs/libssh2 )
139 + )
140 +"
141 +BDEPEND="
142 + virtual/pkgconfig
143 + agent2? (
144 + >=dev-lang/go-1.12
145 + app-arch/unzip
146 + )
147 +"
148 +
149 +# upstream tests fail for agent2
150 +RESTRICT="test"
151 +
152 +PATCHES=(
153 + "${FILESDIR}/${PN}-4.0.18-modulepathfix.patch"
154 + "${FILESDIR}/${PN}-3.0.30-security-disable-PidFile.patch"
155 + "${FILESDIR}/${PN}-5.0.22-system.sw.packages.patch"
156 +)
157 +
158 +S=${WORKDIR}/${MY_P}
159 +
160 +ZABBIXJAVA_BASE="opt/zabbix_java"
161 +
162 +pkg_setup() {
163 + if use oracle; then
164 + if [ -z "${ORACLE_HOME}" ]; then
165 + eerror
166 + eerror "The environment variable ORACLE_HOME must be set"
167 + eerror "and point to the correct location."
168 + eerror "It looks like you don't have Oracle installed."
169 + eerror
170 + die "Environment variable ORACLE_HOME is not set"
171 + fi
172 + fi
173 +
174 + if use frontend; then
175 + webapp_pkg_setup
176 + fi
177 +
178 + java-pkg-opt-2_pkg_setup
179 +}
180 +
181 +src_prepare() {
182 + default
183 +}
184 +
185 +src_configure() {
186 + econf \
187 + $(use_enable agent) \
188 + $(use_enable agent2) \
189 + $(use_enable ipv6) \
190 + $(use_enable java) \
191 + $(use_enable proxy) \
192 + $(use_enable server) \
193 + $(use_enable static) \
194 + $(use_with curl libcurl) \
195 + $(use_with gnutls) \
196 + $(use_with ldap) \
197 + $(use_with libxml2) \
198 + $(use_with mysql) \
199 + $(use_with odbc unixodbc) \
200 + $(use_with openipmi openipmi) \
201 + $(use_with openssl) \
202 + $(use_with oracle) \
203 + $(use_with postgres postgresql) \
204 + $(use_with snmp net-snmp) \
205 + $(use_with sqlite sqlite3) \
206 + $(use_with ssh ssh2)
207 +}
208 +
209 +src_compile() {
210 + if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
211 + emake AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)"
212 + fi
213 +}
214 +
215 +src_install() {
216 + local dirs=(
217 + /etc/zabbix
218 + /var/lib/zabbix
219 + /var/lib/zabbix/home
220 + /var/lib/zabbix/scripts
221 + /var/lib/zabbix/alertscripts
222 + /var/lib/zabbix/externalscripts
223 + /var/log/zabbix
224 + )
225 +
226 + for dir in "${dirs[@]}"; do
227 + dodir "${dir}"
228 + keepdir "${dir}"
229 + done
230 +
231 + if use server; then
232 + insinto /etc/zabbix
233 + doins "${S}"/conf/zabbix_server.conf
234 + fperms 0640 /etc/zabbix/zabbix_server.conf
235 + fowners root:zabbix /etc/zabbix/zabbix_server.conf
236 +
237 + newinitd "${FILESDIR}"/zabbix-server-r1.init zabbix-server
238 +
239 + dosbin src/zabbix_server/zabbix_server
240 +
241 + insinto /usr/share/zabbix
242 + doins -r "${S}"/database/
243 +
244 + systemd_dounit "${FILESDIR}"/zabbix-server.service
245 + newtmpfiles "${FILESDIR}"/zabbix-server.tmpfiles zabbix-server.conf
246 + fi
247 +
248 + if use proxy; then
249 + insinto /etc/zabbix
250 + doins "${S}"/conf/zabbix_proxy.conf
251 + fperms 0640 /etc/zabbix/zabbix_proxy.conf
252 + fowners root:zabbix /etc/zabbix/zabbix_proxy.conf
253 +
254 + newinitd "${FILESDIR}"/zabbix-proxy.init zabbix-proxy
255 +
256 + dosbin src/zabbix_proxy/zabbix_proxy
257 +
258 + insinto /usr/share/zabbix
259 + doins -r "${S}"/database/
260 +
261 + systemd_dounit "${FILESDIR}"/zabbix-proxy.service
262 + newtmpfiles "${FILESDIR}"/zabbix-proxy.tmpfiles zabbix-proxy.conf
263 + fi
264 +
265 + if use agent; then
266 + insinto /etc/zabbix
267 + doins "${S}"/conf/zabbix_agentd.conf
268 + fperms 0640 /etc/zabbix/zabbix_agentd.conf
269 + fowners root:zabbix /etc/zabbix/zabbix_agentd.conf
270 +
271 + newinitd "${FILESDIR}"/zabbix-agentd.init zabbix-agentd
272 +
273 + dosbin src/zabbix_agent/zabbix_agentd
274 + dobin \
275 + src/zabbix_sender/zabbix_sender \
276 + src/zabbix_get/zabbix_get
277 +
278 + systemd_dounit "${FILESDIR}"/zabbix-agentd.service
279 + newtmpfiles "${FILESDIR}"/zabbix-agentd.tmpfiles zabbix-agentd.conf
280 + fi
281 +
282 + if use agent2; then
283 + insinto /etc/zabbix
284 + doins "${S}"/src/go/conf/zabbix_agent2.conf
285 + fperms 0640 /etc/zabbix/zabbix_agent2.conf
286 + fowners root:zabbix /etc/zabbix/zabbix_agent2.conf
287 +
288 + newinitd "${FILESDIR}"/zabbix-agent2.init zabbix-agent2
289 +
290 + dosbin src/go/bin/zabbix_agent2
291 +
292 + systemd_dounit "${FILESDIR}"/zabbix-agent2.service
293 + newtmpfiles "${FILESDIR}"/zabbix-agent2.tmpfiles zabbix-agent2.conf
294 + fi
295 +
296 + fowners root:zabbix /etc/zabbix
297 + fowners zabbix:zabbix \
298 + /var/lib/zabbix \
299 + /var/lib/zabbix/home \
300 + /var/lib/zabbix/scripts \
301 + /var/lib/zabbix/alertscripts \
302 + /var/lib/zabbix/externalscripts \
303 + /var/log/zabbix
304 + fperms 0750 \
305 + /etc/zabbix \
306 + /var/lib/zabbix \
307 + /var/lib/zabbix/home \
308 + /var/lib/zabbix/scripts \
309 + /var/lib/zabbix/alertscripts \
310 + /var/lib/zabbix/externalscripts \
311 + /var/log/zabbix
312 +
313 + dodoc README INSTALL NEWS ChangeLog \
314 + conf/zabbix_agentd.conf \
315 + conf/zabbix_proxy.conf \
316 + conf/zabbix_agentd/userparameter_examples.conf \
317 + conf/zabbix_agentd/userparameter_mysql.conf \
318 + conf/zabbix_server.conf
319 +
320 + if use frontend; then
321 + webapp_src_preinst
322 + cp -R ui/* "${D}/${MY_HTDOCSDIR}"
323 + webapp_configfile \
324 + "${MY_HTDOCSDIR}"/include/db.inc.php \
325 + "${MY_HTDOCSDIR}"/include/config.inc.php
326 + webapp_src_install
327 + fi
328 +
329 + if use java; then
330 + dodir \
331 + /${ZABBIXJAVA_BASE} \
332 + /${ZABBIXJAVA_BASE}/bin \
333 + /${ZABBIXJAVA_BASE}/lib
334 + keepdir /${ZABBIXJAVA_BASE}
335 + exeinto /${ZABBIXJAVA_BASE}/bin
336 + doexe src/zabbix_java/bin/zabbix-java-gateway-${MY_PV}.jar
337 + exeinto /${ZABBIXJAVA_BASE}/lib
338 + doexe \
339 + src/zabbix_java/lib/logback-classic-1.2.9.jar \
340 + src/zabbix_java/lib/logback-console.xml \
341 + src/zabbix_java/lib/logback-core-1.2.9.jar \
342 + src/zabbix_java/lib/logback.xml \
343 + src/zabbix_java/lib/android-json-4.3_r3.1.jar \
344 + src/zabbix_java/lib/slf4j-api-1.7.32.jar
345 + newinitd "${FILESDIR}"/zabbix-jmx-proxy.init zabbix-jmx-proxy
346 + newconfd "${FILESDIR}"/zabbix-jmx-proxy.conf zabbix-jmx-proxy
347 + fi
348 +}
349 +
350 +pkg_postinst() {
351 + if use server || use proxy ; then
352 + elog
353 + elog "You may need to configure your database for Zabbix"
354 + elog "if you have not already done so."
355 + elog
356 +
357 + zabbix_homedir=$(egethome zabbix)
358 + if [ -n "${zabbix_homedir}" ] && \
359 + [ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then
360 + ewarn
361 + ewarn "The user 'zabbix' should have his homedir changed"
362 + ewarn "to /var/lib/zabbix/home if you want to use"
363 + ewarn "custom alert scripts."
364 + ewarn
365 + ewarn "A real homedir might be needed for configfiles"
366 + ewarn "for custom alert scripts."
367 + ewarn
368 + ewarn "To change the homedir use:"
369 + ewarn " usermod -d /var/lib/zabbix/home zabbix"
370 + ewarn
371 + fi
372 + fi
373 +
374 + if use server; then
375 + tmpfiles_process zabbix-server.conf
376 +
377 + elog
378 + elog "For distributed monitoring you have to run:"
379 + elog
380 + elog "zabbix_server -n <nodeid>"
381 + elog
382 + elog "This will convert database data for use with Node ID"
383 + elog "and also adds a local node."
384 + elog
385 + fi
386 +
387 + if use proxy; then
388 + tmpfiles_process zabbix-proxy.conf
389 + fi
390 +
391 + if use agent; then
392 + tmpfiles_process zabbix-agentd.conf
393 + fi
394 +
395 + if use agent2; then
396 + tmpfiles_process zabbix-agent2.conf
397 + fi
398 +
399 + elog "--"
400 + elog
401 + elog "You may need to add these lines to /etc/services:"
402 + elog
403 + elog "zabbix-agent 10050/tcp Zabbix Agent"
404 + elog "zabbix-agent 10050/udp Zabbix Agent"
405 + elog "zabbix-trapper 10051/tcp Zabbix Trapper"
406 + elog "zabbix-trapper 10051/udp Zabbix Trapper"
407 + elog
408 +
409 + if use server || use proxy ; then
410 + # check for fping
411 + fping_perms=$(stat -c %a /usr/sbin/fping 2>/dev/null)
412 + case "${fping_perms}" in
413 + 4[157][157][157])
414 + ;;
415 + *)
416 + ewarn
417 + ewarn "If you want to use the checks 'icmpping' and 'icmppingsec',"
418 + ewarn "you have to make /usr/sbin/fping setuid root and executable"
419 + ewarn "by everyone. Run the following command to fix it:"
420 + ewarn
421 + ewarn " chmod u=rwsx,g=rx,o=rx /usr/sbin/fping"
422 + ewarn
423 + ewarn "Please be aware that this might impose a security risk,"
424 + ewarn "depending on the code quality of fping."
425 + ewarn
426 + ;;
427 + esac
428 + fi
429 +}
430 +
431 +pkg_prerm() {
432 + (use frontend || use server) && webapp_pkg_prerm
433 +}