Gentoo Archives: gentoo-commits

From: Matthew Marlowe <mattm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/zabbix/
Date: Wed, 06 Feb 2019 23:41:24
Message-Id: 1549496464.6d28d47a4fe2070b22bf438696a8ff639fb20606.mattm@gentoo
1 commit: 6d28d47a4fe2070b22bf438696a8ff639fb20606
2 Author: Matthew Marlowe <mattm <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 6 23:38:31 2019 +0000
4 Commit: Matthew Marlowe <mattm <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 6 23:41:04 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6d28d47a
7
8 net-analyzer/zabbix: Minor Versions Bumps, Zabbix 3.0.25 and 4.0.4
9
10 Signed-off-by: Matthew Marlowe <mattm <AT> gentoo.org>
11 Package-Manager: Portage-2.3.51, Repoman-2.3.11
12
13 net-analyzer/zabbix/Manifest | 2 +
14 net-analyzer/zabbix/zabbix-3.0.25.ebuild | 331 ++++++++++++++++++++++++++++++
15 net-analyzer/zabbix/zabbix-4.0.4.ebuild | 333 +++++++++++++++++++++++++++++++
16 3 files changed, 666 insertions(+)
17
18 diff --git a/net-analyzer/zabbix/Manifest b/net-analyzer/zabbix/Manifest
19 index 72768b0f4b0..c45f65c6cb4 100644
20 --- a/net-analyzer/zabbix/Manifest
21 +++ b/net-analyzer/zabbix/Manifest
22 @@ -5,6 +5,7 @@ DIST zabbix-3.0.19.tar.gz 15642128 BLAKE2B b9b84f21371db1eb8efdfb547e2b4a9216e9f
23 DIST zabbix-3.0.20.tar.gz 15653766 BLAKE2B 4c36611e6fa26f9f5a8e3201eea0f08f3c2945542284be0a823751ad39f51deffc450e1994bc685c6179d7e72bd3dd58e0071071cd02446d6d733cddf8d7f916 SHA512 06832600f31f13781b42083a56b8bca18f6a2034b6641b6809e338e374fa08dabbae6c9d54ee711b3dd2ac5017203fea3e0cbf7f70a1a1da60dda43c7e1af00c
24 DIST zabbix-3.0.21.tar.gz 15658030 BLAKE2B 8a943f015ba137c7a161439a31d09bf023bd02bf6ad420c8b02f316adedccf3b23df3775ecea7b27c5b4c893e881f2689cab1c28a4e6c1fe5b79ec08d5d86f43 SHA512 bffe02dac6f009ba8929e0d9ba222ae4bb9da05550f9eaff034fe444ee1c866bd231bb8aa814b7dedc01a5338171b40d461567a7bf619bfccfc523362db579a1
25 DIST zabbix-3.0.22.tar.gz 15669417 BLAKE2B bef6a757324e68d61df8d892c94853ae7044cd66442cfaf2356e6f855af5d177b583aceaed14c31beb0c82e4134d089bfd7c4847c68e2c739f4e9e09a6cfb278 SHA512 fba82d22560c2aa1025b7d89a6ef50a02bda4c7f2408572f1b9624e8a703a798bf3188f9e8def261e564b8e74e63d4a5973e50f93d49058429d51b9699d110a8
26 +DIST zabbix-3.0.25.tar.gz 15595593 BLAKE2B 7ee9f4b1ba07abbc3ec79b06244f5814d6638b5fba36b91f07852ba5779a506e6bf6414d3ed2be30fdb6798299b9441bee05a9127f85215badd9d3c375a93044 SHA512 40b0941f44bfeb8ad7b8d1e285e4f8796139e93815e8dd253c04170bbdb57cd46d9ebb7be7701ea8419ded8446cfed2b072e54ee67a5babc88744d87a713c897
27 DIST zabbix-3.2.11.tar.gz 16099820 BLAKE2B 7038679ecc9ae1b6684d65b3dd0019865e587c82e5a3ffe55610c057f8516ebe34978101065ac31628e6fd54077877c447d64cb1d169e0ad7402e727c7e65d76 SHA512 a14e0af4b183c8deb524c8965700c2988c0c131844f7fbc748aa8d1703b9dad73c2cf6d77663799fbd455adf58fdd1ce8dc5fd6404a9269c1a42160ad0e33e6e
28 DIST zabbix-3.4.10.tar.gz 17300622 BLAKE2B 1b4c275d271ae4d4607400cb6e5f955ba624bf19cd116728e7a71a1b4adc0fbbde8cf91e6b0a71c5d48bf5c38b2ebe0db79f00ba3a42cc4213a0e310d56d5e29 SHA512 25e85cbe7a93a088fa0132ed6f3f75ad1aadedb839d745be38e180f0f9b858e32045b9d057b10cab4d3a8aa770b22b631aa0894fe5f1c3ca4ca62a000934bf94
29 DIST zabbix-3.4.11.tar.gz 17517171 BLAKE2B 72f7d1cad3e8cb7972cb9c3698d35f70c45de1244c14a87f403a0c2c9b1825d679fa32e54dc4b2aae80a24acb7723ce489e0d409fb027c1afc8bb4eccecf9867 SHA512 1360e1de02fbbda30539e0f1dbe9d4aee57bc693f597db011cdefe7e7c4acaa6e3452813ee29e0e614794336e7fc9210ff3458f3761fcec90db66fb4a2275373
30 @@ -14,3 +15,4 @@ DIST zabbix-3.4.14.tar.gz 17476022 BLAKE2B 9fccdf69bb74379fccfe044d68da8ce458e04
31 DIST zabbix-3.4.15.tar.gz 17489570 BLAKE2B 8b820e29334fa7814ab54baef75374955340cb907802722a4f91496a35c7a26fc1c37178c264f606f8a4a95cea350e493763e55f44033eb2aa97ec889664908a SHA512 d210c6576a6c5d67a1f58bb51436c815a191a2ea62f6929784fcac6e0da09febdbb42c11dfb791b6a6d5897dbdda02e10bf56f9162b7f9fb34a57c34b8b1c62f
32 DIST zabbix-4.0.2.tar.gz 18018925 BLAKE2B 8e532bad4d99817a2456d34b3b0b67424b81cd907b2b54329d263194b03ba679c265d78be347f3619ca34b1f4acc8862059c068b3d6b06086913f80f3065eff2 SHA512 40b8dd0a4ca9fd7214c7afab57517437097eaf49c943f8827fa637bffb7cc45e77568f002e18cf3fa61a50d5d24fe26520109ad1c6f0424b51325453c9fd0c76
33 DIST zabbix-4.0.3.tar.gz 18019170 BLAKE2B 0b36ece98ec68ce48c7f38c167c81c4622e454f5626396fdea67092506bcea120c8cc8fd408e2dd4671db44a4c5c0760aa5aba78204d4ad7d124f7d3e62faf35 SHA512 ee8feec85a01c7617d3420529afa59550982c3c51173f8de484a8833099d33cccb84fa4e82f7199bc0ed8af687eb206ae50e4853b824bfbe784f67964cc15e37
34 +DIST zabbix-4.0.4.tar.gz 18045463 BLAKE2B b236bfc4c98aece3efa9af855055fffe8ddb032dc9dbc47564af120914c8cd373a258e1db890fa51581975628bd065fb7c41295d3291460b77575c9d1958cb37 SHA512 cf07c6dc3ea4b3722790d6db9219b81be7cb06cc11925a335b38bc3a7ad3fc395b45f6ba77edaf41eed545796ed2979c7b2f3b11b67fa6f39b76b58320642adb
35
36 diff --git a/net-analyzer/zabbix/zabbix-3.0.25.ebuild b/net-analyzer/zabbix/zabbix-3.0.25.ebuild
37 new file mode 100644
38 index 00000000000..2af6f3cd634
39 --- /dev/null
40 +++ b/net-analyzer/zabbix/zabbix-3.0.25.ebuild
41 @@ -0,0 +1,331 @@
42 +# Copyright 1999-2019 Gentoo Authors
43 +# Distributed under the terms of the GNU General Public License v2
44 +
45 +EAPI="6"
46 +
47 +# needed to make webapp-config dep optional
48 +WEBAPP_OPTIONAL="yes"
49 +inherit flag-o-matic webapp java-pkg-opt-2 user systemd toolchain-funcs
50 +
51 +DESCRIPTION="ZABBIX is software for monitoring of your applications, network and servers"
52 +HOMEPAGE="https://www.zabbix.com/"
53 +MY_P=${P/_/}
54 +MY_PV=${PV/_/}
55 +SRC_URI="https://prdownloads.sourceforge.net/zabbix/${MY_P}.tar.gz"
56 +LICENSE="GPL-2"
57 +SLOT="0"
58 +WEBAPP_MANUAL_SLOT="yes"
59 +KEYWORDS=""
60 +IUSE="+agent java curl frontend ipv6 xmpp ldap libxml2 mysql openipmi oracle postgres proxy server ssh ssl snmp sqlite odbc static"
61 +REQUIRED_USE="|| ( agent frontend proxy server )
62 + proxy? ( ^^ ( mysql oracle postgres sqlite odbc ) )
63 + server? ( ^^ ( mysql oracle postgres sqlite odbc ) )
64 + static? ( !oracle !snmp )"
65 +
66 +COMMON_DEPEND="snmp? ( net-analyzer/net-snmp )
67 + ldap? (
68 + net-nds/openldap
69 + =dev-libs/cyrus-sasl-2*
70 + net-libs/gnutls
71 + )
72 + mysql? ( >=virtual/mysql-5.0.3 )
73 + sqlite? ( >=dev-db/sqlite-3.3.5 )
74 + postgres? ( dev-db/postgresql:* )
75 + oracle? ( >=dev-db/oracle-instantclient-basic-10.0.0.0 )
76 + xmpp? ( dev-libs/iksemel )
77 + libxml2? ( dev-libs/libxml2 )
78 + curl? ( net-misc/curl )
79 + openipmi? ( sys-libs/openipmi )
80 + ssh? ( net-libs/libssh2 )
81 + java? ( virtual/jdk:* )
82 + odbc? ( dev-db/unixODBC )
83 + ssl? ( dev-libs/openssl:=[-bindist] )"
84 +
85 +RDEPEND="${COMMON_DEPEND}
86 + proxy? ( net-analyzer/fping )
87 + server? ( net-analyzer/fping
88 + app-admin/webapp-config )
89 + java? (
90 + >=virtual/jre-1.4
91 + dev-java/slf4j-api
92 + )
93 + frontend? (
94 + >=dev-lang/php-5.3.0[bcmath,ctype,sockets,gd,truetype,xml,session,xmlreader,xmlwriter,nls,sysvipc,unicode]
95 + || ( dev-lang/php[apache2] dev-lang/php[cgi] dev-lang/php[fpm] )
96 + mysql? ( dev-lang/php[mysqli] )
97 + odbc? ( dev-lang/php[odbc] )
98 + oracle? ( dev-lang/php[oci8-instant-client] )
99 + postgres? ( dev-lang/php[postgres] )
100 + sqlite? ( dev-lang/php[sqlite] )
101 + media-libs/gd[png]
102 + app-admin/webapp-config )"
103 +DEPEND="${COMMON_DEPEND}
104 + static? (
105 + ldap? (
106 + net-nds/openldap[static-libs]
107 + =dev-libs/cyrus-sasl-2*[static-libs]
108 + net-libs/gnutls[static-libs]
109 + )
110 + mysql? ( >=virtual/mysql-5.0.3[static-libs] )
111 + sqlite? ( >=dev-db/sqlite-3.3.5[static-libs] )
112 + postgres? ( dev-db/postgresql:*[static-libs] )
113 + libxml2? ( dev-libs/libxml2[static-libs] )
114 + curl? ( net-misc/curl[static-libs] )
115 + ssh? ( net-libs/libssh2[static-libs] )
116 + odbc? ( dev-db/unixODBC[static-libs] )
117 + )
118 + virtual/pkgconfig"
119 +
120 +S=${WORKDIR}/${MY_P}
121 +
122 +ZABBIXJAVA_BASE="opt/zabbix_java"
123 +
124 +pkg_setup() {
125 + if use oracle; then
126 + if [ -z "${ORACLE_HOME}" ]; then
127 + eerror
128 + eerror "The environment variable ORACLE_HOME must be set"
129 + eerror "and point to the correct location."
130 + eerror "It looks like you don't have Oracle installed."
131 + eerror
132 + die "Environment variable ORACLE_HOME is not set"
133 + fi
134 + if has_version 'dev-db/oracle-instantclient-basic'; then
135 + ewarn
136 + ewarn "Please ensure you have a full install of the Oracle client."
137 + ewarn "dev-db/oracle-instantclient* is NOT sufficient."
138 + ewarn
139 + fi
140 + fi
141 +
142 + if use frontend; then
143 + webapp_pkg_setup
144 + fi
145 +
146 + enewgroup zabbix
147 + enewuser zabbix -1 -1 /var/lib/zabbix/home zabbix
148 +}
149 +
150 +java_prepare() {
151 + cd "${S}/src/zabbix_java/lib"
152 + rm -v *.jar || die
153 +
154 + java-pkg_jar-from slf4j-api
155 +}
156 +
157 +src_prepare() {
158 + default
159 +}
160 +
161 +src_configure() {
162 + econf \
163 + $(use_enable server) \
164 + $(use_enable proxy) \
165 + $(use_enable agent) \
166 + $(use_enable ipv6) \
167 + $(use_enable static) \
168 + $(use_enable java) \
169 + $(use_with ldap) \
170 + $(use_with snmp net-snmp) \
171 + $(use_with mysql) \
172 + $(use_with postgres postgresql) \
173 + $(use_with oracle) \
174 + $(use_with sqlite sqlite3) \
175 + $(use_with xmpp jabber) \
176 + $(use_with curl libcurl) \
177 + $(use_with openipmi openipmi) \
178 + $(use_with ssh ssh2) \
179 + $(use_with libxml2) \
180 + $(use_with odbc unixodbc) \
181 + $(use_with ssl openssl) \
182 + || die "econf failed"
183 +}
184 +
185 +src_compile() {
186 + if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
187 + emake AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" || die "emake failed"
188 + fi
189 +}
190 +
191 +src_install() {
192 + dodir \
193 + /etc/zabbix \
194 + /var/lib/zabbix \
195 + /var/lib/zabbix/home \
196 + /var/lib/zabbix/scripts \
197 + /var/lib/zabbix/alertscripts \
198 + /var/lib/zabbix/externalscripts \
199 + /var/log/zabbix
200 +
201 + keepdir \
202 + /etc/zabbix \
203 + /var/lib/zabbix \
204 + /var/lib/zabbix/home \
205 + /var/lib/zabbix/scripts \
206 + /var/lib/zabbix/alertscripts \
207 + /var/lib/zabbix/externalscripts \
208 + /var/log/zabbix
209 +
210 + if use server; then
211 + insinto /etc/zabbix
212 + doins "${FILESDIR}/3.0"/zabbix_server.conf
213 + doinitd "${FILESDIR}/3.0"/init.d/zabbix-server
214 + dosbin src/zabbix_server/zabbix_server
215 + fowners zabbix:zabbix /etc/zabbix/zabbix_server.conf
216 + fperms 0640 /etc/zabbix/zabbix_server.conf
217 + dodir /usr/share/zabbix
218 + /bin/cp -R "${S}/database/" "${D}"/usr/share/zabbix/
219 + systemd_dounit "${FILESDIR}/zabbix-server.service"
220 + systemd_newtmpfilesd "${FILESDIR}/zabbix-server.tmpfiles" zabbix-server.conf
221 + fi
222 +
223 + if use proxy; then
224 + doinitd "${FILESDIR}/3.0"/init.d/zabbix-proxy
225 + dosbin src/zabbix_proxy/zabbix_proxy
226 + insinto /etc/zabbix
227 + doins "${FILESDIR}/3.0"/zabbix_proxy.conf
228 + dodir /usr/share/zabbix
229 + /bin/cp -R "${S}/database/" "${D}"/usr/share/zabbix/
230 + systemd_dounit "${FILESDIR}/zabbix-proxy.service"
231 + systemd_newtmpfilesd "${FILESDIR}/zabbix-proxy.tmpfiles" zabbix-proxy.conf
232 + fi
233 +
234 + if use agent; then
235 + insinto /etc/zabbix
236 + doins "${FILESDIR}/3.0"/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 + fowners zabbix:zabbix /etc/zabbix/zabbix_agentd.conf
243 + fperms 0640 /etc/zabbix/zabbix_agentd.conf
244 + systemd_dounit "${FILESDIR}/zabbix-agentd.service"
245 + systemd_newtmpfilesd "${FILESDIR}/zabbix-agentd.tmpfiles" zabbix-agentd.conf
246 + fi
247 +
248 + fowners zabbix:zabbix \
249 + /etc/zabbix \
250 + /var/lib/zabbix \
251 + /var/lib/zabbix/home \
252 + /var/lib/zabbix/scripts \
253 + /var/lib/zabbix/alertscripts \
254 + /var/lib/zabbix/externalscripts \
255 + /var/log/zabbix
256 + fperms 0750 \
257 + /etc/zabbix \
258 + /var/lib/zabbix \
259 + /var/lib/zabbix/home \
260 + /var/lib/zabbix/scripts \
261 + /var/lib/zabbix/alertscripts \
262 + /var/lib/zabbix/externalscripts \
263 + /var/log/zabbix
264 +
265 + dodoc README INSTALL NEWS ChangeLog \
266 + conf/zabbix_agentd.conf \
267 + conf/zabbix_proxy.conf \
268 + conf/zabbix_agentd/userparameter_examples.conf \
269 + conf/zabbix_agentd/userparameter_mysql.conf \
270 + conf/zabbix_server.conf
271 +
272 + if use frontend; then
273 + webapp_src_preinst
274 + cp -R frontends/php/* "${D}/${MY_HTDOCSDIR}"
275 + webapp_configfile \
276 + "${MY_HTDOCSDIR}"/include/db.inc.php \
277 + "${MY_HTDOCSDIR}"/include/config.inc.php
278 + webapp_src_install
279 + fi
280 +
281 + if use java; then
282 + dodir \
283 + /${ZABBIXJAVA_BASE} \
284 + /${ZABBIXJAVA_BASE}/bin \
285 + /${ZABBIXJAVA_BASE}/lib
286 + keepdir /${ZABBIXJAVA_BASE}
287 + exeinto /${ZABBIXJAVA_BASE}/bin
288 + doexe src/zabbix_java/bin/zabbix-java-gateway-${MY_PV}.jar
289 + exeinto /${ZABBIXJAVA_BASE}/lib
290 + doexe \
291 + src/zabbix_java/lib/logback-classic-0.9.27.jar \
292 + src/zabbix_java/lib/logback-console.xml \
293 + src/zabbix_java/lib/logback-core-0.9.27.jar \
294 + src/zabbix_java/lib/logback.xml \
295 + src/zabbix_java/lib/android-json-4.3_r3.1.jar \
296 + src/zabbix_java/lib/slf4j-api-1.6.1.jar
297 + exeinto /${ZABBIXJAVA_BASE}/
298 + doexe \
299 + src/zabbix_java/settings.sh \
300 + src/zabbix_java/startup.sh \
301 + src/zabbix_java/shutdown.sh
302 + fowners -R zabbix:zabbix /${ZABBIXJAVA_BASE}
303 + fi
304 +}
305 +
306 +pkg_postinst() {
307 + if use server || use proxy ; then
308 + elog
309 + elog "You may need to configure your database for Zabbix,"
310 + elog "if you have not already done so. "
311 + elog
312 +
313 + zabbix_homedir=$(egethome zabbix)
314 + if [ -n "${zabbix_homedir}" ] && \
315 + [ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then
316 + ewarn
317 + ewarn "The user 'zabbix' should have his homedir changed"
318 + ewarn "to /var/lib/zabbix/home if you want to use"
319 + ewarn "custom alert scripts."
320 + ewarn
321 + ewarn "A real homedir might be needed for configfiles"
322 + ewarn "for custom alert scripts (e.g. ~/.sendxmpprc when"
323 + ewarn "using sendxmpp for Jabber alerts)."
324 + ewarn
325 + ewarn "To change the homedir use:"
326 + ewarn " usermod -d /var/lib/zabbix/home zabbix"
327 + ewarn
328 + fi
329 + fi
330 +
331 + if use server; then
332 + elog
333 + elog "For distributed monitoring you have to run:"
334 + elog
335 + elog "zabbix_server -n <nodeid>"
336 + elog
337 + elog "This will convert database data for use with Node ID"
338 + elog "and also adds a local node."
339 + elog
340 + fi
341 +
342 + elog "--"
343 + elog
344 + elog "You may need to add these lines to /etc/services:"
345 + elog
346 + elog "zabbix-agent 10050/tcp Zabbix Agent"
347 + elog "zabbix-agent 10050/udp Zabbix Agent"
348 + elog "zabbix-trapper 10051/tcp Zabbix Trapper"
349 + elog "zabbix-trapper 10051/udp Zabbix Trapper"
350 + elog
351 +
352 + if use server || use proxy ; then
353 + # check for fping
354 + fping_perms=$(stat -c %a /usr/sbin/fping 2>/dev/null)
355 + case "${fping_perms}" in
356 + 4[157][157][157])
357 + ;;
358 + *)
359 + ewarn
360 + ewarn "If you want to use the checks 'icmpping' and 'icmppingsec',"
361 + ewarn "you have to make /usr/sbin/fping setuid root and executable"
362 + ewarn "by everyone. Run the following command to fix it:"
363 + ewarn
364 + ewarn " chmod u=rwsx,g=rx,o=rx /usr/sbin/fping"
365 + ewarn
366 + ewarn "Please be aware that this might impose a security risk,"
367 + ewarn "depending on the code quality of fping."
368 + ewarn
369 + ;;
370 + esac
371 + fi
372 +}
373
374 diff --git a/net-analyzer/zabbix/zabbix-4.0.4.ebuild b/net-analyzer/zabbix/zabbix-4.0.4.ebuild
375 new file mode 100644
376 index 00000000000..6f3e1a57879
377 --- /dev/null
378 +++ b/net-analyzer/zabbix/zabbix-4.0.4.ebuild
379 @@ -0,0 +1,333 @@
380 +# Copyright 1999-2019 Gentoo Authors
381 +# Distributed under the terms of the GNU General Public License v2
382 +
383 +EAPI="6"
384 +
385 +# needed to make webapp-config dep optional
386 +WEBAPP_OPTIONAL="yes"
387 +inherit flag-o-matic webapp java-pkg-opt-2 user systemd toolchain-funcs
388 +
389 +DESCRIPTION="ZABBIX is software for monitoring of your applications, network and servers"
390 +HOMEPAGE="https://www.zabbix.com/"
391 +MY_P=${P/_/}
392 +MY_PV=${PV/_/}
393 +SRC_URI="https://prdownloads.sourceforge.net/zabbix/${MY_P}.tar.gz"
394 +LICENSE="GPL-2"
395 +SLOT="0"
396 +WEBAPP_MANUAL_SLOT="yes"
397 +KEYWORDS=""
398 +IUSE="+agent java curl frontend ipv6 xmpp ldap libxml2 mysql openipmi oracle +postgres proxy server ssh ssl snmp sqlite odbc static"
399 +REQUIRED_USE="|| ( agent frontend proxy server )
400 + proxy? ( ^^ ( mysql oracle postgres sqlite odbc ) )
401 + server? ( ^^ ( mysql oracle postgres odbc ) )
402 + static? ( !oracle !snmp )"
403 +
404 +COMMON_DEPEND="snmp? ( net-analyzer/net-snmp )
405 + ldap? (
406 + net-nds/openldap
407 + =dev-libs/cyrus-sasl-2*
408 + net-libs/gnutls
409 + )
410 + mysql? ( >=virtual/mysql-5.0.3 )
411 + sqlite? ( >=dev-db/sqlite-3.3.5 )
412 + postgres? ( >=dev-db/postgresql-8.1:* )
413 + oracle? ( >=dev-db/oracle-instantclient-basic-10.0.0.0 )
414 + xmpp? ( dev-libs/iksemel )
415 + libxml2? ( dev-libs/libxml2 )
416 + curl? ( net-misc/curl )
417 + openipmi? ( sys-libs/openipmi )
418 + ssh? ( net-libs/libssh2 )
419 + java? ( virtual/jdk:* )
420 + odbc? ( dev-db/unixODBC )
421 + server? ( sys-libs/zlib )
422 + proxy? ( sys-libs/zlib )
423 + ssl? ( dev-libs/openssl:=[-bindist] )"
424 +
425 +RDEPEND="${COMMON_DEPEND}
426 + proxy? ( net-analyzer/fping[suid] )
427 + server? ( net-analyzer/fping[suid]
428 + app-admin/webapp-config
429 + dev-libs/libpcre
430 + dev-libs/libevent )
431 + java? (
432 + >=virtual/jre-1.4
433 + dev-java/slf4j-api
434 + )
435 + frontend? (
436 + >=dev-lang/php-5.4.0[bcmath,ctype,sockets,gd,truetype,xml,session,xmlreader,xmlwriter,nls,sysvipc,unicode]
437 + || ( dev-lang/php[apache2] dev-lang/php[cgi] dev-lang/php[fpm] )
438 + mysql? ( dev-lang/php[mysqli] )
439 + odbc? ( dev-lang/php[odbc] )
440 + oracle? ( dev-lang/php[oci8-instant-client] )
441 + postgres? ( dev-lang/php[postgres] )
442 + sqlite? ( dev-lang/php[sqlite] )
443 + media-libs/gd[png]
444 + app-admin/webapp-config )"
445 +DEPEND="${COMMON_DEPEND}
446 + static? (
447 + ldap? (
448 + net-nds/openldap[static-libs]
449 + =dev-libs/cyrus-sasl-2*[static-libs]
450 + net-libs/gnutls[static-libs]
451 + )
452 + mysql? ( >=virtual/mysql-5.0.3[static-libs] )
453 + sqlite? ( >=dev-db/sqlite-3.3.5[static-libs] )
454 + postgres? ( >=dev-db/postgresql-8.1:*[static-libs] )
455 + libxml2? ( dev-libs/libxml2[static-libs] )
456 + curl? ( net-misc/curl[static-libs] )
457 + ssh? ( net-libs/libssh2[static-libs] )
458 + odbc? ( dev-db/unixODBC[static-libs] )
459 + )
460 + virtual/pkgconfig"
461 +
462 +S=${WORKDIR}/${MY_P}
463 +
464 +ZABBIXJAVA_BASE="opt/zabbix_java"
465 +
466 +pkg_setup() {
467 + if use oracle; then
468 + if [ -z "${ORACLE_HOME}" ]; then
469 + eerror
470 + eerror "The environment variable ORACLE_HOME must be set"
471 + eerror "and point to the correct location."
472 + eerror "It looks like you don't have Oracle installed."
473 + eerror
474 + die "Environment variable ORACLE_HOME is not set"
475 + fi
476 + if has_version 'dev-db/oracle-instantclient-basic'; then
477 + ewarn
478 + ewarn "Please ensure you have a full install of the Oracle client."
479 + ewarn "dev-db/oracle-instantclient* is NOT sufficient."
480 + ewarn
481 + fi
482 + fi
483 +
484 + if use frontend; then
485 + webapp_pkg_setup
486 + fi
487 +
488 + enewgroup zabbix
489 + enewuser zabbix -1 -1 /var/lib/zabbix/home zabbix
490 +}
491 +
492 +java_prepare() {
493 + cd "${S}/src/zabbix_java/lib"
494 + rm -v *.jar || die
495 +
496 + java-pkg_jar-from slf4j-api
497 +}
498 +
499 +src_prepare() {
500 + eapply -p1 "${FILESDIR}/4.0/patches/zbx401-modulepathfix.patch"
501 + eapply_user
502 +}
503 +
504 +src_configure() {
505 + econf \
506 + $(use_enable server) \
507 + $(use_enable proxy) \
508 + $(use_enable agent) \
509 + $(use_enable ipv6) \
510 + $(use_enable static) \
511 + $(use_enable java) \
512 + $(use_with ldap) \
513 + $(use_with snmp net-snmp) \
514 + $(use_with mysql) \
515 + $(use_with postgres postgresql) \
516 + $(use_with oracle) \
517 + $(use_with sqlite sqlite3) \
518 + $(use_with xmpp jabber) \
519 + $(use_with curl libcurl) \
520 + $(use_with openipmi openipmi) \
521 + $(use_with ssh ssh2) \
522 + $(use_with libxml2) \
523 + $(use_with odbc unixodbc) \
524 + $(use_with ssl openssl) \
525 + || die "econf failed"
526 +}
527 +
528 +src_compile() {
529 + if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
530 + emake AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" || die "emake failed"
531 + fi
532 +}
533 +
534 +src_install() {
535 + dodir \
536 + /etc/zabbix \
537 + /var/lib/zabbix \
538 + /var/lib/zabbix/home \
539 + /var/lib/zabbix/scripts \
540 + /var/lib/zabbix/alertscripts \
541 + /var/lib/zabbix/externalscripts \
542 + /var/log/zabbix
543 +
544 + keepdir \
545 + /etc/zabbix \
546 + /var/lib/zabbix \
547 + /var/lib/zabbix/home \
548 + /var/lib/zabbix/scripts \
549 + /var/lib/zabbix/alertscripts \
550 + /var/lib/zabbix/externalscripts \
551 + /var/log/zabbix
552 +
553 + if use server; then
554 + insinto /etc/zabbix
555 + doins "${FILESDIR}/3.0"/zabbix_server.conf
556 + doinitd "${FILESDIR}/3.0"/init.d/zabbix-server
557 + dosbin src/zabbix_server/zabbix_server
558 + fowners zabbix:zabbix /etc/zabbix/zabbix_server.conf
559 + fperms 0640 /etc/zabbix/zabbix_server.conf
560 + dodir /usr/share/zabbix
561 + /bin/cp -R "${S}/database/" "${D}"/usr/share/zabbix/
562 + systemd_dounit "${FILESDIR}/zabbix-server.service"
563 + systemd_newtmpfilesd "${FILESDIR}/zabbix-server.tmpfiles" zabbix-server.conf
564 + fi
565 +
566 + if use proxy; then
567 + doinitd "${FILESDIR}/3.0"/init.d/zabbix-proxy
568 + dosbin src/zabbix_proxy/zabbix_proxy
569 + insinto /etc/zabbix
570 + doins "${FILESDIR}/3.0"/zabbix_proxy.conf
571 + dodir /usr/share/zabbix
572 + /bin/cp -R "${S}/database/" "${D}"/usr/share/zabbix/
573 + systemd_dounit "${FILESDIR}/zabbix-proxy.service"
574 + systemd_newtmpfilesd "${FILESDIR}/zabbix-proxy.tmpfiles" zabbix-proxy.conf
575 + fi
576 +
577 + if use agent; then
578 + insinto /etc/zabbix
579 + doins "${FILESDIR}/3.0"/zabbix_agentd.conf
580 + doinitd "${FILESDIR}/3.0"/init.d/zabbix-agentd
581 + dosbin src/zabbix_agent/zabbix_agentd
582 + dobin \
583 + src/zabbix_sender/zabbix_sender \
584 + src/zabbix_get/zabbix_get
585 + fowners zabbix:zabbix /etc/zabbix/zabbix_agentd.conf
586 + fperms 0640 /etc/zabbix/zabbix_agentd.conf
587 + systemd_dounit "${FILESDIR}/zabbix-agentd.service"
588 + systemd_newtmpfilesd "${FILESDIR}/zabbix-agentd.tmpfiles" zabbix-agentd.conf
589 + fi
590 +
591 + fowners zabbix:zabbix \
592 + /etc/zabbix \
593 + /var/lib/zabbix \
594 + /var/lib/zabbix/home \
595 + /var/lib/zabbix/scripts \
596 + /var/lib/zabbix/alertscripts \
597 + /var/lib/zabbix/externalscripts \
598 + /var/log/zabbix
599 + fperms 0750 \
600 + /etc/zabbix \
601 + /var/lib/zabbix \
602 + /var/lib/zabbix/home \
603 + /var/lib/zabbix/scripts \
604 + /var/lib/zabbix/alertscripts \
605 + /var/lib/zabbix/externalscripts \
606 + /var/log/zabbix
607 +
608 + dodoc README INSTALL NEWS ChangeLog \
609 + conf/zabbix_agentd.conf \
610 + conf/zabbix_proxy.conf \
611 + conf/zabbix_agentd/userparameter_examples.conf \
612 + conf/zabbix_agentd/userparameter_mysql.conf \
613 + conf/zabbix_server.conf
614 +
615 + if use frontend; then
616 + webapp_src_preinst
617 + cp -R frontends/php/* "${D}/${MY_HTDOCSDIR}"
618 + webapp_configfile \
619 + "${MY_HTDOCSDIR}"/include/db.inc.php \
620 + "${MY_HTDOCSDIR}"/include/config.inc.php
621 + webapp_src_install
622 + fi
623 +
624 + if use java; then
625 + dodir \
626 + /${ZABBIXJAVA_BASE} \
627 + /${ZABBIXJAVA_BASE}/bin \
628 + /${ZABBIXJAVA_BASE}/lib
629 + keepdir /${ZABBIXJAVA_BASE}
630 + exeinto /${ZABBIXJAVA_BASE}/bin
631 + doexe src/zabbix_java/bin/zabbix-java-gateway-${MY_PV}.jar
632 + exeinto /${ZABBIXJAVA_BASE}/lib
633 + doexe \
634 + src/zabbix_java/lib/logback-classic-0.9.27.jar \
635 + src/zabbix_java/lib/logback-console.xml \
636 + src/zabbix_java/lib/logback-core-0.9.27.jar \
637 + src/zabbix_java/lib/logback.xml \
638 + src/zabbix_java/lib/android-json-4.3_r3.1.jar \
639 + src/zabbix_java/lib/slf4j-api-1.6.1.jar
640 + fowners -R zabbix:zabbix /${ZABBIXJAVA_BASE}
641 + doinitd "${FILESDIR}"/3.0/init.d/zabbix-jmx-proxy
642 + doconfd "${FILESDIR}"/3.0/conf.d/zabbix-jmx-proxy
643 + fi
644 +}
645 +
646 +pkg_postinst() {
647 + if use server || use proxy ; then
648 + elog
649 + elog "You may need to configure your database for Zabbix,"
650 + elog "if you have not already done so. "
651 + elog
652 +
653 + zabbix_homedir=$(egethome zabbix)
654 + if [ -n "${zabbix_homedir}" ] && \
655 + [ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then
656 + ewarn
657 + ewarn "The user 'zabbix' should have his homedir changed"
658 + ewarn "to /var/lib/zabbix/home if you want to use"
659 + ewarn "custom alert scripts."
660 + ewarn
661 + ewarn "A real homedir might be needed for configfiles"
662 + ewarn "for custom alert scripts (e.g. ~/.sendxmpprc when"
663 + ewarn "using sendxmpp for Jabber alerts)."
664 + ewarn
665 + ewarn "To change the homedir use:"
666 + ewarn " usermod -d /var/lib/zabbix/home zabbix"
667 + ewarn
668 + fi
669 + fi
670 +
671 + if use server; then
672 + elog
673 + elog "For distributed monitoring you have to run:"
674 + elog
675 + elog "zabbix_server -n <nodeid>"
676 + elog
677 + elog "This will convert database data for use with Node ID"
678 + elog "and also adds a local node."
679 + elog
680 + fi
681 +
682 + elog "--"
683 + elog
684 + elog "You may need to add these lines to /etc/services:"
685 + elog
686 + elog "zabbix-agent 10050/tcp Zabbix Agent"
687 + elog "zabbix-agent 10050/udp Zabbix Agent"
688 + elog "zabbix-trapper 10051/tcp Zabbix Trapper"
689 + elog "zabbix-trapper 10051/udp Zabbix Trapper"
690 + elog
691 +
692 + if use server || use proxy ; then
693 + # check for fping
694 + fping_perms=$(stat -c %a /usr/sbin/fping 2>/dev/null)
695 + case "${fping_perms}" in
696 + 4[157][157][157])
697 + ;;
698 + *)
699 + ewarn
700 + ewarn "If you want to use the checks 'icmpping' and 'icmppingsec',"
701 + ewarn "you have to make /usr/sbin/fping setuid root and executable"
702 + ewarn "by everyone. Run the following command to fix it:"
703 + ewarn
704 + ewarn " chmod u=rwsx,g=rx,o=rx /usr/sbin/fping"
705 + ewarn
706 + ewarn "Please be aware that this might impose a security risk,"
707 + ewarn "depending on the code quality of fping."
708 + ewarn
709 + ;;
710 + esac
711 + fi
712 +}