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