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, 07 Feb 2020 20:19:14
Message-Id: 1581106735.d71c4ff6c8d8776fc7ba56fed2acb4c7846ed8d2.fordfrog@gentoo
1 commit: d71c4ff6c8d8776fc7ba56fed2acb4c7846ed8d2
2 Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
3 AuthorDate: Fri Feb 7 20:18:34 2020 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Fri Feb 7 20:18:55 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d71c4ff6
7
8 net-analyzer/zabbix: bump to 4.4.5
9
10 Closes: https://bugs.gentoo.org/705742
11 Package-Manager: Portage-2.3.87, Repoman-2.3.20
12 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
13
14 net-analyzer/zabbix/Manifest | 1 +
15 net-analyzer/zabbix/zabbix-4.4.5.ebuild | 333 ++++++++++++++++++++++++++++++++
16 2 files changed, 334 insertions(+)
17
18 diff --git a/net-analyzer/zabbix/Manifest b/net-analyzer/zabbix/Manifest
19 index fe13523a798..0ca440546b7 100644
20 --- a/net-analyzer/zabbix/Manifest
21 +++ b/net-analyzer/zabbix/Manifest
22 @@ -4,3 +4,4 @@ DIST zabbix-3.4.15.tar.gz 17489570 BLAKE2B 8b820e29334fa7814ab54baef75374955340c
23 DIST zabbix-4.0.13.tar.gz 17150333 BLAKE2B fe4eaf999c0fbe4c87ca2bb621ce229480840f3e86de5e7b02d3668d5705046e62bf04f4f4ad75e814c1fa795642df3c0a9d1bfb07ef25c33003b12e0fe44c7b SHA512 150d28b1be88821be30ef1a9d74ac62e6939f556ef13e6acc6c99b915d36d1655d776aeb2399009285404724dfa41acf249b9047797890a954941831c8b5ecba
24 DIST zabbix-4.2.7.tar.gz 18286402 BLAKE2B 36fbd5938d6d188b29fb2e284a8b2ddec1e3cfda08517094e06fae6ccad9dea8027368f4a1a98cb49957caf0aee580df01a17f4aa19a98e746e2c1164db4b590 SHA512 92341e4efe721f043b66bdd382fc69bc408c4e0435a594fadf51989c37d8ecbd72ae0092517929b521527b41331f933310e9c14da42f18902ca54460170dddf9
25 DIST zabbix-4.4.0.tar.gz 20689807 BLAKE2B 7be62a7b124a016a9f3ab5022b349452b1a99c9ef8cff8ba4b8278f7c48a7632d7f3e6677764fd778c44c05fdb86bbe2b066eb6a51f076274fffcbbd94202db4 SHA512 021e7454decb885065417f6f6a0ecc8a9d4f184f68da6ab4efea68280b3a0c0641eab05620ce14016b6e57ce32c44075e53b45f03e764e8726c00bfdd6039406
26 +DIST zabbix-4.4.5.tar.gz 19284769 BLAKE2B e0c7b99c48128a2379c46d2125497816d484afc1d0e2b8d6d7da5ca93a494346980af0dc90a7f63f7ea5719b7aec6baa658f060fbdfaaddf5102883c2590da1f SHA512 b7971f3c25270c5e35861a0db8e810d8ffe6c59ffc935fa2df5b1fd5d591d577db60e04673ca0a6f158dd126245a6ee4cd4e84a3637c447c9b6f68f77848f114
27
28 diff --git a/net-analyzer/zabbix/zabbix-4.4.5.ebuild b/net-analyzer/zabbix/zabbix-4.4.5.ebuild
29 new file mode 100644
30 index 00000000000..2ff7b0830d7
31 --- /dev/null
32 +++ b/net-analyzer/zabbix/zabbix-4.4.5.ebuild
33 @@ -0,0 +1,333 @@
34 +# Copyright 1999-2020 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI="6"
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://downloads.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/${PV}/${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 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="snmp? ( net-analyzer/net-snmp )
59 + ldap? (
60 + net-nds/openldap
61 + =dev-libs/cyrus-sasl-2*
62 + net-libs/gnutls
63 + )
64 + mysql? ( >=virtual/mysql-5.0.3 )
65 + sqlite? ( >=dev-db/sqlite-3.3.5 )
66 + postgres? ( >=dev-db/postgresql-8.1:* )
67 + oracle? ( >=dev-db/oracle-instantclient-basic-10.0.0.0 )
68 + libxml2? ( dev-libs/libxml2 )
69 + curl? ( net-misc/curl )
70 + openipmi? ( sys-libs/openipmi )
71 + ssh? ( net-libs/libssh2 )
72 + java? ( virtual/jdk:* )
73 + odbc? ( dev-db/unixODBC )
74 + server? ( sys-libs/zlib )
75 + proxy? ( sys-libs/zlib )
76 + server? ( dev-libs/libevent )
77 + ssl? ( dev-libs/openssl:=[-bindist] )"
78 +
79 +RDEPEND="${COMMON_DEPEND}
80 + proxy? ( net-analyzer/fping[suid] )
81 + server? ( net-analyzer/fping[suid]
82 + app-admin/webapp-config
83 + dev-libs/libpcre )
84 + java? (
85 + >=virtual/jre-1.4
86 + dev-java/slf4j-api
87 + )
88 + frontend? (
89 + >=dev-lang/php-5.4.0[bcmath,ctype,sockets,gd,truetype,xml,session,xmlreader,xmlwriter,nls,sysvipc,unicode]
90 + || ( dev-lang/php[apache2] dev-lang/php[cgi] dev-lang/php[fpm] )
91 + mysql? ( dev-lang/php[mysqli] )
92 + odbc? ( dev-lang/php[odbc] )
93 + oracle? ( dev-lang/php[oci8-instant-client] )
94 + postgres? ( dev-lang/php[postgres] )
95 + sqlite? ( dev-lang/php[sqlite] )
96 + media-libs/gd[png]
97 + app-admin/webapp-config )"
98 +DEPEND="${COMMON_DEPEND}
99 + static? (
100 + ldap? (
101 + net-nds/openldap[static-libs]
102 + =dev-libs/cyrus-sasl-2*[static-libs]
103 + net-libs/gnutls[static-libs]
104 + )
105 + mysql? ( >=virtual/mysql-5.0.3[static] )
106 + sqlite? ( >=dev-db/sqlite-3.3.5[static-libs] )
107 + postgres? ( >=dev-db/postgresql-8.1:*[static-libs] )
108 + libxml2? ( dev-libs/libxml2[static-libs] )
109 + curl? ( net-misc/curl[static-libs] )
110 + ssh? ( net-libs/libssh2 )
111 + odbc? ( dev-db/unixODBC[static-libs] )
112 + )
113 + virtual/pkgconfig"
114 +
115 +S=${WORKDIR}/${MY_P}
116 +
117 +ZABBIXJAVA_BASE="opt/zabbix_java"
118 +
119 +pkg_setup() {
120 + if use oracle; then
121 + if [ -z "${ORACLE_HOME}" ]; then
122 + eerror
123 + eerror "The environment variable ORACLE_HOME must be set"
124 + eerror "and point to the correct location."
125 + eerror "It looks like you don't have Oracle installed."
126 + eerror
127 + die "Environment variable ORACLE_HOME is not set"
128 + fi
129 + if has_version 'dev-db/oracle-instantclient-basic'; then
130 + ewarn
131 + ewarn "Please ensure you have a full install of the Oracle client."
132 + ewarn "dev-db/oracle-instantclient* is NOT sufficient."
133 + ewarn
134 + fi
135 + fi
136 +
137 + if use frontend; then
138 + webapp_pkg_setup
139 + fi
140 +
141 + enewgroup zabbix
142 + enewuser zabbix -1 -1 /var/lib/zabbix/home zabbix
143 +}
144 +
145 +java_prepare() {
146 + cd "${S}/src/zabbix_java/lib"
147 + rm -v *.jar || die
148 +
149 + java-pkg_jar-from slf4j-api
150 +}
151 +
152 +src_prepare() {
153 + eapply -p1 "${FILESDIR}/4.0/patches/zbx401-modulepathfix.patch"
154 + eapply_user
155 +}
156 +
157 +src_configure() {
158 + econf \
159 + $(use_enable server) \
160 + $(use_enable proxy) \
161 + $(use_enable agent) \
162 + $(use_enable ipv6) \
163 + $(use_enable static) \
164 + $(use_enable java) \
165 + $(use_with ldap) \
166 + $(use_with snmp net-snmp) \
167 + $(use_with mysql) \
168 + $(use_with postgres postgresql) \
169 + $(use_with oracle) \
170 + $(use_with sqlite sqlite3) \
171 + $(use_with curl libcurl) \
172 + $(use_with openipmi openipmi) \
173 + $(use_with ssh ssh2) \
174 + $(use_with libxml2) \
175 + $(use_with odbc unixodbc) \
176 + $(use_with ssl openssl)
177 +}
178 +
179 +src_compile() {
180 + if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
181 + emake AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)"
182 + fi
183 +}
184 +
185 +src_install() {
186 + dodir \
187 + /etc/zabbix \
188 + /var/lib/zabbix \
189 + /var/lib/zabbix/home \
190 + /var/lib/zabbix/scripts \
191 + /var/lib/zabbix/alertscripts \
192 + /var/lib/zabbix/externalscripts \
193 + /var/log/zabbix
194 +
195 + keepdir \
196 + /etc/zabbix \
197 + /var/lib/zabbix \
198 + /var/lib/zabbix/home \
199 + /var/lib/zabbix/scripts \
200 + /var/lib/zabbix/alertscripts \
201 + /var/lib/zabbix/externalscripts \
202 + /var/log/zabbix
203 +
204 + if use server; then
205 + insinto /etc/zabbix
206 + doins "${FILESDIR}/3.0"/zabbix_server.conf
207 + doinitd "${FILESDIR}/3.0"/init.d/zabbix-server
208 + dosbin src/zabbix_server/zabbix_server
209 + fowners root:zabbix /etc/zabbix/zabbix_server.conf
210 + fperms 0640 /etc/zabbix/zabbix_server.conf
211 + dodir /usr/share/zabbix
212 + /bin/cp -R "${S}/database/" "${D}"/usr/share/zabbix/
213 + systemd_dounit "${FILESDIR}/zabbix-server.service"
214 + systemd_newtmpfilesd "${FILESDIR}/zabbix-server.tmpfiles" zabbix-server.conf
215 + fi
216 +
217 + if use proxy; then
218 + doinitd "${FILESDIR}/3.0"/init.d/zabbix-proxy
219 + dosbin src/zabbix_proxy/zabbix_proxy
220 + insinto /etc/zabbix
221 + doins "${FILESDIR}/3.0"/zabbix_proxy.conf
222 + fowners root:zabbix /etc/zabbix/zabbix_proxy.conf
223 + fperms 0640 /etc/zabbix/zabbix_proxy.conf
224 + dodir /usr/share/zabbix
225 + /bin/cp -R "${S}/database/" "${D}"/usr/share/zabbix/
226 + systemd_dounit "${FILESDIR}/zabbix-proxy.service"
227 + systemd_newtmpfilesd "${FILESDIR}/zabbix-proxy.tmpfiles" zabbix-proxy.conf
228 + fi
229 +
230 + if use agent; then
231 + insinto /etc/zabbix
232 + doins "${FILESDIR}/3.0"/zabbix_agentd.conf
233 + fowners root:zabbix /etc/zabbix/zabbix_agentd.conf
234 + fperms 0640 /etc/zabbix/zabbix_agentd.conf
235 + doinitd "${FILESDIR}/3.0"/init.d/zabbix-agentd
236 + dosbin src/zabbix_agent/zabbix_agentd
237 + dobin \
238 + src/zabbix_sender/zabbix_sender \
239 + src/zabbix_get/zabbix_get
240 + fperms 0640 /etc/zabbix/zabbix_agentd.conf
241 + systemd_dounit "${FILESDIR}/zabbix-agentd.service"
242 + systemd_newtmpfilesd "${FILESDIR}/zabbix-agentd.tmpfiles" zabbix-agentd.conf
243 + fi
244 +
245 + fowners zabbix:zabbix \
246 + /etc/zabbix \
247 + /var/lib/zabbix \
248 + /var/lib/zabbix/home \
249 + /var/lib/zabbix/scripts \
250 + /var/lib/zabbix/alertscripts \
251 + /var/lib/zabbix/externalscripts \
252 + /var/log/zabbix
253 + fperms 0750 \
254 + /etc/zabbix \
255 + /var/lib/zabbix \
256 + /var/lib/zabbix/home \
257 + /var/lib/zabbix/scripts \
258 + /var/lib/zabbix/alertscripts \
259 + /var/lib/zabbix/externalscripts \
260 + /var/log/zabbix
261 +
262 + dodoc README INSTALL NEWS ChangeLog \
263 + conf/zabbix_agentd.conf \
264 + conf/zabbix_proxy.conf \
265 + conf/zabbix_agentd/userparameter_examples.conf \
266 + conf/zabbix_agentd/userparameter_mysql.conf \
267 + conf/zabbix_server.conf
268 +
269 + if use frontend; then
270 + webapp_src_preinst
271 + cp -R frontends/php/* "${D}/${MY_HTDOCSDIR}"
272 + webapp_configfile \
273 + "${MY_HTDOCSDIR}"/include/db.inc.php \
274 + "${MY_HTDOCSDIR}"/include/config.inc.php
275 + webapp_src_install
276 + fi
277 +
278 + if use java; then
279 + dodir \
280 + /${ZABBIXJAVA_BASE} \
281 + /${ZABBIXJAVA_BASE}/bin \
282 + /${ZABBIXJAVA_BASE}/lib
283 + keepdir /${ZABBIXJAVA_BASE}
284 + exeinto /${ZABBIXJAVA_BASE}/bin
285 + doexe src/zabbix_java/bin/zabbix-java-gateway-${MY_PV}.jar
286 + exeinto /${ZABBIXJAVA_BASE}/lib
287 + doexe \
288 + src/zabbix_java/lib/logback-classic-0.9.27.jar \
289 + src/zabbix_java/lib/logback-console.xml \
290 + src/zabbix_java/lib/logback-core-0.9.27.jar \
291 + src/zabbix_java/lib/logback.xml \
292 + src/zabbix_java/lib/android-json-4.3_r3.1.jar \
293 + src/zabbix_java/lib/slf4j-api-1.6.1.jar
294 + fowners -R zabbix:zabbix /${ZABBIXJAVA_BASE}
295 + doinitd "${FILESDIR}"/3.0/init.d/zabbix-jmx-proxy
296 + doconfd "${FILESDIR}"/3.0/conf.d/zabbix-jmx-proxy
297 + fi
298 +}
299 +
300 +pkg_postinst() {
301 + if use server || use proxy ; then
302 + elog
303 + elog "You may need to configure your database for Zabbix,"
304 + elog "if you have not already done so. "
305 + elog
306 +
307 + zabbix_homedir=$(egethome zabbix)
308 + if [ -n "${zabbix_homedir}" ] && \
309 + [ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then
310 + ewarn
311 + ewarn "The user 'zabbix' should have his homedir changed"
312 + ewarn "to /var/lib/zabbix/home if you want to use"
313 + ewarn "custom alert scripts."
314 + ewarn
315 + ewarn "A real homedir might be needed for configfiles"
316 + ewarn "for custom alert scripts (e.g. ~/.sendxmpprc when"
317 + ewarn "using sendxmpp for Jabber alerts)."
318 + ewarn
319 + ewarn "To change the homedir use:"
320 + ewarn " usermod -d /var/lib/zabbix/home zabbix"
321 + ewarn
322 + fi
323 + fi
324 +
325 + if use server; then
326 + elog
327 + elog "For distributed monitoring you have to run:"
328 + elog
329 + elog "zabbix_server -n <nodeid>"
330 + elog
331 + elog "This will convert database data for use with Node ID"
332 + elog "and also adds a local node."
333 + elog
334 + fi
335 +
336 + elog "--"
337 + elog
338 + elog "You may need to add these lines to /etc/services:"
339 + elog
340 + elog "zabbix-agent 10050/tcp Zabbix Agent"
341 + elog "zabbix-agent 10050/udp Zabbix Agent"
342 + elog "zabbix-trapper 10051/tcp Zabbix Trapper"
343 + elog "zabbix-trapper 10051/udp Zabbix Trapper"
344 + elog
345 +
346 + if use server || use proxy ; then
347 + # check for fping
348 + fping_perms=$(stat -c %a /usr/sbin/fping 2>/dev/null)
349 + case "${fping_perms}" in
350 + 4[157][157][157])
351 + ;;
352 + *)
353 + ewarn
354 + ewarn "If you want to use the checks 'icmpping' and 'icmppingsec',"
355 + ewarn "you have to make /usr/sbin/fping setuid root and executable"
356 + ewarn "by everyone. Run the following command to fix it:"
357 + ewarn
358 + ewarn " chmod u=rwsx,g=rx,o=rx /usr/sbin/fping"
359 + ewarn
360 + ewarn "Please be aware that this might impose a security risk,"
361 + ewarn "depending on the code quality of fping."
362 + ewarn
363 + ;;
364 + esac
365 + fi
366 +}