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