Gentoo Archives: gentoo-commits

From: "罗百科" <patrick@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/zabbix/
Date: Sun, 27 Oct 2019 13:04:19
Message-Id: 1572181409.45bbf3947435bc1d68b2ae21693747781c4d3e1a.patrick@gentoo
1 commit: 45bbf3947435bc1d68b2ae21693747781c4d3e1a
2 Author: Patrick Lauer <patrick <AT> gentoo <DOT> org>
3 AuthorDate: Sun Oct 27 13:02:03 2019 +0000
4 Commit: 罗百科 <patrick <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 27 13:03:29 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=45bbf394
7
8 net-analyzer/zabbix: Bump to 4.4
9
10 Package-Manager: Portage-2.3.78, Repoman-2.3.17
11 Signed-off-by: Patrick Lauer <patrick <AT> gentoo.org>
12
13 net-analyzer/zabbix/Manifest | 1 +
14 net-analyzer/zabbix/zabbix-4.4.0.ebuild | 336 ++++++++++++++++++++++++++++++++
15 2 files changed, 337 insertions(+)
16
17 diff --git a/net-analyzer/zabbix/Manifest b/net-analyzer/zabbix/Manifest
18 index 83b63d7c71a..fe13523a798 100644
19 --- a/net-analyzer/zabbix/Manifest
20 +++ b/net-analyzer/zabbix/Manifest
21 @@ -3,3 +3,4 @@ DIST zabbix-3.0.28.tar.gz 14706285 BLAKE2B ef7f7e59e229847daa92d1bc4771cd0feb627
22 DIST zabbix-3.4.15.tar.gz 17489570 BLAKE2B 8b820e29334fa7814ab54baef75374955340cb907802722a4f91496a35c7a26fc1c37178c264f606f8a4a95cea350e493763e55f44033eb2aa97ec889664908a SHA512 d210c6576a6c5d67a1f58bb51436c815a191a2ea62f6929784fcac6e0da09febdbb42c11dfb791b6a6d5897dbdda02e10bf56f9162b7f9fb34a57c34b8b1c62f
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
27 diff --git a/net-analyzer/zabbix/zabbix-4.4.0.ebuild b/net-analyzer/zabbix/zabbix-4.4.0.ebuild
28 new file mode 100644
29 index 00000000000..ce4694480bf
30 --- /dev/null
31 +++ b/net-analyzer/zabbix/zabbix-4.4.0.ebuild
32 @@ -0,0 +1,336 @@
33 +# Copyright 1999-2019 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI="6"
37 +
38 +# needed to make webapp-config dep optional
39 +WEBAPP_OPTIONAL="yes"
40 +inherit flag-o-matic webapp java-pkg-opt-2 user systemd toolchain-funcs
41 +
42 +DESCRIPTION="ZABBIX is software for monitoring of your applications, network and servers"
43 +HOMEPAGE="https://www.zabbix.com/"
44 +MY_P=${P/_/}
45 +MY_PV=${PV/_/}
46 +SRC_URI="https://downloads.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/${PV}/${P}.tar.gz"
47 +LICENSE="GPL-2"
48 +SLOT="0"
49 +WEBAPP_MANUAL_SLOT="yes"
50 +KEYWORDS="~amd64 ~x86"
51 +IUSE="+agent java curl frontend ipv6 xmpp ldap libxml2 mysql openipmi oracle +postgres proxy server ssh ssl snmp sqlite odbc static"
52 +REQUIRED_USE="|| ( agent frontend proxy server )
53 + proxy? ( ^^ ( mysql oracle postgres sqlite odbc ) )
54 + server? ( ^^ ( mysql oracle postgres odbc ) )
55 + static? ( !oracle !snmp )"
56 +
57 +COMMON_DEPEND="snmp? ( net-analyzer/net-snmp )
58 + ldap? (
59 + net-nds/openldap
60 + =dev-libs/cyrus-sasl-2*
61 + net-libs/gnutls
62 + )
63 + mysql? ( >=virtual/mysql-5.0.3 )
64 + sqlite? ( >=dev-db/sqlite-3.3.5 )
65 + postgres? ( >=dev-db/postgresql-8.1:* )
66 + oracle? ( >=dev-db/oracle-instantclient-basic-10.0.0.0 )
67 + xmpp? ( dev-libs/iksemel )
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 + ssl? ( dev-libs/openssl:=[-bindist] )"
77 +
78 +RDEPEND="${COMMON_DEPEND}
79 + proxy? ( net-analyzer/fping[suid] )
80 + server? ( net-analyzer/fping[suid]
81 + app-admin/webapp-config
82 + dev-libs/libpcre
83 + dev-libs/libevent )
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-libs] )
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 xmpp jabber) \
172 + $(use_with curl libcurl) \
173 + $(use_with openipmi openipmi) \
174 + $(use_with ssh ssh2) \
175 + $(use_with libxml2) \
176 + $(use_with odbc unixodbc) \
177 + $(use_with ssl openssl) \
178 + || die "econf failed"
179 +}
180 +
181 +src_compile() {
182 + if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
183 + emake AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" || die "emake failed"
184 + fi
185 +}
186 +
187 +src_install() {
188 + dodir \
189 + /etc/zabbix \
190 + /var/lib/zabbix \
191 + /var/lib/zabbix/home \
192 + /var/lib/zabbix/scripts \
193 + /var/lib/zabbix/alertscripts \
194 + /var/lib/zabbix/externalscripts \
195 + /var/log/zabbix
196 +
197 + keepdir \
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 + if use server; then
207 + insinto /etc/zabbix
208 + doins "${FILESDIR}/3.0"/zabbix_server.conf
209 + doinitd "${FILESDIR}/3.0"/init.d/zabbix-server
210 + dosbin src/zabbix_server/zabbix_server
211 + fowners root:zabbix /etc/zabbix/zabbix_server.conf
212 + fperms 0640 /etc/zabbix/zabbix_server.conf
213 + dodir /usr/share/zabbix
214 + /bin/cp -R "${S}/database/" "${D}"/usr/share/zabbix/
215 + systemd_dounit "${FILESDIR}/zabbix-server.service"
216 + systemd_newtmpfilesd "${FILESDIR}/zabbix-server.tmpfiles" zabbix-server.conf
217 + fi
218 +
219 + if use proxy; then
220 + doinitd "${FILESDIR}/3.0"/init.d/zabbix-proxy
221 + dosbin src/zabbix_proxy/zabbix_proxy
222 + insinto /etc/zabbix
223 + doins "${FILESDIR}/3.0"/zabbix_proxy.conf
224 + fowners root:zabbix /etc/zabbix/zabbix_proxy.conf
225 + fperms 0640 /etc/zabbix/zabbix_proxy.conf
226 + dodir /usr/share/zabbix
227 + /bin/cp -R "${S}/database/" "${D}"/usr/share/zabbix/
228 + systemd_dounit "${FILESDIR}/zabbix-proxy.service"
229 + systemd_newtmpfilesd "${FILESDIR}/zabbix-proxy.tmpfiles" zabbix-proxy.conf
230 + fi
231 +
232 + if use agent; then
233 + insinto /etc/zabbix
234 + doins "${FILESDIR}/3.0"/zabbix_agentd.conf
235 + fowners root:zabbix /etc/zabbix/zabbix_agentd.conf
236 + fperms 0640 /etc/zabbix/zabbix_agentd.conf
237 + doinitd "${FILESDIR}/3.0"/init.d/zabbix-agentd
238 + dosbin src/zabbix_agent/zabbix_agentd
239 + dobin \
240 + src/zabbix_sender/zabbix_sender \
241 + src/zabbix_get/zabbix_get
242 + fperms 0640 /etc/zabbix/zabbix_agentd.conf
243 + systemd_dounit "${FILESDIR}/zabbix-agentd.service"
244 + systemd_newtmpfilesd "${FILESDIR}/zabbix-agentd.tmpfiles" zabbix-agentd.conf
245 + fi
246 +
247 + fowners zabbix:zabbix \
248 + /etc/zabbix \
249 + /var/lib/zabbix \
250 + /var/lib/zabbix/home \
251 + /var/lib/zabbix/scripts \
252 + /var/lib/zabbix/alertscripts \
253 + /var/lib/zabbix/externalscripts \
254 + /var/log/zabbix
255 + fperms 0750 \
256 + /etc/zabbix \
257 + /var/lib/zabbix \
258 + /var/lib/zabbix/home \
259 + /var/lib/zabbix/scripts \
260 + /var/lib/zabbix/alertscripts \
261 + /var/lib/zabbix/externalscripts \
262 + /var/log/zabbix
263 +
264 + dodoc README INSTALL NEWS ChangeLog \
265 + conf/zabbix_agentd.conf \
266 + conf/zabbix_proxy.conf \
267 + conf/zabbix_agentd/userparameter_examples.conf \
268 + conf/zabbix_agentd/userparameter_mysql.conf \
269 + conf/zabbix_server.conf
270 +
271 + if use frontend; then
272 + webapp_src_preinst
273 + cp -R frontends/php/* "${D}/${MY_HTDOCSDIR}"
274 + webapp_configfile \
275 + "${MY_HTDOCSDIR}"/include/db.inc.php \
276 + "${MY_HTDOCSDIR}"/include/config.inc.php
277 + webapp_src_install
278 + fi
279 +
280 + if use java; then
281 + dodir \
282 + /${ZABBIXJAVA_BASE} \
283 + /${ZABBIXJAVA_BASE}/bin \
284 + /${ZABBIXJAVA_BASE}/lib
285 + keepdir /${ZABBIXJAVA_BASE}
286 + exeinto /${ZABBIXJAVA_BASE}/bin
287 + doexe src/zabbix_java/bin/zabbix-java-gateway-${MY_PV}.jar
288 + exeinto /${ZABBIXJAVA_BASE}/lib
289 + doexe \
290 + src/zabbix_java/lib/logback-classic-0.9.27.jar \
291 + src/zabbix_java/lib/logback-console.xml \
292 + src/zabbix_java/lib/logback-core-0.9.27.jar \
293 + src/zabbix_java/lib/logback.xml \
294 + src/zabbix_java/lib/android-json-4.3_r3.1.jar \
295 + src/zabbix_java/lib/slf4j-api-1.6.1.jar
296 + fowners -R zabbix:zabbix /${ZABBIXJAVA_BASE}
297 + doinitd "${FILESDIR}"/3.0/init.d/zabbix-jmx-proxy
298 + doconfd "${FILESDIR}"/3.0/conf.d/zabbix-jmx-proxy
299 + fi
300 +}
301 +
302 +pkg_postinst() {
303 + if use server || use proxy ; then
304 + elog
305 + elog "You may need to configure your database for Zabbix,"
306 + elog "if you have not already done so. "
307 + elog
308 +
309 + zabbix_homedir=$(egethome zabbix)
310 + if [ -n "${zabbix_homedir}" ] && \
311 + [ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then
312 + ewarn
313 + ewarn "The user 'zabbix' should have his homedir changed"
314 + ewarn "to /var/lib/zabbix/home if you want to use"
315 + ewarn "custom alert scripts."
316 + ewarn
317 + ewarn "A real homedir might be needed for configfiles"
318 + ewarn "for custom alert scripts (e.g. ~/.sendxmpprc when"
319 + ewarn "using sendxmpp for Jabber alerts)."
320 + ewarn
321 + ewarn "To change the homedir use:"
322 + ewarn " usermod -d /var/lib/zabbix/home zabbix"
323 + ewarn
324 + fi
325 + fi
326 +
327 + if use server; then
328 + elog
329 + elog "For distributed monitoring you have to run:"
330 + elog
331 + elog "zabbix_server -n <nodeid>"
332 + elog
333 + elog "This will convert database data for use with Node ID"
334 + elog "and also adds a local node."
335 + elog
336 + fi
337 +
338 + elog "--"
339 + elog
340 + elog "You may need to add these lines to /etc/services:"
341 + elog
342 + elog "zabbix-agent 10050/tcp Zabbix Agent"
343 + elog "zabbix-agent 10050/udp Zabbix Agent"
344 + elog "zabbix-trapper 10051/tcp Zabbix Trapper"
345 + elog "zabbix-trapper 10051/udp Zabbix Trapper"
346 + elog
347 +
348 + if use server || use proxy ; then
349 + # check for fping
350 + fping_perms=$(stat -c %a /usr/sbin/fping 2>/dev/null)
351 + case "${fping_perms}" in
352 + 4[157][157][157])
353 + ;;
354 + *)
355 + ewarn
356 + ewarn "If you want to use the checks 'icmpping' and 'icmppingsec',"
357 + ewarn "you have to make /usr/sbin/fping setuid root and executable"
358 + ewarn "by everyone. Run the following command to fix it:"
359 + ewarn
360 + ewarn " chmod u=rwsx,g=rx,o=rx /usr/sbin/fping"
361 + ewarn
362 + ewarn "Please be aware that this might impose a security risk,"
363 + ewarn "depending on the code quality of fping."
364 + ewarn
365 + ;;
366 + esac
367 + fi
368 +}