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: Thu, 22 Sep 2022 07:35:16
Message-Id: 1663832105.b273309edcd51e7d3295f93e4c9b0c824b20fcc8.fordfrog@gentoo
1 commit: b273309edcd51e7d3295f93e4c9b0c824b20fcc8
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 22 07:35:05 2022 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 22 07:35:05 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b273309e
7
8 net-analyzer/zabbix: bump to 4.0.44
9
10 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
11
12 net-analyzer/zabbix/Manifest | 1 +
13 net-analyzer/zabbix/zabbix-4.0.44.ebuild | 367 +++++++++++++++++++++++++++++++
14 2 files changed, 368 insertions(+)
15
16 diff --git a/net-analyzer/zabbix/Manifest b/net-analyzer/zabbix/Manifest
17 index 40bf9e750f71..b5749c267db3 100644
18 --- a/net-analyzer/zabbix/Manifest
19 +++ b/net-analyzer/zabbix/Manifest
20 @@ -1,4 +1,5 @@
21 DIST zabbix-4.0.43.tar.gz 17648025 BLAKE2B 1dbe0c8691d990278bcc540dcd57d7640a3d832021a9ec416dd67857a3e6e0724659ca13c6c59482e45e772cdb3c22f66810d0111e59d0371ed37f3d8b61275b SHA512 5d7f81a2e7dd8d060ab46c37622b4b73702d208e065bd99022f6c7e9598f2230b89347e73864238861eed7747d5439221ed1e4cc7ac99bf1e990d9550612dd7f
22 +DIST zabbix-4.0.44.tar.gz 17713321 BLAKE2B 1f75f99430846cfc029d5e541ede7ef8c019a42af0ab6d70be3170052b723877ca54f6554cd9a29f7f436fb6e9d5ffd02913a1b12ad45a2a8ed00432738e5660 SHA512 223d6fdd352e5731487797d839c1741209eae79af78a058d3ba29e5a9eaab5cbf91072ad827bdd676696d3ea518c638d7fd515bff2a257aef3a7ad38f41b3cb6
23 DIST zabbix-5.0.26-go-deps.tar.xz 34385532 BLAKE2B a52924f8bee464deb6f6812242c0d7d987e7b46d097f0a118e2cb429d6d3d26f8e116d66e594a26e22bc5bf81997d21fb66ef97151538a814f63fe2c55a7f729 SHA512 49727ccd5e26d28e577fe9ee1d7eaa2de3d5054e831ea82e5dc9d8177c63063cf957b575072c5dc68b294763d519fff9041700e2dc267394e6ec143d272b1dd7
24 DIST zabbix-5.0.26.tar.gz 21248951 BLAKE2B 9119e66acc71f5ed8baf07b6bc90a69152188e1e74058146a9c7eef7d36fc9f0363a5635518bdb696b76fb93c9777878b8d4411853c641dec809e86cba4cfa74 SHA512 b10b3eb849ea3646aeaf3d2a1dbf639e6effbd21a23c06e4f2686a177d2ae186537607ed0a76c3f520cb84f3bba3079f5d9f7e840077cf5e1a3eac4b46f0558b
25 DIST zabbix-5.0.27-go-deps.tar.xz 34405712 BLAKE2B a24aa4bfde3726e04a6eb2664e4e9ab510ebaee55bd35ee61fe296cd961482d587305f461ca76a483d5441c3a2a8554dbb510bb00aabf3d60a0cc7342f48f61b SHA512 6f871b203247633253339db21015ad8610d905d9c7801ca34291af373fdc1a57b676b575da02b21968ab624fd3e87084cd4c4d234f43520d55a4a448c27d09e6
26
27 diff --git a/net-analyzer/zabbix/zabbix-4.0.44.ebuild b/net-analyzer/zabbix/zabbix-4.0.44.ebuild
28 new file mode 100644
29 index 000000000000..1e0af68937f8
30 --- /dev/null
31 +++ b/net-analyzer/zabbix/zabbix-4.0.44.ebuild
32 @@ -0,0 +1,367 @@
33 +# Copyright 1999-2022 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=8
37 +
38 +# needed to make webapp-config dep optional
39 +WEBAPP_OPTIONAL="yes"
40 +inherit webapp java-pkg-opt-2 systemd toolchain-funcs tmpfiles user-info
41 +
42 +DESCRIPTION="ZABBIX is software for monitoring of your applications, network and servers"
43 +HOMEPAGE="https://www.zabbix.com/"
44 +MY_P=${P/_/}
45 +MY_PV=${PV/_/}
46 +SRC_URI="https://cdn.zabbix.com/${PN}/sources/stable/4.0/${P}.tar.gz"
47 +LICENSE="GPL-2"
48 +SLOT="0/$(ver_cut 1-2)"
49 +WEBAPP_MANUAL_SLOT="yes"
50 +KEYWORDS="~amd64 ~x86"
51 +IUSE="+agent curl frontend gnutls ipv6 java ldap libxml2 mbedtls mysql odbc openipmi +openssl oracle +postgres proxy server snmp sqlite ssh static xmpp"
52 +REQUIRED_USE="|| ( agent frontend proxy server )
53 + ?? ( gnutls mbedtls openssl )
54 + proxy? ( ^^ ( mysql oracle postgres sqlite ) )
55 + server? ( ^^ ( mysql oracle postgres ) !sqlite )
56 + static? ( !oracle !snmp )"
57 +
58 +COMMON_DEPEND="
59 + curl? ( net-misc/curl )
60 + gnutls? ( net-libs/gnutls:0= )
61 + java? ( >=virtual/jdk-1.8:* )
62 + ldap? (
63 + =dev-libs/cyrus-sasl-2*
64 + net-libs/gnutls:=
65 + net-nds/openldap:=
66 + )
67 + libxml2? ( dev-libs/libxml2 )
68 + mbedtls? ( net-libs/mbedtls:0= )
69 + mysql? ( dev-db/mysql-connector-c:= )
70 + odbc? ( dev-db/unixODBC )
71 + openipmi? ( sys-libs/openipmi )
72 + openssl? ( dev-libs/openssl:=[-bindist(-)] )
73 + oracle? ( dev-db/oracle-instantclient[odbc,sdk] )
74 + postgres? ( dev-db/postgresql:* )
75 + proxy? (
76 + dev-libs/libevent:=
77 + sys-libs/zlib
78 + )
79 + server? (
80 + dev-libs/libevent:=
81 + sys-libs/zlib
82 + )
83 + snmp? ( net-analyzer/net-snmp:= )
84 + sqlite? ( dev-db/sqlite )
85 + ssh? ( net-libs/libssh2 )
86 + xmpp? ( dev-libs/iksemel )
87 +"
88 +
89 +RDEPEND="${COMMON_DEPEND}
90 + acct-group/zabbix
91 + acct-user/zabbix
92 + java? ( >=virtual/jre-1.8:* )
93 + mysql? ( virtual/mysql )
94 + proxy? (
95 + dev-libs/libpcre
96 + net-analyzer/fping[suid]
97 + )
98 + server? (
99 + app-admin/webapp-config
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 + fi
155 +
156 + if use frontend; then
157 + webapp_pkg_setup
158 + fi
159 +
160 + java-pkg-opt-2_pkg_setup
161 +}
162 +
163 +src_prepare() {
164 + default
165 +}
166 +
167 +src_configure() {
168 + econf \
169 + $(use_enable agent) \
170 + $(use_enable ipv6) \
171 + $(use_enable java) \
172 + $(use_enable proxy) \
173 + $(use_enable server) \
174 + $(use_enable static) \
175 + $(use_with curl libcurl) \
176 + $(use_with gnutls) \
177 + $(use_with ldap) \
178 + $(use_with libxml2) \
179 + $(use_with mbedtls) \
180 + $(use_with mysql) \
181 + $(use_with odbc unixodbc) \
182 + $(use_with openipmi openipmi) \
183 + $(use_with openssl) \
184 + $(use_with oracle) \
185 + $(use_with postgres postgresql) \
186 + $(use_with snmp net-snmp) \
187 + $(use_with sqlite sqlite3) \
188 + $(use_with ssh ssh2) \
189 + $(use_with xmpp jabber)
190 +}
191 +
192 +src_compile() {
193 + if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
194 + emake AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)"
195 + fi
196 +}
197 +
198 +src_install() {
199 + local dirs=(
200 + /etc/zabbix
201 + /var/lib/zabbix
202 + /var/lib/zabbix/home
203 + /var/lib/zabbix/scripts
204 + /var/lib/zabbix/alertscripts
205 + /var/lib/zabbix/externalscripts
206 + /var/log/zabbix
207 + )
208 +
209 + for dir in "${dirs[@]}"; do
210 + dodir "${dir}"
211 + keepdir "${dir}"
212 + done
213 +
214 + if use server; then
215 + insinto /etc/zabbix
216 + doins "${S}"/conf/zabbix_server.conf
217 + fperms 0640 /etc/zabbix/zabbix_server.conf
218 + fowners root:zabbix /etc/zabbix/zabbix_server.conf
219 +
220 + newinitd "${FILESDIR}"/zabbix-server-r1.init zabbix-server
221 +
222 + dosbin src/zabbix_server/zabbix_server
223 +
224 + insinto /usr/share/zabbix
225 + doins -r "${S}"/database/
226 +
227 + systemd_dounit "${FILESDIR}"/zabbix-server.service
228 + newtmpfiles "${FILESDIR}"/zabbix-server.tmpfiles zabbix-server.conf
229 + fi
230 +
231 + if use proxy; then
232 + insinto /etc/zabbix
233 + doins "${S}"/conf/zabbix_proxy.conf
234 + fperms 0640 /etc/zabbix/zabbix_proxy.conf
235 + fowners root:zabbix /etc/zabbix/zabbix_proxy.conf
236 +
237 + newinitd "${FILESDIR}"/zabbix-proxy.init zabbix-proxy
238 +
239 + dosbin src/zabbix_proxy/zabbix_proxy
240 +
241 + insinto /usr/share/zabbix
242 + doins -r "${S}"/database/
243 +
244 + systemd_dounit "${FILESDIR}"/zabbix-proxy.service
245 + newtmpfiles "${FILESDIR}"/zabbix-proxy.tmpfiles zabbix-proxy.conf
246 + fi
247 +
248 + if use agent; then
249 + insinto /etc/zabbix
250 + doins "${S}"/conf/zabbix_agentd.conf
251 + fperms 0640 /etc/zabbix/zabbix_agentd.conf
252 + fowners root:zabbix /etc/zabbix/zabbix_agentd.conf
253 +
254 + newinitd "${FILESDIR}"/zabbix-agentd.init zabbix-agentd
255 +
256 + dosbin src/zabbix_agent/zabbix_agentd
257 + dobin \
258 + src/zabbix_sender/zabbix_sender \
259 + src/zabbix_get/zabbix_get
260 +
261 + systemd_dounit "${FILESDIR}"/zabbix-agentd.service
262 + newtmpfiles "${FILESDIR}"/zabbix-agentd.tmpfiles zabbix-agentd.conf
263 + fi
264 +
265 + fowners root:zabbix /etc/zabbix
266 + fowners zabbix:zabbix \
267 + /var/lib/zabbix \
268 + /var/lib/zabbix/home \
269 + /var/lib/zabbix/scripts \
270 + /var/lib/zabbix/alertscripts \
271 + /var/lib/zabbix/externalscripts \
272 + /var/log/zabbix
273 + fperms 0750 \
274 + /etc/zabbix \
275 + /var/lib/zabbix \
276 + /var/lib/zabbix/home \
277 + /var/lib/zabbix/scripts \
278 + /var/lib/zabbix/alertscripts \
279 + /var/lib/zabbix/externalscripts \
280 + /var/log/zabbix
281 +
282 + dodoc README INSTALL NEWS ChangeLog \
283 + conf/zabbix_agentd.conf \
284 + conf/zabbix_proxy.conf \
285 + conf/zabbix_agentd/userparameter_examples.conf \
286 + conf/zabbix_agentd/userparameter_mysql.conf \
287 + conf/zabbix_server.conf
288 +
289 + if use frontend; then
290 + webapp_src_preinst
291 + cp -R frontends/php/* "${D}/${MY_HTDOCSDIR}"
292 + webapp_configfile \
293 + "${MY_HTDOCSDIR}"/include/db.inc.php \
294 + "${MY_HTDOCSDIR}"/include/config.inc.php
295 + webapp_src_install
296 + fi
297 +
298 + if use java; then
299 + dodir \
300 + /${ZABBIXJAVA_BASE} \
301 + /${ZABBIXJAVA_BASE}/bin \
302 + /${ZABBIXJAVA_BASE}/lib
303 + keepdir /${ZABBIXJAVA_BASE}
304 + exeinto /${ZABBIXJAVA_BASE}/bin
305 + doexe src/zabbix_java/bin/zabbix-java-gateway-${MY_PV}.jar
306 + exeinto /${ZABBIXJAVA_BASE}/lib
307 + doexe \
308 + src/zabbix_java/lib/logback-classic-1.2.9.jar \
309 + src/zabbix_java/lib/logback-console.xml \
310 + src/zabbix_java/lib/logback-core-1.2.9.jar \
311 + src/zabbix_java/lib/logback.xml \
312 + src/zabbix_java/lib/android-json-4.3_r3.1.jar \
313 + src/zabbix_java/lib/slf4j-api-1.7.32.jar
314 + newinitd "${FILESDIR}"/zabbix-jmx-proxy.init zabbix-jmx-proxy
315 + newconfd "${FILESDIR}"/zabbix-jmx-proxy.conf zabbix-jmx-proxy
316 + fi
317 +}
318 +
319 +pkg_postinst() {
320 + if use server || use proxy ; then
321 + elog
322 + elog "You may need to configure your database for Zabbix"
323 + elog "if you have not already done so."
324 + elog
325 +
326 + zabbix_homedir=$(egethome zabbix)
327 + if [ -n "${zabbix_homedir}" ] && \
328 + [ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then
329 + ewarn
330 + ewarn "The user 'zabbix' should have his homedir changed"
331 + ewarn "to /var/lib/zabbix/home if you want to use"
332 + ewarn "custom alert scripts."
333 + ewarn
334 + ewarn "A real homedir might be needed for configfiles"
335 + ewarn "for custom alert scripts (e.g. ~/.sendxmpprc when"
336 + ewarn "using sendxmpp for Jabber alerts)."
337 + ewarn
338 + ewarn "To change the homedir use:"
339 + ewarn " usermod -d /var/lib/zabbix/home zabbix"
340 + ewarn
341 + fi
342 + fi
343 +
344 + if use server; then
345 + tmpfiles_process zabbix-server.conf
346 +
347 + elog
348 + elog "For distributed monitoring you have to run:"
349 + elog
350 + elog "zabbix_server -n <nodeid>"
351 + elog
352 + elog "This will convert database data for use with Node ID"
353 + elog "and also adds a local node."
354 + elog
355 + fi
356 +
357 + if use proxy; then
358 + tmpfiles_process zabbix-proxy.conf
359 + fi
360 +
361 + if use agent; then
362 + tmpfiles_process zabbix-agentd.conf
363 + fi
364 +
365 + elog "--"
366 + elog
367 + elog "You may need to add these lines to /etc/services:"
368 + elog
369 + elog "zabbix-agent 10050/tcp Zabbix Agent"
370 + elog "zabbix-agent 10050/udp Zabbix Agent"
371 + elog "zabbix-trapper 10051/tcp Zabbix Trapper"
372 + elog "zabbix-trapper 10051/udp Zabbix Trapper"
373 + elog
374 +
375 + if use server || use proxy ; then
376 + # check for fping
377 + fping_perms=$(stat -c %a /usr/sbin/fping 2>/dev/null)
378 + case "${fping_perms}" in
379 + 4[157][157][157])
380 + ;;
381 + *)
382 + ewarn
383 + ewarn "If you want to use the checks 'icmpping' and 'icmppingsec',"
384 + ewarn "you have to make /usr/sbin/fping setuid root and executable"
385 + ewarn "by everyone. Run the following command to fix it:"
386 + ewarn
387 + ewarn " chmod u=rwsx,g=rx,o=rx /usr/sbin/fping"
388 + ewarn
389 + ewarn "Please be aware that this might impose a security risk,"
390 + ewarn "depending on the code quality of fping."
391 + ewarn
392 + ;;
393 + esac
394 + fi
395 +}
396 +
397 +pkg_prerm() {
398 + (use frontend || use server) && webapp_pkg_prerm
399 +}