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