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: Tue, 23 Feb 2021 09:49:09
Message-Id: 1614073630.77ce974dba5ab33ab61471dd209aad8c92234632.fordfrog@gentoo
1 commit: 77ce974dba5ab33ab61471dd209aad8c92234632
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 23 09:47:10 2021 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 23 09:47:10 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=77ce974d
7
8 net-analyzer/zabbix: bump to 5.0.9
9
10 Package-Manager: Portage-3.0.15, Repoman-3.0.2
11 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
12
13 net-analyzer/zabbix/Manifest | 1 +
14 net-analyzer/zabbix/zabbix-5.0.9.ebuild | 350 ++++++++++++++++++++++++++++++++
15 2 files changed, 351 insertions(+)
16
17 diff --git a/net-analyzer/zabbix/Manifest b/net-analyzer/zabbix/Manifest
18 index 4b48800486f..8b3b08a3c72 100644
19 --- a/net-analyzer/zabbix/Manifest
20 +++ b/net-analyzer/zabbix/Manifest
21 @@ -3,6 +3,7 @@ DIST zabbix-4.0.27.tar.gz 17426383 BLAKE2B 33381d3705bc7cb9d451b1a536fbb4f92a9e7
22 DIST zabbix-4.0.28.tar.gz 17424006 BLAKE2B f45af54d1e54ff6945f13cc684fbe0506dab4d554f65018fc30758d7b8be6814ca3661655778abb7c24dcbb241b8e6c21f0ea72a01a886392cadc917e699a957 SHA512 1f40c7316f92474beecc9470d4ad6c093a3a005180514307eb3d7aa206fa36d1a8decc20628b1fc0e62bc7a2ff0e508d694da0fe05911314de6f6d7aa726f425
23 DIST zabbix-5.0.7.tar.gz 19382483 BLAKE2B fa0864ba1ac77659e9a18b0c22cee8be1078fad1e76017d01754b626151366bfeb67aa2a5b29ac1c0ac92ebaff53f7ca273a763158f7a37566dd41efe4dee7ff SHA512 8916ff44a2b3ad16e40d37b43ed540b4eefb91423ecbcc4ab9463477f6a29ed8417c79b0951a36e2798df1166a95ee5ed150bd61448b657df694498c2a274403
24 DIST zabbix-5.0.8.tar.gz 19474050 BLAKE2B 1043efca2f373553728206837949bce5f5ea32328c6289e4028f65e6f1ed76560c1ffbd610eec9855f050d0330bcd3b364a983db896285729f30a693d5ae6c6f SHA512 19601ace704c8a887ffc9b57da8825d8a28a5d064aac3e59480994bee4156db186d37ecf4bee2208bbafc0cb76c0c7f47de964f99953ce78d0187457255d92e9
25 +DIST zabbix-5.0.9.tar.gz 19513312 BLAKE2B e60fcf300c3fcd9595e9fa8465403e906672fdc908d9a15646e2ac9e88684999184acb3a0b8226dff1966554769930b0ae6d692ee4569441714912c2eb93540f SHA512 7306afce482b8b8222d46c25d91cdd8df2d5bbbeb755bd54b4bf747dc78031cc24167a954e4de5933f33f59772838ff0b4c66d0bf19c28dc1a27276da9bb0b38
26 DIST zabbix-5.2.3.tar.gz 19791383 BLAKE2B ad0c2306f05d1d664068d9dbc6983c79e1e4d13e605a4683076da51968d2ca2dd6330ca16ad5e24fcabca95565ff1c3e4246ce7352f23a32d419ba207869f8c2 SHA512 207d522ab728bb89f6aaf793af94848469210fb257ead34b93e0f7ba7b2a22b4cce65d516dfbb549a36ae873fe6b6d3486c47f11efff8950d3c81570c673ff9e
27 DIST zabbix-5.2.4.tar.gz 19916307 BLAKE2B 17d0f5dc1d4a8b79d2a5e741a0fa18ecf584ddfb45afbe816721d0e69bae4b5e11b44fe5031c8a34562c30fd2818f7b4a8bfb1442489be3ec23a27a70e789f56 SHA512 e218de9a8b9445401e769c14a9efd0b3d1b7e9610ce021cdbfc9db159801a4033b8f1c1a808c853bfa3aeb66db8a6dd0cbb5b44fc1421fa0f54c28589d7314b4
28 DIST zabbix-5.2.5.tar.gz 20039761 BLAKE2B 27510c462947a7dedb16d029799aa1c7b38d68199aae47b4b3e5a757120bd74ddf87c7dade0bf339ff2165111345d79119718ade2fe39fd088971be6dcef2bda SHA512 5014a5a510e9ea4a39aa30bdbe3ee82dc1d0a139f32151bb7739df7442ea707b91446ce1cefb61007b603ccedfb0353c628b043db3e90cfe8fc3d67588f2dfd5
29
30 diff --git a/net-analyzer/zabbix/zabbix-5.0.9.ebuild b/net-analyzer/zabbix/zabbix-5.0.9.ebuild
31 new file mode 100644
32 index 00000000000..37470326b6d
33 --- /dev/null
34 +++ b/net-analyzer/zabbix/zabbix-5.0.9.ebuild
35 @@ -0,0 +1,350 @@
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 flag-o-matic webapp java-pkg-opt-2 systemd toolchain-funcs
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/$(ver_cut 1-2)/${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 java curl frontend ipv6 ldap libxml2 mysql openipmi oracle +postgres proxy server ssh ssl snmp sqlite odbc static"
55 +REQUIRED_USE="|| ( agent frontend proxy server )
56 + proxy? ( ^^ ( mysql oracle postgres sqlite odbc ) )
57 + server? ( ^^ ( mysql oracle postgres odbc ) )
58 + static? ( !oracle !snmp )"
59 +
60 +COMMON_DEPEND="
61 + curl? ( net-misc/curl )
62 + java? ( >=virtual/jdk-1.8:* )
63 + ldap? (
64 + =dev-libs/cyrus-sasl-2*
65 + net-libs/gnutls
66 + net-nds/openldap
67 + )
68 + libxml2? ( dev-libs/libxml2 )
69 + mysql? ( dev-db/mysql-connector-c )
70 + odbc? ( dev-db/unixODBC )
71 + openipmi? ( sys-libs/openipmi )
72 + oracle? ( dev-db/oracle-instantclient-basic )
73 + postgres? ( dev-db/postgresql:* )
74 + proxy? ( sys-libs/zlib )
75 + server? (
76 + dev-libs/libevent
77 + sys-libs/zlib
78 + )
79 + snmp? ( net-analyzer/net-snmp )
80 + sqlite? ( dev-db/sqlite )
81 + ssh? ( net-libs/libssh2 )
82 + ssl? ( dev-libs/openssl:=[-bindist] )
83 +"
84 +
85 +RDEPEND="${COMMON_DEPEND}
86 + acct-group/zabbix
87 + acct-user/zabbix
88 + java? ( >=virtual/jre-1.8:* )
89 + mysql? ( virtual/mysql )
90 + proxy? ( net-analyzer/fping[suid] )
91 + server? (
92 + app-admin/webapp-config
93 + dev-libs/libevent
94 + dev-libs/libpcre
95 + net-analyzer/fping[suid]
96 + )
97 + frontend? (
98 + app-admin/webapp-config
99 + dev-lang/php:*[bcmath,ctype,sockets,gd,truetype,xml,session,xmlreader,xmlwriter,nls,sysvipc,unicode]
100 + media-libs/gd[png]
101 + virtual/httpd-php:*
102 + mysql? ( dev-lang/php[mysqli] )
103 + odbc? ( dev-lang/php[odbc] )
104 + oracle? ( dev-lang/php[oci8-instant-client] )
105 + postgres? ( dev-lang/php[postgres] )
106 + sqlite? ( dev-lang/php[sqlite] )
107 + )
108 +"
109 +DEPEND="${COMMON_DEPEND}
110 + static? (
111 + curl? ( net-misc/curl[static-libs] )
112 + ldap? (
113 + =dev-libs/cyrus-sasl-2*[static-libs]
114 + net-libs/gnutls[static-libs]
115 + net-nds/openldap[static-libs]
116 + )
117 + libxml2? ( dev-libs/libxml2[static-libs] )
118 + mysql? ( dev-db/mysql-connector-c[static-libs] )
119 + odbc? ( dev-db/unixODBC[static-libs] )
120 + postgres? ( dev-db/postgresql:*[static-libs] )
121 + sqlite? ( dev-db/sqlite[static-libs] )
122 + ssh? ( net-libs/libssh2 )
123 + )
124 +"
125 +BDEPEND="
126 + virtual/pkgconfig
127 +"
128 +
129 +PATCHES=(
130 + "${FILESDIR}/${PN}-4.0.18-modulepathfix.patch"
131 + "${FILESDIR}/${PN}-3.0.30-security-disable-PidFile.patch"
132 +)
133 +
134 +S=${WORKDIR}/${MY_P}
135 +
136 +ZABBIXJAVA_BASE="opt/zabbix_java"
137 +
138 +pkg_setup() {
139 + if use oracle; then
140 + if [ -z "${ORACLE_HOME}" ]; then
141 + eerror
142 + eerror "The environment variable ORACLE_HOME must be set"
143 + eerror "and point to the correct location."
144 + eerror "It looks like you don't have Oracle installed."
145 + eerror
146 + die "Environment variable ORACLE_HOME is not set"
147 + fi
148 + if has_version 'dev-db/oracle-instantclient-basic'; then
149 + ewarn
150 + ewarn "Please ensure you have a full install of the Oracle client."
151 + ewarn "dev-db/oracle-instantclient* is NOT sufficient."
152 + ewarn
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 ldap) \
177 + $(use_with libxml2) \
178 + $(use_with mysql) \
179 + $(use_with odbc unixodbc) \
180 + $(use_with openipmi openipmi) \
181 + $(use_with oracle) \
182 + $(use_with postgres postgresql) \
183 + $(use_with snmp net-snmp) \
184 + $(use_with sqlite sqlite3) \
185 + $(use_with ssh ssh2) \
186 + $(use_with ssl openssl)
187 +}
188 +
189 +src_compile() {
190 + if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
191 + emake AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)"
192 + fi
193 +}
194 +
195 +src_install() {
196 + local dirs=(
197 + /etc/zabbix
198 + /var/lib/zabbix
199 + /var/lib/zabbix/home
200 + /var/lib/zabbix/scripts
201 + /var/lib/zabbix/alertscripts
202 + /var/lib/zabbix/externalscripts
203 + /var/log/zabbix
204 + )
205 +
206 + for dir in "${dirs[@]}"; do
207 + dodir "${dir}"
208 + keepdir "${dir}"
209 + done
210 +
211 + if use server; then
212 + insinto /etc/zabbix
213 + doins "${S}"/conf/zabbix_server.conf
214 + fperms 0640 /etc/zabbix/zabbix_server.conf
215 + fowners root:zabbix /etc/zabbix/zabbix_server.conf
216 +
217 + newinitd "${FILESDIR}"/zabbix-server.init zabbix-server
218 +
219 + dosbin src/zabbix_server/zabbix_server
220 +
221 + insinto /usr/share/zabbix
222 + doins -r "${S}"/database/
223 +
224 + systemd_dounit "${FILESDIR}"/zabbix-server.service
225 + systemd_newtmpfilesd "${FILESDIR}"/zabbix-server.tmpfiles zabbix-server.conf
226 + fi
227 +
228 + if use proxy; then
229 + insinto /etc/zabbix
230 + doins "${S}"/conf/zabbix_proxy.conf
231 + fperms 0640 /etc/zabbix/zabbix_proxy.conf
232 + fowners root:zabbix /etc/zabbix/zabbix_proxy.conf
233 +
234 + newinitd "${FILESDIR}"/zabbix-proxy.init zabbix-proxy
235 +
236 + dosbin src/zabbix_proxy/zabbix_proxy
237 +
238 + insinto /usr/share/zabbix
239 + doins -r "${S}"/database/
240 +
241 + systemd_dounit "${FILESDIR}"/zabbix-proxy.service
242 + systemd_newtmpfilesd "${FILESDIR}"/zabbix-proxy.tmpfiles zabbix-proxy.conf
243 + fi
244 +
245 + if use agent; then
246 + insinto /etc/zabbix
247 + doins "${S}"/conf/zabbix_agentd.conf
248 + fperms 0640 /etc/zabbix/zabbix_agentd.conf
249 + fowners root:zabbix /etc/zabbix/zabbix_agentd.conf
250 +
251 + newinitd "${FILESDIR}"/zabbix-agentd.init zabbix-agentd
252 +
253 + dosbin src/zabbix_agent/zabbix_agentd
254 + dobin \
255 + src/zabbix_sender/zabbix_sender \
256 + src/zabbix_get/zabbix_get
257 +
258 + systemd_dounit "${FILESDIR}"/zabbix-agentd.service
259 + systemd_newtmpfilesd "${FILESDIR}"/zabbix-agentd.tmpfiles zabbix-agentd.conf
260 + fi
261 +
262 + fowners root:zabbix /etc/zabbix
263 + fowners zabbix:zabbix \
264 + /var/lib/zabbix \
265 + /var/lib/zabbix/home \
266 + /var/lib/zabbix/scripts \
267 + /var/lib/zabbix/alertscripts \
268 + /var/lib/zabbix/externalscripts \
269 + /var/log/zabbix
270 + fperms 0750 \
271 + /etc/zabbix \
272 + /var/lib/zabbix \
273 + /var/lib/zabbix/home \
274 + /var/lib/zabbix/scripts \
275 + /var/lib/zabbix/alertscripts \
276 + /var/lib/zabbix/externalscripts \
277 + /var/log/zabbix
278 +
279 + dodoc README INSTALL NEWS ChangeLog \
280 + conf/zabbix_agentd.conf \
281 + conf/zabbix_proxy.conf \
282 + conf/zabbix_agentd/userparameter_examples.conf \
283 + conf/zabbix_agentd/userparameter_mysql.conf \
284 + conf/zabbix_server.conf
285 +
286 + if use frontend; then
287 + webapp_src_preinst
288 + cp -R ui/* "${D}/${MY_HTDOCSDIR}"
289 + webapp_configfile \
290 + "${MY_HTDOCSDIR}"/include/db.inc.php \
291 + "${MY_HTDOCSDIR}"/include/config.inc.php
292 + webapp_src_install
293 + fi
294 +
295 + if use java; then
296 + dodir \
297 + /${ZABBIXJAVA_BASE} \
298 + /${ZABBIXJAVA_BASE}/bin \
299 + /${ZABBIXJAVA_BASE}/lib
300 + keepdir /${ZABBIXJAVA_BASE}
301 + exeinto /${ZABBIXJAVA_BASE}/bin
302 + doexe src/zabbix_java/bin/zabbix-java-gateway-${MY_PV}.jar
303 + exeinto /${ZABBIXJAVA_BASE}/lib
304 + doexe \
305 + src/zabbix_java/lib/logback-classic-0.9.27.jar \
306 + src/zabbix_java/lib/logback-console.xml \
307 + src/zabbix_java/lib/logback-core-0.9.27.jar \
308 + src/zabbix_java/lib/logback.xml \
309 + src/zabbix_java/lib/android-json-4.3_r3.1.jar \
310 + src/zabbix_java/lib/slf4j-api-1.6.1.jar
311 + newinitd "${FILESDIR}"/zabbix-jmx-proxy.init zabbix-jmx-proxy
312 + newconfd "${FILESDIR}"/zabbix-jmx-proxy.conf zabbix-jmx-proxy
313 + fi
314 +}
315 +
316 +pkg_postinst() {
317 + if use server || use proxy ; then
318 + elog
319 + elog "You may need to configure your database for Zabbix"
320 + elog "if you have not already done so."
321 + elog
322 +
323 + zabbix_homedir=$(egethome zabbix)
324 + if [ -n "${zabbix_homedir}" ] && \
325 + [ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then
326 + ewarn
327 + ewarn "The user 'zabbix' should have his homedir changed"
328 + ewarn "to /var/lib/zabbix/home if you want to use"
329 + ewarn "custom alert scripts."
330 + ewarn
331 + ewarn "A real homedir might be needed for configfiles"
332 + ewarn "for custom alert scripts."
333 + ewarn
334 + ewarn "To change the homedir use:"
335 + ewarn " usermod -d /var/lib/zabbix/home zabbix"
336 + ewarn
337 + fi
338 + fi
339 +
340 + if use server; then
341 + elog
342 + elog "For distributed monitoring you have to run:"
343 + elog
344 + elog "zabbix_server -n <nodeid>"
345 + elog
346 + elog "This will convert database data for use with Node ID"
347 + elog "and also adds a local node."
348 + elog
349 + fi
350 +
351 + elog "--"
352 + elog
353 + elog "You may need to add these lines to /etc/services:"
354 + elog
355 + elog "zabbix-agent 10050/tcp Zabbix Agent"
356 + elog "zabbix-agent 10050/udp Zabbix Agent"
357 + elog "zabbix-trapper 10051/tcp Zabbix Trapper"
358 + elog "zabbix-trapper 10051/udp Zabbix Trapper"
359 + elog
360 +
361 + if use server || use proxy ; then
362 + # check for fping
363 + fping_perms=$(stat -c %a /usr/sbin/fping 2>/dev/null)
364 + case "${fping_perms}" in
365 + 4[157][157][157])
366 + ;;
367 + *)
368 + ewarn
369 + ewarn "If you want to use the checks 'icmpping' and 'icmppingsec',"
370 + ewarn "you have to make /usr/sbin/fping setuid root and executable"
371 + ewarn "by everyone. Run the following command to fix it:"
372 + ewarn
373 + ewarn " chmod u=rwsx,g=rx,o=rx /usr/sbin/fping"
374 + ewarn
375 + ewarn "Please be aware that this might impose a security risk,"
376 + ewarn "depending on the code quality of fping."
377 + ewarn
378 + ;;
379 + esac
380 + fi
381 +}
382 +
383 +pkg_prerm() {
384 + (use frontend || use server) && webapp_pkg_prerm
385 +}