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: Fri, 01 Jul 2022 10:17:19
Message-Id: 1656670498.e85fb42a0168cf2b808a27d89125915a498e8993.fordfrog@gentoo
1 commit: e85fb42a0168cf2b808a27d89125915a498e8993
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jul 1 10:14:58 2022 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 1 10:14:58 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e85fb42a
7
8 net-analyzer/zabbix: bump to 5.0.25
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.25.ebuild | 398 +++++++++++++++++++++++++++++++
14 2 files changed, 400 insertions(+)
15
16 diff --git a/net-analyzer/zabbix/Manifest b/net-analyzer/zabbix/Manifest
17 index f05799fa1e10..db6a8661a078 100644
18 --- a/net-analyzer/zabbix/Manifest
19 +++ b/net-analyzer/zabbix/Manifest
20 @@ -4,6 +4,8 @@ DIST zabbix-5.0.22-go-deps.tar.xz 34395200 BLAKE2B 3065878d5d61617f52ec48381a248
21 DIST zabbix-5.0.22.tar.gz 21245241 BLAKE2B d2343fc5dbc4112ef77c75bd00b8344a363a8e2acc6623a009ebd24d7116377a66d2ca94f22dee386fbee1fa9822ce7e08287cb1336fe939bd2b621fe57b5b1f SHA512 d326ed5dd81b44adf80e8cc01d32b3b7ebed0b8ffddc2870e76ffcd010513f2b2bbe4586681e5c5ab5202f88c7861078efad537bb852ee52d5c00b7712cc2aab
22 DIST zabbix-5.0.24-go-deps.tar.xz 34371892 BLAKE2B 273978d3a4dd46e4d41d892f3217ae2ee0d2bfe9bed753283b5fdf3a13e6cb8f912a4726b92cc2637cb8103c63141f24d3c49c884f54598a9c4d99bed3830552 SHA512 bfafb96c6d69ad2c775add9392117c384a633b334ad447e1ec61cf6f01bd72ded0870d778650ff18a912f6ca3bc98f581052464353b22350eaf724bddc29f8d8
23 DIST zabbix-5.0.24.tar.gz 21296805 BLAKE2B 16c3fe6ef0732d627c70555b80961308ba9049978efc51c44162e5ceb940369ce36f87f33e6725de789c97d29edb2d0b4c2b2e58ac56a95e1b644cff13d2f64b SHA512 5ad70fdd189ce2630c019df6edad70fbfa7d2b0f72b42ae1950fb844f3edadf87c3108eefa7f3d343d4c3464d8aa58036dfbcab4109682d40b455788019dd62b
24 +DIST zabbix-5.0.25-go-deps.tar.xz 34381664 BLAKE2B 2da35cac59efe069587ad8217385cd276be340e9f0c37483c1a3aa500b03e0139122ca75437a1646fdb3d26ff7a824160d663cff758cf0a91fb08252606640ac SHA512 625f0cdde87cff17bfb2e348a03ffab5374a5d7657c1510abeda5e0a313658625eda946474bc7b7bf7a778d8cf0b498215f9e26ee2c72c6456e87065071ec0ac
25 +DIST zabbix-5.0.25.tar.gz 21300141 BLAKE2B 271d10a051b08d5d172d312b48a077e600856cef954201b0c11b1b4e96c70681ebe82e382893689199f6567922ed2e08b3bb534b77ccf1eed099049ccf45002e SHA512 b66776f2ceaaef7c3b74cb47b99d96dcdb614cdae2f54d096046c2aeeb82c8c9c65ca17c95773551bfa867113ca36b29acb72a9102f0ccef930c16f0a4997774
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.25.ebuild b/net-analyzer/zabbix/zabbix-5.0.25.ebuild
31 new file mode 100644
32 index 000000000000..d3c97bb80618
33 --- /dev/null
34 +++ b/net-analyzer/zabbix/zabbix-5.0.25.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 +}