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