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: Wed, 02 Dec 2020 09:06:38
Message-Id: 1606899963.6733c514554393550e49f635da6089dbc670edf2.fordfrog@gentoo
1 commit: 6733c514554393550e49f635da6089dbc670edf2
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Wed Dec 2 09:06:03 2020 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 2 09:06:03 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6733c514
7
8 net-analyzer/zabbix: bump to 5.0.6
9
10 Package-Manager: Portage-3.0.11, 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.6.ebuild | 347 ++++++++++++++++++++++++++++++++
15 2 files changed, 348 insertions(+)
16
17 diff --git a/net-analyzer/zabbix/Manifest b/net-analyzer/zabbix/Manifest
18 index 353fe501cff..d03791cd53b 100644
19 --- a/net-analyzer/zabbix/Manifest
20 +++ b/net-analyzer/zabbix/Manifest
21 @@ -3,5 +3,6 @@ DIST zabbix-4.0.25.tar.gz 17414403 BLAKE2B 5b84c5d61c90b4fbc94ea64994a7b4216fe1e
22 DIST zabbix-4.0.26.tar.gz 17412367 BLAKE2B 7b75eeaa1146faed5e7aeeb3944eeb68df9c3e608beddb5b12ccbc8998ee6f0c3913b5f5cfe2b63dbf154a43e8393fc64b8286f805b8d3d08edbd25f21b66ce1 SHA512 7dc54176bd40cd73e2e82844caa317747df611e61b5d2d13a3516d143af9ede29ba5407bfca8aec21c9afcb77f53494ee469a2fc62cef3b91cedfce71803cac3
23 DIST zabbix-5.0.4.tar.gz 19039167 BLAKE2B 82fb27076febe5ba43ff6c829ae22c5b4928d74f14e429c602442c90dfd5d1ce112b66d1782bd313b3300c66c774da4403a2150be7ed6ae56ae4b03a608dd018 SHA512 8ac6b56a221fe73982c30dc7dd2f2b036fa10a2fc38ef54e24dc0dd5d56a096f9c0779965afcaa5d26ee893a9f5fc8189ebc67d4244b325acb851cd8b5b6af73
24 DIST zabbix-5.0.5.tar.gz 19153153 BLAKE2B 6f78e690b5a8325739148802a8933d6b1e45a7c08c6f384643d4f85dc8a502be73ff2873cf3ec40cc96c2d892c8866c9f07847b055bef80fda9b00f7333727c5 SHA512 5397672fa170e12120526793b48d01764013467cc259eca61991bc52251c25888dd318ccffa6ed30ac3643104e715ceb70baaeec6eeaddb115ed294c22f5e619
25 +DIST zabbix-5.0.6.tar.gz 19359566 BLAKE2B 375fcbed08be46c1f17c7979763dcdfb8a51a25c2523037a1992dbb7ceb798a665f5d01e97e2e6ef023d5170e3e71df933e0fc41d27fd905ba190497d6bcd28d SHA512 c136536eab3c0e3527e8db8528656776de8849554e0a85a1644000e51c66b09044b176985de1c6d1dcc1d4ec03fc2456111c4df8d896ca276eeed2744cdd48be
26 DIST zabbix-5.2.1.tar.gz 19579218 BLAKE2B 32f8955af5e15dd72f660a2fe1153c8c3d582d9470a87def756516db53a512605fcb67263317ef5980d597d1124324dc15c404e31aa96201105fbd5821549bb8 SHA512 deb69250a91abe24c7988011bfaa369cc13639636b37668ec12e310d92813288adc8e3a2ea7a2a51b0f54d7e6f594277778bb37a481b8f9c3dbb02e528a0cfa0
27 DIST zabbix-5.2.2.tar.gz 19745101 BLAKE2B 651184d4645ff4cfac1317326bd846b4707d8556a30c64dd0b5ac923fb2bb4439b120a4c2bf43c1f73b57a919d5f3bfba28e3d9efde6a3f48587c5b7d0b1d7db SHA512 7bb79111ff809a90a5911d7f94f86eddec3a3fa4f91fdfbf013178442de81d22dc13359679570b8d62fe41b664c764c42cbe98936fd195521951aab507933d9b
28
29 diff --git a/net-analyzer/zabbix/zabbix-5.0.6.ebuild b/net-analyzer/zabbix/zabbix-5.0.6.ebuild
30 new file mode 100644
31 index 00000000000..e393d4a24eb
32 --- /dev/null
33 +++ b/net-analyzer/zabbix/zabbix-5.0.6.ebuild
34 @@ -0,0 +1,347 @@
35 +# Copyright 1999-2020 Gentoo Authors
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=7
39 +
40 +# needed to make webapp-config dep optional
41 +WEBAPP_OPTIONAL="yes"
42 +inherit flag-o-matic webapp java-pkg-opt-2 user systemd toolchain-funcs
43 +
44 +DESCRIPTION="ZABBIX is software for monitoring of your applications, network and servers"
45 +HOMEPAGE="https://www.zabbix.com/"
46 +MY_P=${P/_/}
47 +MY_PV=${PV/_/}
48 +SRC_URI="https://cdn.zabbix.com/${PN}/sources/stable/$(ver_cut 1-2)/${P}.tar.gz"
49 +LICENSE="GPL-2"
50 +SLOT="0"
51 +WEBAPP_MANUAL_SLOT="yes"
52 +KEYWORDS="~amd64 ~x86"
53 +IUSE="+agent java curl frontend ipv6 ldap libxml2 mysql openipmi oracle +postgres proxy server ssh ssl snmp sqlite odbc static"
54 +REQUIRED_USE="|| ( agent frontend proxy server )
55 + proxy? ( ^^ ( mysql oracle postgres sqlite odbc ) )
56 + server? ( ^^ ( mysql oracle postgres odbc ) )
57 + static? ( !oracle !snmp )"
58 +
59 +COMMON_DEPEND="
60 + curl? ( net-misc/curl )
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 + mysql? ( dev-db/mysql-connector-c )
69 + odbc? ( dev-db/unixODBC )
70 + openipmi? ( sys-libs/openipmi )
71 + oracle? ( dev-db/oracle-instantclient-basic )
72 + postgres? ( dev-db/postgresql:* )
73 + proxy? ( sys-libs/zlib )
74 + server? (
75 + dev-libs/libevent
76 + sys-libs/zlib
77 + )
78 + snmp? ( net-analyzer/net-snmp )
79 + sqlite? ( dev-db/sqlite )
80 + ssh? ( net-libs/libssh2 )
81 + ssl? ( dev-libs/openssl:=[-bindist] )
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 +}
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 +}