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