Gentoo Archives: gentoo-commits

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