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:11:51
Message-Id: 1669727501.ba9f596cfa89694628efc42d56cf7f562876bb71.fordfrog@gentoo
1 commit: ba9f596cfa89694628efc42d56cf7f562876bb71
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 29 13:11:41 2022 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 29 13:11:41 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba9f596c
7
8 net-analyzer/zabbix: bump to 5.0.30
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.30.ebuild | 398 +++++++++++++++++++++++++++++++
14 2 files changed, 400 insertions(+)
15
16 diff --git a/net-analyzer/zabbix/Manifest b/net-analyzer/zabbix/Manifest
17 index 29225da7526e..6e6cf345db10 100644
18 --- a/net-analyzer/zabbix/Manifest
19 +++ b/net-analyzer/zabbix/Manifest
20 @@ -3,6 +3,8 @@ DIST zabbix-5.0.28-go-deps.tar.xz 34382032 BLAKE2B 09d5ba3e81bef941b09907d3bad75
21 DIST zabbix-5.0.28.tar.gz 21453968 BLAKE2B aa4c94ee43d986897694a9a27cfd2a5cb2aa23678e8eeb1df9b7c7198d480a2543203dda6a81b316ed3a5c80d87ea51c8160f268525e3b7e96d2087f332c4f7e SHA512 9f47205997bf2e7326dc7a7e04d352174dbc1c69fb1b34fdcbc10325ec0a3b70bf5c27373e6276e657f9a88a6d62f413e64612decf93eb53870471e53f2b6925
22 DIST zabbix-5.0.29-go-deps.tar.xz 34421032 BLAKE2B 35809df9e2d9186813ec079d31206bccd8e4bf6da0376e1e87a65ccb17345bc3f8e81820cbad7700ab2596ede4fe604867337b89d74ac3254eeccacc128a4708 SHA512 6553612cc1b7a01cd6b43378f7a5e15fd99245ecc23d1345a0a780ba506073ac2b8b68e96599f56ea7a01052d74b14f6e2f29ca9a97d71748fe285583531f82d
23 DIST zabbix-5.0.29.tar.gz 21471836 BLAKE2B e38f3b7c38900d80ca0497326f9979e793d04fd34d716673e76ea65723e0019caa7e1e92e581ac6423f77a2fff7554250c728721c125596b1c9a17b0c860346b SHA512 60e707d79ee9f92b69aecabc97e92ad04d0d66839ceed250788f111db4128a66197b9c528bde8cb4f4f92e6a5502ff31c6d838e3c1d3b81ce6b7910879915b61
24 +DIST zabbix-5.0.30-go-deps.tar.xz 34398308 BLAKE2B f987ec0518a070d9480be7a57a8101f6c65f89ff0cdf513cb19b5d79e88c410782df87e732c7d838e6db6dd933cc855c027fc8351855121a57e0a2912ed0bda2 SHA512 eb1ad8c3983e475229887a2561f6e55ed3a4c1be270221fc12c0d0fcba7f2ad661f984f16f5f5d9684496c35c6daebd93dd13f5e898244af90d9ad9bffb911c6
25 +DIST zabbix-5.0.30.tar.gz 21505195 BLAKE2B e6876b896e61feccdcfa05a9bc2ae57345957e8e4dc2e2c3d635e917cc525c9cf4dad5e45821e6677f766654bd702b8baac8b65a4fc286af816fbf2b2e076a0c SHA512 2f744fc1ba42ea0602cc90c91342f531c55cb1f76eda47c6e928e74dc595f7bd885f69abb52c6eb1b20e65bd6c3c46c299d6cfee2c3442db137561060386a31e
26 DIST zabbix-6.0.10-go-deps.tar.xz 27482516 BLAKE2B 64b9f2d093aaa8b7b1b39d4736f9b087fdcc518b1a5eced7a46bfe5a1ea2c1bc2d3641ab8e61d4fca8f036a8a96d8c8b56fe9dab17b356b8c5e507f77f10b864 SHA512 15b4799d8934155112469f4a571b8f015a0779b7c946a49cebb4b513ff7553989cd71704e403ae3fdf18646235fc40daf14bb9481d493ad8e6b53146fd7f3f27
27 DIST zabbix-6.0.10.tar.gz 39516402 BLAKE2B 00e81dcea63433cb93ef9bd77094bef89f7d604d8c07b9da5959c79d54f026b1256f486395229e0232aa96271b72fd9f3c67e08dfb96321be398b8b4fa832f6f SHA512 4fc70d89f61f50e5a6b9bbd1a25d9cac6d734872d3558df83b01abe04832773cdbab6e0f214045c117b6e2fcd7ae3fba08701be942cf18344e6b5a78151665d6
28 DIST zabbix-6.0.11-go-deps.tar.xz 27480580 BLAKE2B 443ecbd9fd0d66cacc75f53d5f56ae996bce52e04827de97948ffc6a3e02888b4b5122eba2425465624e34bc628992f7a520bc8e0281444baed0aa1631f3bec1 SHA512 0936626b658f1811e8aebdd59ca506b33f1a95696018b088cfe04479386ecbcfe4c6c7fac6d26487e28d36cb6283028312c3bc2d27bde8cf54698236d3bc6ba4
29
30 diff --git a/net-analyzer/zabbix/zabbix-5.0.30.ebuild b/net-analyzer/zabbix/zabbix-5.0.30.ebuild
31 new file mode 100644
32 index 000000000000..d3c97bb80618
33 --- /dev/null
34 +++ b/net-analyzer/zabbix/zabbix-5.0.30.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 +}