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: Tue, 29 Nov 2022 13:08:20
Message-Id: 1669727285.4aeea2f9ed74a66c2fd0a6cb3d501b8c66b3d9d3.fordfrog@gentoo
1 commit: 4aeea2f9ed74a66c2fd0a6cb3d501b8c66b3d9d3
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 29 13:08:05 2022 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 29 13:08:05 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4aeea2f9
7
8 net-analyzer/zabbix: bump to 6.0.11
9
10 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
11
12 net-analyzer/zabbix/Manifest | 2 +
13 net-analyzer/zabbix/zabbix-6.0.11.ebuild | 411 +++++++++++++++++++++++++++++++
14 2 files changed, 413 insertions(+)
15
16 diff --git a/net-analyzer/zabbix/Manifest b/net-analyzer/zabbix/Manifest
17 index 3d580b0b27ee..29225da7526e 100644
18 --- a/net-analyzer/zabbix/Manifest
19 +++ b/net-analyzer/zabbix/Manifest
20 @@ -5,6 +5,8 @@ DIST zabbix-5.0.29-go-deps.tar.xz 34421032 BLAKE2B 35809df9e2d9186813ec079d31206
21 DIST zabbix-5.0.29.tar.gz 21471836 BLAKE2B e38f3b7c38900d80ca0497326f9979e793d04fd34d716673e76ea65723e0019caa7e1e92e581ac6423f77a2fff7554250c728721c125596b1c9a17b0c860346b SHA512 60e707d79ee9f92b69aecabc97e92ad04d0d66839ceed250788f111db4128a66197b9c528bde8cb4f4f92e6a5502ff31c6d838e3c1d3b81ce6b7910879915b61
22 DIST zabbix-6.0.10-go-deps.tar.xz 27482516 BLAKE2B 64b9f2d093aaa8b7b1b39d4736f9b087fdcc518b1a5eced7a46bfe5a1ea2c1bc2d3641ab8e61d4fca8f036a8a96d8c8b56fe9dab17b356b8c5e507f77f10b864 SHA512 15b4799d8934155112469f4a571b8f015a0779b7c946a49cebb4b513ff7553989cd71704e403ae3fdf18646235fc40daf14bb9481d493ad8e6b53146fd7f3f27
23 DIST zabbix-6.0.10.tar.gz 39516402 BLAKE2B 00e81dcea63433cb93ef9bd77094bef89f7d604d8c07b9da5959c79d54f026b1256f486395229e0232aa96271b72fd9f3c67e08dfb96321be398b8b4fa832f6f SHA512 4fc70d89f61f50e5a6b9bbd1a25d9cac6d734872d3558df83b01abe04832773cdbab6e0f214045c117b6e2fcd7ae3fba08701be942cf18344e6b5a78151665d6
24 +DIST zabbix-6.0.11-go-deps.tar.xz 27480580 BLAKE2B 443ecbd9fd0d66cacc75f53d5f56ae996bce52e04827de97948ffc6a3e02888b4b5122eba2425465624e34bc628992f7a520bc8e0281444baed0aa1631f3bec1 SHA512 0936626b658f1811e8aebdd59ca506b33f1a95696018b088cfe04479386ecbcfe4c6c7fac6d26487e28d36cb6283028312c3bc2d27bde8cf54698236d3bc6ba4
25 +DIST zabbix-6.0.11.tar.gz 40388383 BLAKE2B e6ded007285aac58bb4c29075ac8d34f6ab0db1a74702269b63dc8772ebdf8b2986737fa91d39c9e8bacee5e1e12d7d7bb9580221f9b4917cbc829784639201d SHA512 decb9fcf5de8f0d81cd0b16b6a5e341742c97baed0faf2d5f22bba98fd9fad4e154360724b5aedc378d5b5e2c64eda36f308e3eb6e6f8e80a5cf082ea95ebef6
26 DIST zabbix-6.0.9-go-deps.tar.xz 35300488 BLAKE2B 7a516774f812e41a8640a68de11fb2f9e8e4d1da90d3c7a76807b25025ab32400e3c9efff7818ed90868da2d753c61e0f03126df0f7661cd440b1b59dc216217 SHA512 0f2c1e79b4b894384c9c09056242ccec732ffe49e80a6167748da4671e6f869486c1be70a83f09beaef356cfde4ec1b1a34ce2c5b122a0f19f351a82614d1389
27 DIST zabbix-6.0.9.tar.gz 34515806 BLAKE2B c9b5a432ede5fc5307c30ee1c1f986cb1cb8f0351a46f9f0ee9add2c5d86a9b96ed933d2c6801022451cc8b52babc54deba8ba2478d90136a12798728f83366f SHA512 20211e2eab47d03a5de221f3a466aaff24c01b868208d4cbd7a10a16a10cd20172f009842c631169962c06e13ca8b0c6f0b6bd3cfd060b68b59f95a136a2e207
28 DIST zabbix-6.2.3-go-deps.tar.xz 35349056 BLAKE2B 1548167558be12e7519e59e011eb6e761a0a5e1625fb460bbf3106ca5a895277789ce4b2f649884ebb0f236997771378ea47919f3e6fb6a4f4908a29ef34385e SHA512 a8934a5bb2367395c1ba6bf7ccd830c951fb585e7dc054d29f2667bfc45d18eed13889f4c31f8f417aba1920df06512e927c77975f70ab419e7525768caece7f
29
30 diff --git a/net-analyzer/zabbix/zabbix-6.0.11.ebuild b/net-analyzer/zabbix/zabbix-6.0.11.ebuild
31 new file mode 100644
32 index 000000000000..4b12b01e37ea
33 --- /dev/null
34 +++ b/net-analyzer/zabbix/zabbix-6.0.11.ebuild
35 @@ -0,0 +1,411 @@
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 +pcre2 +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 + !pcre2? ( dev-libs/libpcre )
106 + pcre2? ( dev-libs/libpcre2:= )
107 + net-analyzer/fping[suid]
108 + )
109 + server? (
110 + app-admin/webapp-config
111 + !pcre2? ( dev-libs/libpcre )
112 + pcre2? ( dev-libs/libpcre2:= )
113 + net-analyzer/fping[suid]
114 + )
115 + frontend? (
116 + app-admin/webapp-config
117 + dev-lang/php:*[bcmath,ctype,sockets,gd,truetype,xml,session,xmlreader,xmlwriter,nls,sysvipc,unicode]
118 + media-libs/gd[png]
119 + virtual/httpd-php:*
120 + mysql? ( dev-lang/php[mysqli] )
121 + odbc? ( dev-lang/php[odbc] )
122 + oracle? ( dev-lang/php[oci8-instant-client] )
123 + postgres? ( dev-lang/php[postgres] )
124 + sqlite? ( dev-lang/php[sqlite] )
125 + )
126 +"
127 +DEPEND="${COMMON_DEPEND}
128 + static? (
129 + curl? ( net-misc/curl[static-libs] )
130 + ldap? (
131 + =dev-libs/cyrus-sasl-2*[static-libs]
132 + net-libs/gnutls[static-libs]
133 + net-nds/openldap[static-libs]
134 + )
135 + libxml2? ( dev-libs/libxml2[static-libs] )
136 + mysql? ( dev-db/mysql-connector-c[static-libs] )
137 + odbc? ( dev-db/unixODBC[static-libs] )
138 + postgres? ( dev-db/postgresql:*[static-libs] )
139 + sqlite? ( dev-db/sqlite[static-libs] )
140 + ssh? ( net-libs/libssh2 )
141 + )
142 +"
143 +BDEPEND="
144 + virtual/pkgconfig
145 + agent2? (
146 + >=dev-lang/go-1.12
147 + app-arch/unzip
148 + )
149 +"
150 +
151 +# upstream tests fail for agent2
152 +RESTRICT="test"
153 +
154 +PATCHES=(
155 + "${FILESDIR}/${PN}-4.0.18-modulepathfix.patch"
156 + "${FILESDIR}/${PN}-3.0.30-security-disable-PidFile.patch"
157 + "${FILESDIR}/${PN}-6.0.3-system.sw.packages.patch"
158 +)
159 +
160 +S=${WORKDIR}/${MY_P}
161 +
162 +ZABBIXJAVA_BASE="opt/zabbix_java"
163 +
164 +pkg_setup() {
165 + if use oracle; then
166 + if [ -z "${ORACLE_HOME}" ]; then
167 + eerror
168 + eerror "The environment variable ORACLE_HOME must be set"
169 + eerror "and point to the correct location."
170 + eerror "It looks like you don't have Oracle installed."
171 + eerror
172 + die "Environment variable ORACLE_HOME is not set"
173 + fi
174 + fi
175 +
176 + if use frontend; then
177 + webapp_pkg_setup
178 + fi
179 +
180 + java-pkg-opt-2_pkg_setup
181 +}
182 +
183 +src_configure() {
184 + local econf_args=(
185 + "$(use_enable agent)"
186 + "$(use_enable agent2)"
187 + "$(use_enable ipv6)"
188 + "$(use_enable java)"
189 + "$(use_enable proxy)"
190 + "$(use_enable server)"
191 + "$(use_enable static)"
192 + "$(use_with curl libcurl)"
193 + "$(use_with gnutls)"
194 + "$(use_with ldap)"
195 + "$(use_with libxml2)"
196 + "$(use_with mysql)"
197 + "$(use_with odbc unixodbc)"
198 + "$(use_with openipmi openipmi)"
199 + "$(use_with openssl)"
200 + "$(use_with oracle)"
201 + "$(use_with postgres postgresql)"
202 + "$(use_with snmp net-snmp)"
203 + "$(use_with sqlite sqlite3)"
204 + "$(use_with ssh ssh2)"
205 + )
206 +
207 + if use pcre2; then
208 + econf_args+=( --with-libpcre2 )
209 + else
210 + # If pcre2 is not enabled, then use the old pcre library.
211 + econf_args+=( --with-libpcre )
212 + fi
213 +
214 + econf ${econf_args[@]}
215 +}
216 +
217 +src_compile() {
218 + if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
219 + emake AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)"
220 + fi
221 +}
222 +
223 +src_install() {
224 + local dirs=(
225 + /etc/zabbix
226 + /var/lib/zabbix
227 + /var/lib/zabbix/home
228 + /var/lib/zabbix/scripts
229 + /var/lib/zabbix/alertscripts
230 + /var/lib/zabbix/externalscripts
231 + /var/log/zabbix
232 + )
233 +
234 + for dir in "${dirs[@]}"; do
235 + keepdir "${dir}"
236 + done
237 +
238 + if use server; then
239 + insinto /etc/zabbix
240 + doins "${S}"/conf/zabbix_server.conf
241 + fperms 0640 /etc/zabbix/zabbix_server.conf
242 + fowners root:zabbix /etc/zabbix/zabbix_server.conf
243 +
244 + newinitd "${FILESDIR}"/zabbix-server-r1.init zabbix-server
245 +
246 + dosbin src/zabbix_server/zabbix_server
247 +
248 + insinto /usr/share/zabbix
249 + doins -r "${S}"/database/
250 +
251 + systemd_dounit "${FILESDIR}"/zabbix-server.service
252 + newtmpfiles "${FILESDIR}"/zabbix-server.tmpfiles zabbix-server.conf
253 + fi
254 +
255 + if use proxy; then
256 + insinto /etc/zabbix
257 + doins "${S}"/conf/zabbix_proxy.conf
258 + fperms 0640 /etc/zabbix/zabbix_proxy.conf
259 + fowners root:zabbix /etc/zabbix/zabbix_proxy.conf
260 +
261 + newinitd "${FILESDIR}"/zabbix-proxy.init zabbix-proxy
262 +
263 + dosbin src/zabbix_proxy/zabbix_proxy
264 +
265 + insinto /usr/share/zabbix
266 + doins -r "${S}"/database/
267 +
268 + systemd_dounit "${FILESDIR}"/zabbix-proxy.service
269 + newtmpfiles "${FILESDIR}"/zabbix-proxy.tmpfiles zabbix-proxy.conf
270 + fi
271 +
272 + if use agent; then
273 + insinto /etc/zabbix
274 + doins "${S}"/conf/zabbix_agentd.conf
275 + fperms 0640 /etc/zabbix/zabbix_agentd.conf
276 + fowners root:zabbix /etc/zabbix/zabbix_agentd.conf
277 +
278 + newinitd "${FILESDIR}"/zabbix-agentd.init zabbix-agentd
279 +
280 + dosbin src/zabbix_agent/zabbix_agentd
281 + dobin \
282 + src/zabbix_sender/zabbix_sender \
283 + src/zabbix_get/zabbix_get
284 +
285 + systemd_dounit "${FILESDIR}"/zabbix-agentd.service
286 + newtmpfiles "${FILESDIR}"/zabbix-agentd.tmpfiles zabbix-agentd.conf
287 + fi
288 + if use agent2; then
289 + insinto /etc/zabbix
290 + doins "${S}"/src/go/conf/zabbix_agent2.conf
291 + fperms 0640 /etc/zabbix/zabbix_agent2.conf
292 + fowners root:zabbix /etc/zabbix/zabbix_agent2.conf
293 + keepdir /etc/zabbix/zabbix_agent2.d/plugins.d
294 +
295 + newinitd "${FILESDIR}"/zabbix-agent2.init zabbix-agent2
296 +
297 + dosbin src/go/bin/zabbix_agent2
298 +
299 + systemd_dounit "${FILESDIR}"/zabbix-agent2.service
300 + newtmpfiles "${FILESDIR}"/zabbix-agent2.tmpfiles zabbix-agent2.conf
301 + fi
302 +
303 + fowners root:zabbix /etc/zabbix
304 + fowners zabbix:zabbix \
305 + /var/lib/zabbix \
306 + /var/lib/zabbix/home \
307 + /var/lib/zabbix/scripts \
308 + /var/lib/zabbix/alertscripts \
309 + /var/lib/zabbix/externalscripts \
310 + /var/log/zabbix
311 + fperms 0750 \
312 + /etc/zabbix \
313 + /var/lib/zabbix \
314 + /var/lib/zabbix/home \
315 + /var/lib/zabbix/scripts \
316 + /var/lib/zabbix/alertscripts \
317 + /var/lib/zabbix/externalscripts \
318 + /var/log/zabbix
319 +
320 + dodoc README INSTALL NEWS ChangeLog \
321 + conf/zabbix_agentd.conf \
322 + conf/zabbix_proxy.conf \
323 + conf/zabbix_agentd/userparameter_examples.conf \
324 + conf/zabbix_agentd/userparameter_mysql.conf \
325 + conf/zabbix_server.conf
326 +
327 + if use frontend; then
328 + webapp_src_preinst
329 + cp -R ui/* "${D}/${MY_HTDOCSDIR}"
330 + webapp_configfile \
331 + "${MY_HTDOCSDIR}"/include/db.inc.php \
332 + "${MY_HTDOCSDIR}"/include/config.inc.php
333 + webapp_src_install
334 + fi
335 +
336 + if use java; then
337 + dodir \
338 + /${ZABBIXJAVA_BASE} \
339 + /${ZABBIXJAVA_BASE}/bin \
340 + /${ZABBIXJAVA_BASE}/lib
341 + keepdir /${ZABBIXJAVA_BASE}
342 + exeinto /${ZABBIXJAVA_BASE}/bin
343 + doexe src/zabbix_java/bin/zabbix-java-gateway-"${MY_PV}".jar
344 + exeinto /${ZABBIXJAVA_BASE}/lib
345 + doexe \
346 + src/zabbix_java/lib/logback-classic-1.2.9.jar \
347 + src/zabbix_java/lib/logback-console.xml \
348 + src/zabbix_java/lib/logback-core-1.2.9.jar \
349 + src/zabbix_java/lib/logback.xml \
350 + src/zabbix_java/lib/android-json-4.3_r3.1.jar \
351 + src/zabbix_java/lib/slf4j-api-1.7.32.jar
352 + newinitd "${FILESDIR}"/zabbix-jmx-proxy.init zabbix-jmx-proxy
353 + newconfd "${FILESDIR}"/zabbix-jmx-proxy.conf zabbix-jmx-proxy
354 + fi
355 +}
356 +
357 +pkg_postinst() {
358 + if use server || use proxy ; then
359 + elog
360 + elog "You may need to configure your database for Zabbix"
361 + elog "if you have not already done so."
362 + elog
363 +
364 + zabbix_homedir=$(egethome zabbix)
365 + if [ -n "${zabbix_homedir}" ] && \
366 + [ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then
367 + ewarn
368 + ewarn "The user 'zabbix' should have his homedir changed"
369 + ewarn "to /var/lib/zabbix/home if you want to use"
370 + ewarn "custom alert scripts."
371 + ewarn
372 + ewarn "A real homedir might be needed for configfiles"
373 + ewarn "for custom alert scripts."
374 + ewarn
375 + ewarn "To change the homedir use:"
376 + ewarn " usermod -d /var/lib/zabbix/home zabbix"
377 + ewarn
378 + fi
379 + fi
380 +
381 + if use server; then
382 + tmpfiles_process zabbix-server.conf
383 +
384 + elog
385 + elog "For distributed monitoring you have to run:"
386 + elog
387 + elog "zabbix_server -n <nodeid>"
388 + elog
389 + elog "This will convert database data for use with Node ID"
390 + elog "and also adds a local node."
391 + elog
392 +
393 + if ! use pcre2; then
394 + ewarn "You are using zabbix with dev-libs/libpcre which is deprecated."
395 + ewarn "Consider switching to dev-libs/libpcre2 (USE=pcre2) as soon as possible."
396 + ewarn "See https://www.zabbix.com/documentation/6.0/en/manual/installation/upgrade_notes_600#pcre2-support"
397 + fi
398 + fi
399 +
400 + if use proxy; then
401 + tmpfiles_process zabbix-proxy.conf
402 + fi
403 +
404 + if use agent; then
405 + tmpfiles_process zabbix-agentd.conf
406 + fi
407 +
408 + if use agent2; then
409 + tmpfiles_process zabbix-agent2.conf
410 + fi
411 +
412 + elog "--"
413 + elog
414 + elog "You may need to add these lines to /etc/services:"
415 + elog
416 + elog "zabbix-agent 10050/tcp Zabbix Agent"
417 + elog "zabbix-agent 10050/udp Zabbix Agent"
418 + elog "zabbix-trapper 10051/tcp Zabbix Trapper"
419 + elog "zabbix-trapper 10051/udp Zabbix Trapper"
420 + elog
421 +
422 + if use server || use proxy ; then
423 + # check for fping
424 + fping_perms=$(stat -c %a /usr/sbin/fping 2>/dev/null)
425 + case "${fping_perms}" in
426 + 4[157][157][157])
427 + ;;
428 + *)
429 + ewarn
430 + ewarn "If you want to use the checks 'icmpping' and 'icmppingsec',"
431 + ewarn "you have to make /usr/sbin/fping setuid root and executable"
432 + ewarn "by everyone. Run the following command to fix it:"
433 + ewarn
434 + ewarn " chmod u=rwsx,g=rx,o=rx /usr/sbin/fping"
435 + ewarn
436 + ewarn "Please be aware that this might impose a security risk,"
437 + ewarn "depending on the code quality of fping."
438 + ewarn
439 + ;;
440 + esac
441 + fi
442 +}
443 +
444 +pkg_prerm() {
445 + (use frontend || use server) && webapp_pkg_prerm
446 +}