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, 24 Dec 2021 09:40:22
Message-Id: 1640338807.e3bb4c2aad8ccef0ba5f21082d371a47119c6332.fordfrog@gentoo
1 commit: e3bb4c2aad8ccef0ba5f21082d371a47119c6332
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Fri Dec 24 09:40:07 2021 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Fri Dec 24 09:40:07 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e3bb4c2a
7
8 net-analyzer/zabbix: bump to 4.0.37
9
10 Package-Manager: Portage-3.0.30, Repoman-3.0.3
11 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
12
13 net-analyzer/zabbix/Manifest | 1 +
14 net-analyzer/zabbix/zabbix-4.0.37.ebuild | 366 +++++++++++++++++++++++++++++++
15 2 files changed, 367 insertions(+)
16
17 diff --git a/net-analyzer/zabbix/Manifest b/net-analyzer/zabbix/Manifest
18 index a6e2050d34a3..030463f8d622 100644
19 --- a/net-analyzer/zabbix/Manifest
20 +++ b/net-analyzer/zabbix/Manifest
21 @@ -238,6 +238,7 @@ DIST gopkg.in%2Fyaml.v2%2F@v%2Fv2.2.8.zip 80666 BLAKE2B ff3645b71cedd41b9fef6e5d
22 DIST honnef.co%2Fgo%2Ftools%2F@v%2Fv0.0.1-2019.2.3.mod 300 BLAKE2B 3e3f5a2be0918cbaacd5e43e59fcc6c7c6999645f0c9214cd5a522c31d34b6d3dad61e3ddae8ccdb2f3f0d90b406c047802ee3d9d54dc40fe6eff9cd35620792 SHA512 0c8aa788d0c03d6d049f0dd7468d0f81ce2131ccedd5a5a3a18362b7d30eef7ef325277844eefe4b707b1ad71c6f83a44e110b7af7b98e05406d347237a7bafb
23 DIST zabbix-4.0.35.tar.gz 17619679 BLAKE2B df90b7479ebb8ad706b090e25aca59448a90dd41aca154457ce7efd46b783a6802cd64594848cb87cf93b750b162e3cebf521db226572c864604e6b0f592cac6 SHA512 ec8956a7849fd861c1f01bef476bd9db315ca4909b7224b9740055202df5e76a8fe317e916034f8bbbe7bacd7daa434ce26c0b810b1fef809927ac7afba52268
24 DIST zabbix-4.0.36.tar.gz 17619115 BLAKE2B e64cc78c589cf42dd72e20be18a723fbcce8890de0ccf48d2328b744533c3a9b8d4cb7dd93b5e7b4f7f31c724b2aa797a70d5e6eb8db53ece9ad9a39edae4fb4 SHA512 39ff2a58ea189b75891bf59ebb0e4d85c97595f9754684622f4d3e3f5614ca38408ecf10e62c4055dc1bde3fbca621e41152bb7006c539fb88ca40b1969c49d2
25 +DIST zabbix-4.0.37.tar.gz 17552391 BLAKE2B c5f3b200e8dda2b4a961a78a3ba8cd97a6e07744c4e16acde3a740559cb70649660b5652d36cf42e87f28d03e14803c4efe9e585583834f7a765fcbf0e5953b9 SHA512 007e7664a6fe1e9b3e76f95c5cfdb9744a27139d243b6fcb78c2e84f01ccdc788130f824514d29f1557724761557e459924d22cb33bb35fe740b5fdc6746ef0e
26 DIST zabbix-5.0.17.tar.gz 21326776 BLAKE2B fbf0af5bfd98c0e1a9a39799adb5ae4837278909065d4a2aef914052dd66d893063c1ea1b1c90b53833fec900e7dd0d3c3af4548cf432a488ece07a676f4eca6 SHA512 f7a23b51c3d2fb5f80ec888dc9eaf592dd13de3a61b9d065e6d54e1bb406e18ffef1b8e9d3ef516b2034d94fb7330bd80c2cb7b7d22eed7e57021bc66e1ee159
27 DIST zabbix-5.0.18.tar.gz 21377940 BLAKE2B 4143dd2b5c4b04795e2f1b43637e541e3108abd19b489cf720b8256cc3d992bc20e2693846ee53d138df22b1404f6cc86dcb22f1e0805dda444172f18f1c48a7 SHA512 84a6684e413bd9180bab3e19a286c5113e41dab036fe76cded4a7ffeb931314648260c5e379ddea07cfb5a95b05e630a4c5952b5f96cfe03a5022e61f6da8095
28 DIST zabbix-5.0.19.tar.gz 21367685 BLAKE2B 4e6b52d4ace766f700894d1eb6c7adf8e13ac72fe2534a48625302ffa6aea02734f8e81ee781a1d1aa0e6e375428919609edfca6094f17912123a7ed96e22af0 SHA512 b7223c656f8830e302ccc6321ff19e580eed199355ca9070ac2b59375e0794d17de1dfa4e1600ef6ac5a72e8abd2b80191b2f58fa77f25096dee52e6e40940b9
29
30 diff --git a/net-analyzer/zabbix/zabbix-4.0.37.ebuild b/net-analyzer/zabbix/zabbix-4.0.37.ebuild
31 new file mode 100644
32 index 000000000000..d3edede455f2
33 --- /dev/null
34 +++ b/net-analyzer/zabbix/zabbix-4.0.37.ebuild
35 @@ -0,0 +1,366 @@
36 +# Copyright 1999-2021 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=7
40 +
41 +# needed to make webapp-config dep optional
42 +WEBAPP_OPTIONAL="yes"
43 +inherit webapp java-pkg-opt-2 systemd toolchain-funcs tmpfiles user-info
44 +
45 +DESCRIPTION="ZABBIX is software for monitoring of your applications, network and servers"
46 +HOMEPAGE="https://www.zabbix.com/"
47 +MY_P=${P/_/}
48 +MY_PV=${PV/_/}
49 +SRC_URI="https://cdn.zabbix.com/${PN}/sources/stable/4.0/${P}.tar.gz"
50 +LICENSE="GPL-2"
51 +SLOT="0/$(ver_cut 1-2)"
52 +WEBAPP_MANUAL_SLOT="yes"
53 +KEYWORDS="~amd64 ~x86"
54 +IUSE="+agent curl frontend gnutls ipv6 java ldap libxml2 mbedtls mysql odbc openipmi +openssl oracle +postgres proxy server snmp sqlite ssh ssl static xmpp"
55 +REQUIRED_USE="|| ( agent frontend proxy server )
56 + ssl? ( ^^ ( gnutls mbedtls openssl ) )
57 + proxy? ( ^^ ( mysql oracle postgres sqlite ) )
58 + server? ( ^^ ( mysql oracle postgres ) !sqlite )
59 + static? ( !oracle !snmp )"
60 +
61 +COMMON_DEPEND="
62 + curl? ( net-misc/curl )
63 + java? ( >=virtual/jdk-1.8:* )
64 + ldap? (
65 + =dev-libs/cyrus-sasl-2*
66 + net-libs/gnutls
67 + net-nds/openldap
68 + )
69 + libxml2? ( dev-libs/libxml2 )
70 + mysql? ( dev-db/mysql-connector-c )
71 + odbc? ( dev-db/unixODBC )
72 + openipmi? ( sys-libs/openipmi )
73 + oracle? ( dev-db/oracle-instantclient-basic )
74 + postgres? ( dev-db/postgresql:* )
75 + proxy? ( sys-libs/zlib )
76 + server? (
77 + dev-libs/libevent
78 + sys-libs/zlib
79 + )
80 + snmp? ( net-analyzer/net-snmp )
81 + sqlite? ( dev-db/sqlite )
82 + ssh? ( net-libs/libssh2 )
83 + ssl? (
84 + gnutls? ( net-libs/gnutls:0= )
85 + mbedtls? ( net-libs/mbedtls:0= )
86 + openssl? ( dev-libs/openssl:=[-bindist(-)] )
87 + )
88 + xmpp? ( dev-libs/iksemel )
89 +"
90 +
91 +RDEPEND="${COMMON_DEPEND}
92 + acct-group/zabbix
93 + acct-user/zabbix
94 + java? ( >=virtual/jre-1.8:* )
95 + mysql? ( virtual/mysql )
96 + proxy? ( net-analyzer/fping[suid] )
97 + server? (
98 + app-admin/webapp-config
99 + dev-libs/libevent
100 + dev-libs/libpcre
101 + net-analyzer/fping[suid]
102 + )
103 + frontend? (
104 + app-admin/webapp-config
105 + dev-lang/php:*[bcmath,ctype,sockets,gd,truetype,xml,session,xmlreader,xmlwriter,nls,sysvipc,unicode]
106 + media-libs/gd[png]
107 + virtual/httpd-php:*
108 + mysql? ( dev-lang/php[mysqli] )
109 + odbc? ( dev-lang/php[odbc] )
110 + oracle? ( dev-lang/php[oci8-instant-client] )
111 + postgres? ( dev-lang/php[postgres] )
112 + sqlite? ( dev-lang/php[sqlite] )
113 + )
114 +"
115 +DEPEND="${COMMON_DEPEND}
116 + static? (
117 + curl? ( net-misc/curl[static-libs] )
118 + ldap? (
119 + =dev-libs/cyrus-sasl-2*[static-libs]
120 + net-libs/gnutls[static-libs]
121 + net-nds/openldap[static-libs]
122 + )
123 + libxml2? ( dev-libs/libxml2[static-libs] )
124 + mysql? ( dev-db/mysql-connector-c[static-libs] )
125 + odbc? ( dev-db/unixODBC[static-libs] )
126 + postgres? ( dev-db/postgresql:*[static-libs] )
127 + sqlite? ( dev-db/sqlite[static-libs] )
128 + ssh? ( net-libs/libssh2 )
129 + )
130 +"
131 +BDEPEND="
132 + virtual/pkgconfig
133 +"
134 +
135 +PATCHES=(
136 + "${FILESDIR}/${PN}-4.0.18-modulepathfix.patch"
137 + "${FILESDIR}/${PN}-3.0.30-security-disable-PidFile.patch"
138 +)
139 +
140 +S=${WORKDIR}/${MY_P}
141 +
142 +ZABBIXJAVA_BASE="opt/zabbix_java"
143 +
144 +pkg_setup() {
145 + if use oracle; then
146 + if [ -z "${ORACLE_HOME}" ]; then
147 + eerror
148 + eerror "The environment variable ORACLE_HOME must be set"
149 + eerror "and point to the correct location."
150 + eerror "It looks like you don't have Oracle installed."
151 + eerror
152 + die "Environment variable ORACLE_HOME is not set"
153 + fi
154 + if has_version 'dev-db/oracle-instantclient-basic'; then
155 + ewarn
156 + ewarn "Please ensure you have a full install of the Oracle client."
157 + ewarn "dev-db/oracle-instantclient* is NOT sufficient."
158 + ewarn
159 + fi
160 + fi
161 +
162 + if use frontend; then
163 + webapp_pkg_setup
164 + fi
165 +
166 + java-pkg-opt-2_pkg_setup
167 +}
168 +
169 +src_configure() {
170 + econf \
171 + $(use_enable agent) \
172 + $(use_enable ipv6) \
173 + $(use_enable java) \
174 + $(use_enable proxy) \
175 + $(use_enable server) \
176 + $(use_enable static) \
177 + $(use_with curl libcurl) \
178 + $(use_with gnutls) \
179 + $(use_with ldap) \
180 + $(use_with libxml2) \
181 + $(use_with mbedtls) \
182 + $(use_with mysql) \
183 + $(use_with odbc unixodbc) \
184 + $(use_with openipmi openipmi) \
185 + $(use_with openssl) \
186 + $(use_with oracle) \
187 + $(use_with postgres postgresql) \
188 + $(use_with snmp net-snmp) \
189 + $(use_with sqlite sqlite3) \
190 + $(use_with ssh ssh2) \
191 + $(use_with xmpp jabber)
192 +}
193 +
194 +src_compile() {
195 + if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
196 + emake AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)"
197 + fi
198 +}
199 +
200 +src_install() {
201 + local dirs=(
202 + /etc/zabbix
203 + /var/lib/zabbix
204 + /var/lib/zabbix/home
205 + /var/lib/zabbix/scripts
206 + /var/lib/zabbix/alertscripts
207 + /var/lib/zabbix/externalscripts
208 + /var/log/zabbix
209 + )
210 +
211 + for dir in "${dirs[@]}"; do
212 + dodir "${dir}"
213 + keepdir "${dir}"
214 + done
215 +
216 + if use server; then
217 + insinto /etc/zabbix
218 + doins "${S}"/conf/zabbix_server.conf
219 + fperms 0640 /etc/zabbix/zabbix_server.conf
220 + fowners root:zabbix /etc/zabbix/zabbix_server.conf
221 +
222 + newinitd "${FILESDIR}"/zabbix-server-r1.init zabbix-server
223 +
224 + dosbin src/zabbix_server/zabbix_server
225 +
226 + insinto /usr/share/zabbix
227 + doins -r "${S}"/database/
228 +
229 + systemd_dounit "${FILESDIR}"/zabbix-server.service
230 + newtmpfiles "${FILESDIR}"/zabbix-server.tmpfiles zabbix-server.conf
231 + fi
232 +
233 + if use proxy; then
234 + insinto /etc/zabbix
235 + doins "${S}"/conf/zabbix_proxy.conf
236 + fperms 0640 /etc/zabbix/zabbix_proxy.conf
237 + fowners root:zabbix /etc/zabbix/zabbix_proxy.conf
238 +
239 + newinitd "${FILESDIR}"/zabbix-proxy.init zabbix-proxy
240 +
241 + dosbin src/zabbix_proxy/zabbix_proxy
242 +
243 + insinto /usr/share/zabbix
244 + doins -r "${S}"/database/
245 +
246 + systemd_dounit "${FILESDIR}"/zabbix-proxy.service
247 + newtmpfiles "${FILESDIR}"/zabbix-proxy.tmpfiles zabbix-proxy.conf
248 + fi
249 +
250 + if use agent; then
251 + insinto /etc/zabbix
252 + doins "${S}"/conf/zabbix_agentd.conf
253 + fperms 0640 /etc/zabbix/zabbix_agentd.conf
254 + fowners root:zabbix /etc/zabbix/zabbix_agentd.conf
255 +
256 + newinitd "${FILESDIR}"/zabbix-agentd.init zabbix-agentd
257 +
258 + dosbin src/zabbix_agent/zabbix_agentd
259 + dobin \
260 + src/zabbix_sender/zabbix_sender \
261 + src/zabbix_get/zabbix_get
262 +
263 + systemd_dounit "${FILESDIR}"/zabbix-agentd.service
264 + newtmpfiles "${FILESDIR}"/zabbix-agentd.tmpfiles zabbix-agentd.conf
265 + fi
266 +
267 + fowners root:zabbix /etc/zabbix
268 + fowners zabbix:zabbix \
269 + /var/lib/zabbix \
270 + /var/lib/zabbix/home \
271 + /var/lib/zabbix/scripts \
272 + /var/lib/zabbix/alertscripts \
273 + /var/lib/zabbix/externalscripts \
274 + /var/log/zabbix
275 + fperms 0750 \
276 + /etc/zabbix \
277 + /var/lib/zabbix \
278 + /var/lib/zabbix/home \
279 + /var/lib/zabbix/scripts \
280 + /var/lib/zabbix/alertscripts \
281 + /var/lib/zabbix/externalscripts \
282 + /var/log/zabbix
283 +
284 + dodoc README INSTALL NEWS ChangeLog \
285 + conf/zabbix_agentd.conf \
286 + conf/zabbix_proxy.conf \
287 + conf/zabbix_agentd/userparameter_examples.conf \
288 + conf/zabbix_agentd/userparameter_mysql.conf \
289 + conf/zabbix_server.conf
290 +
291 + if use frontend; then
292 + webapp_src_preinst
293 + cp -R frontends/php/* "${D}/${MY_HTDOCSDIR}"
294 + webapp_configfile \
295 + "${MY_HTDOCSDIR}"/include/db.inc.php \
296 + "${MY_HTDOCSDIR}"/include/config.inc.php
297 + webapp_src_install
298 + fi
299 +
300 + if use java; then
301 + dodir \
302 + /${ZABBIXJAVA_BASE} \
303 + /${ZABBIXJAVA_BASE}/bin \
304 + /${ZABBIXJAVA_BASE}/lib
305 + keepdir /${ZABBIXJAVA_BASE}
306 + exeinto /${ZABBIXJAVA_BASE}/bin
307 + doexe src/zabbix_java/bin/zabbix-java-gateway-${MY_PV}.jar
308 + exeinto /${ZABBIXJAVA_BASE}/lib
309 + doexe \
310 + src/zabbix_java/lib/logback-classic-1.2.3.jar \
311 + src/zabbix_java/lib/logback-console.xml \
312 + src/zabbix_java/lib/logback-core-1.2.3.jar \
313 + src/zabbix_java/lib/logback.xml \
314 + src/zabbix_java/lib/android-json-4.3_r3.1.jar \
315 + src/zabbix_java/lib/slf4j-api-1.7.30.jar
316 + newinitd "${FILESDIR}"/zabbix-jmx-proxy.init zabbix-jmx-proxy
317 + newconfd "${FILESDIR}"/zabbix-jmx-proxy.conf zabbix-jmx-proxy
318 + fi
319 +}
320 +
321 +pkg_postinst() {
322 + if use server || use proxy ; then
323 + elog
324 + elog "You may need to configure your database for Zabbix"
325 + elog "if you have not already done so."
326 + elog
327 +
328 + zabbix_homedir=$(egethome zabbix)
329 + if [ -n "${zabbix_homedir}" ] && \
330 + [ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then
331 + ewarn
332 + ewarn "The user 'zabbix' should have his homedir changed"
333 + ewarn "to /var/lib/zabbix/home if you want to use"
334 + ewarn "custom alert scripts."
335 + ewarn
336 + ewarn "A real homedir might be needed for configfiles"
337 + ewarn "for custom alert scripts (e.g. ~/.sendxmpprc when"
338 + ewarn "using sendxmpp for Jabber alerts)."
339 + ewarn
340 + ewarn "To change the homedir use:"
341 + ewarn " usermod -d /var/lib/zabbix/home zabbix"
342 + ewarn
343 + fi
344 + fi
345 +
346 + if use server; then
347 + tmpfiles_process zabbix-server.conf
348 +
349 + elog
350 + elog "For distributed monitoring you have to run:"
351 + elog
352 + elog "zabbix_server -n <nodeid>"
353 + elog
354 + elog "This will convert database data for use with Node ID"
355 + elog "and also adds a local node."
356 + elog
357 + fi
358 +
359 + if use proxy; then
360 + tmpfiles_process zabbix-proxy.conf
361 + fi
362 +
363 + if use agent; then
364 + tmpfiles_process zabbix-agentd.conf
365 + fi
366 +
367 + elog "--"
368 + elog
369 + elog "You may need to add these lines to /etc/services:"
370 + elog
371 + elog "zabbix-agent 10050/tcp Zabbix Agent"
372 + elog "zabbix-agent 10050/udp Zabbix Agent"
373 + elog "zabbix-trapper 10051/tcp Zabbix Trapper"
374 + elog "zabbix-trapper 10051/udp Zabbix Trapper"
375 + elog
376 +
377 + if use server || use proxy ; then
378 + # check for fping
379 + fping_perms=$(stat -c %a /usr/sbin/fping 2>/dev/null)
380 + case "${fping_perms}" in
381 + 4[157][157][157])
382 + ;;
383 + *)
384 + ewarn
385 + ewarn "If you want to use the checks 'icmpping' and 'icmppingsec',"
386 + ewarn "you have to make /usr/sbin/fping setuid root and executable"
387 + ewarn "by everyone. Run the following command to fix it:"
388 + ewarn
389 + ewarn " chmod u=rwsx,g=rx,o=rx /usr/sbin/fping"
390 + ewarn
391 + ewarn "Please be aware that this might impose a security risk,"
392 + ewarn "depending on the code quality of fping."
393 + ewarn
394 + ;;
395 + esac
396 + fi
397 +}
398 +
399 +pkg_prerm() {
400 + (use frontend || use server) && webapp_pkg_prerm
401 +}