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, 30 Dec 2020 09:23:32
Message-Id: 1609320187.43a3429dc5ede6526be538240e51db3e1baea8f7.fordfrog@gentoo
1 commit: 43a3429dc5ede6526be538240e51db3e1baea8f7
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Wed Dec 30 09:23:07 2020 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 30 09:23:07 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=43a3429d
7
8 net-analyzer/zabbix: bump to 5.0.7
9
10 Package-Manager: Portage-3.0.12, 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.7.ebuild | 346 ++++++++++++++++++++++++++++++++
15 2 files changed, 347 insertions(+)
16
17 diff --git a/net-analyzer/zabbix/Manifest b/net-analyzer/zabbix/Manifest
18 index 8da020be552..29778a69228 100644
19 --- a/net-analyzer/zabbix/Manifest
20 +++ b/net-analyzer/zabbix/Manifest
21 @@ -3,6 +3,7 @@ DIST zabbix-4.0.26.tar.gz 17412367 BLAKE2B 7b75eeaa1146faed5e7aeeb3944eeb68df9c3
22 DIST zabbix-4.0.27.tar.gz 17426383 BLAKE2B 33381d3705bc7cb9d451b1a536fbb4f92a9e7e321afbe9363a7879cbea3cc5977a4866a5f4d1fb70120804edaffaf869ba8c4321a67898c42c9abe2341ee118b SHA512 54690dd778d09d7309c2e2ea3f0bfc6053ef097888bfccd140484e4677766ded829757eb4dfde7da8ce19335307ddbfbb1c132feabc13cc6727a6d28c1591cfa
23 DIST zabbix-5.0.5.tar.gz 19153153 BLAKE2B 6f78e690b5a8325739148802a8933d6b1e45a7c08c6f384643d4f85dc8a502be73ff2873cf3ec40cc96c2d892c8866c9f07847b055bef80fda9b00f7333727c5 SHA512 5397672fa170e12120526793b48d01764013467cc259eca61991bc52251c25888dd318ccffa6ed30ac3643104e715ceb70baaeec6eeaddb115ed294c22f5e619
24 DIST zabbix-5.0.6.tar.gz 19359566 BLAKE2B 375fcbed08be46c1f17c7979763dcdfb8a51a25c2523037a1992dbb7ceb798a665f5d01e97e2e6ef023d5170e3e71df933e0fc41d27fd905ba190497d6bcd28d SHA512 c136536eab3c0e3527e8db8528656776de8849554e0a85a1644000e51c66b09044b176985de1c6d1dcc1d4ec03fc2456111c4df8d896ca276eeed2744cdd48be
25 +DIST zabbix-5.0.7.tar.gz 19382483 BLAKE2B fa0864ba1ac77659e9a18b0c22cee8be1078fad1e76017d01754b626151366bfeb67aa2a5b29ac1c0ac92ebaff53f7ca273a763158f7a37566dd41efe4dee7ff SHA512 8916ff44a2b3ad16e40d37b43ed540b4eefb91423ecbcc4ab9463477f6a29ed8417c79b0951a36e2798df1166a95ee5ed150bd61448b657df694498c2a274403
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 DIST zabbix-5.2.3.tar.gz 19791383 BLAKE2B ad0c2306f05d1d664068d9dbc6983c79e1e4d13e605a4683076da51968d2ca2dd6330ca16ad5e24fcabca95565ff1c3e4246ce7352f23a32d419ba207869f8c2 SHA512 207d522ab728bb89f6aaf793af94848469210fb257ead34b93e0f7ba7b2a22b4cce65d516dfbb549a36ae873fe6b6d3486c47f11efff8950d3c81570c673ff9e
29
30 diff --git a/net-analyzer/zabbix/zabbix-5.0.7.ebuild b/net-analyzer/zabbix/zabbix-5.0.7.ebuild
31 new file mode 100644
32 index 00000000000..8f6e9556236
33 --- /dev/null
34 +++ b/net-analyzer/zabbix/zabbix-5.0.7.ebuild
35 @@ -0,0 +1,346 @@
36 +# Copyright 1999-2020 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 +}