Gentoo Archives: gentoo-commits

From: "Matthew Marlow (mattm)" <mattm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-analyzer/zabbix: zabbix-2.2.4.ebuild zabbix-2.0.12-r1.ebuild ChangeLog zabbix-2.0.11_rc1-r1.ebuild zabbix-2.2.3.ebuild
Date: Wed, 25 Jun 2014 20:50:25
Message-Id: 20140625204416.4CBCE2004F@flycatcher.gentoo.org
1 mattm 14/06/25 20:44:16
2
3 Modified: ChangeLog
4 Added: zabbix-2.2.4.ebuild zabbix-2.0.12-r1.ebuild
5 Removed: zabbix-2.0.11_rc1-r1.ebuild zabbix-2.2.3.ebuild
6 Log:
7 Upstream version bump with patch for Security bug 513814, Cleanup for prior security bug 509898
8
9 (Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 786037A7)
10
11 Revision Changes Path
12 1.163 net-analyzer/zabbix/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/zabbix/ChangeLog?rev=1.163&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/zabbix/ChangeLog?rev=1.163&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/zabbix/ChangeLog?r1=1.162&r2=1.163
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/net-analyzer/zabbix/ChangeLog,v
21 retrieving revision 1.162
22 retrieving revision 1.163
23 diff -u -r1.162 -r1.163
24 --- ChangeLog 8 Jun 2014 10:59:17 -0000 1.162
25 +++ ChangeLog 25 Jun 2014 20:44:16 -0000 1.163
26 @@ -1,6 +1,15 @@
27 # ChangeLog for net-analyzer/zabbix
28 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/zabbix/ChangeLog,v 1.162 2014/06/08 10:59:17 ago Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/zabbix/ChangeLog,v 1.163 2014/06/25 20:44:16 mattm Exp $
31 +
32 +*zabbix-2.0.12-r1 (25 Jun 2014)
33 +*zabbix-2.2.4 (25 Jun 2014)
34 +
35 + 25 Jun 2014; Matthew Marlowe <mattm@g.o>
36 + +files/2.2/patches/zbx8151.patch, +zabbix-2.0.12-r1.ebuild,
37 + +zabbix-2.2.4.ebuild, -zabbix-2.0.11_rc1-r1.ebuild, -zabbix-2.2.3.ebuild:
38 + Upstream version bump with patch for Security bug 513814, Cleanup for prior
39 + security bug 509898
40
41 08 Jun 2014; Agostino Sarubbo <ago@g.o> zabbix-2.0.12.ebuild:
42 Stable for x86, wrt bug #509898
43
44
45
46 1.1 net-analyzer/zabbix/zabbix-2.2.4.ebuild
47
48 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/zabbix/zabbix-2.2.4.ebuild?rev=1.1&view=markup
49 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/zabbix/zabbix-2.2.4.ebuild?rev=1.1&content-type=text/plain
50
51 Index: zabbix-2.2.4.ebuild
52 ===================================================================
53 # Copyright 1999-2014 Gentoo Foundation
54 # Distributed under the terms of the GNU General Public License v2
55 # $Header: /var/cvsroot/gentoo-x86/net-analyzer/zabbix/zabbix-2.2.4.ebuild,v 1.1 2014/06/25 20:44:16 mattm Exp $
56
57 EAPI="5"
58
59 # needed to make webapp-config dep optional
60 WEBAPP_OPTIONAL="yes"
61 inherit flag-o-matic webapp depend.php autotools java-pkg-opt-2 user systemd toolchain-funcs
62
63 DESCRIPTION="ZABBIX is software for monitoring of your applications, network and servers."
64 HOMEPAGE="http://www.zabbix.com/"
65 MY_P=${P/_/}
66 MY_PV=${PV/_/}
67 SRC_URI="http://prdownloads.sourceforge.net/zabbix/${MY_P}.tar.gz"
68 LICENSE="GPL-2"
69 SLOT="0"
70 WEBAPP_MANUAL_SLOT="yes"
71 KEYWORDS="~amd64 ~x86"
72 IUSE="agent java curl frontend ipv6 jabber ldap libxml2 mysql openipmi oracle postgres proxy server ssh snmp sqlite odbc static"
73
74 COMMON_DEPEND="snmp? ( net-analyzer/net-snmp )
75 ldap? (
76 net-nds/openldap
77 =dev-libs/cyrus-sasl-2*
78 net-libs/gnutls
79 )
80 mysql? ( >=virtual/mysql-5.0.3 )
81 sqlite? ( >=dev-db/sqlite-3.3.5 )
82 postgres? ( >=dev-db/postgresql-base-8.3.0 )
83 oracle? ( >=dev-db/oracle-instantclient-basic-10.0.0.0 )
84 jabber? ( dev-libs/iksemel )
85 libxml2? ( dev-libs/libxml2 )
86 curl? ( net-misc/curl )
87 openipmi? ( sys-libs/openipmi )
88 ssh? ( net-libs/libssh2 )
89 java? ( >=virtual/jdk-1.4 )
90 odbc? ( dev-db/unixODBC )"
91
92 RDEPEND="${COMMON_DEPEND}
93 proxy? ( <=net-analyzer/fping-2.9 )
94 server? ( <=net-analyzer/fping-2.9
95 app-admin/webapp-config )
96 java? (
97 >=virtual/jre-1.4
98 dev-java/slf4j-api
99 dev-java/json-simple
100 )
101 frontend? (
102 >=dev-lang/php-5.3.0[bcmath,ctype,sockets,gd,truetype,xml,session,xmlreader,xmlwriter,nls,sysvipc,unicode]
103 || ( dev-lang/php[apache2] dev-lang/php[cgi] dev-lang/php[fpm] )
104 media-libs/gd[png]
105 app-admin/webapp-config )"
106 DEPEND="${COMMON_DEPEND}
107 virtual/pkgconfig"
108
109 S=${WORKDIR}/${MY_P}
110
111 ZABBIXJAVA_BASE="opt/zabbix_java"
112
113 java_prepare() {
114 cd "${S}/src/zabbix_java/lib"
115 rm -v *.jar || die
116
117 java-pkg_jar-from slf4j-api
118 java-pkg_jar-from json-simple
119 }
120
121 src_prepare() {
122 epatch "${FILESDIR}/2.2/patches/zbx8151.patch"
123 eautoreconf
124 }
125
126 pkg_setup() {
127 if use server || use proxy ; then
128 local dbnum dbtypes="mysql oracle postgres sqlite" dbtype
129 declare -i dbnum=0
130 for dbtype in ${dbtypes}; do
131 use ${dbtype} && let dbnum++
132 done
133 if [ ${dbnum} -gt 1 ]; then
134 eerror
135 eerror "You can't use more than one database type in Zabbix."
136 eerror "Select exactly one database type out of these: ${dbtypes}"
137 eerror
138 die "Multiple database types selected."
139 elif [ ${dbnum} -lt 1 ]; then
140 eerror
141 eerror "Select exactly one database type out of these: ${dbtypes}"
142 eerror
143 die "No database type selected."
144 fi
145 if use oracle; then
146 if [ -z "${ORACLE_HOME}" ]; then
147 eerror
148 eerror "The environment variable ORACLE_HOME must be set"
149 eerror "and point to the correct location."
150 eerror "It looks like you don't have Oracle installed."
151 eerror
152 die "Environment variable ORACLE_HOME is not set"
153 fi
154 if has_version 'dev-db/oracle-instantclient-basic'; then
155 ewarn
156 ewarn "Please ensure you have a full install of the Oracle client."
157 ewarn "dev-db/oracle-instantclient* is NOT sufficient."
158 ewarn
159 fi
160 fi
161 fi
162
163 if use frontend; then
164 webapp_pkg_setup
165 fi
166
167 enewgroup zabbix
168 enewuser zabbix -1 -1 /var/lib/zabbix/home zabbix
169 }
170
171 pkg_postinst() {
172 if use server || use proxy ; then
173 elog
174 elog "You may need to configure your database for Zabbix,"
175 elog "if you have not already done so. "
176 elog
177
178 zabbix_homedir=$(egethome zabbix)
179 if [ -n "${zabbix_homedir}" ] && \
180 [ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then
181 ewarn
182 ewarn "The user 'zabbix' should have his homedir changed"
183 ewarn "to /var/lib/zabbix/home if you want to use"
184 ewarn "custom alert scripts."
185 ewarn
186 ewarn "A real homedir might be needed for configfiles"
187 ewarn "for custom alert scripts (e.g. ~/.sendxmpprc when"
188 ewarn "using sendxmpp for Jabber alerts)."
189 ewarn
190 ewarn "To change the homedir use:"
191 ewarn " usermod -d /var/lib/zabbix/home zabbix"
192 ewarn
193 fi
194 fi
195
196 if use server; then
197 elog
198 elog "For distributed monitoring you have to run:"
199 elog
200 elog "zabbix_server -n <nodeid>"
201 elog
202 elog "This will convert database data for use with Node ID"
203 elog "and also adds a local node."
204 elog
205 fi
206
207 elog "--"
208 elog
209 elog "You may need to add these lines to /etc/services:"
210 elog
211 elog "zabbix-agent 10050/tcp Zabbix Agent"
212 elog "zabbix-agent 10050/udp Zabbix Agent"
213 elog "zabbix-trapper 10051/tcp Zabbix Trapper"
214 elog "zabbix-trapper 10051/udp Zabbix Trapper"
215 elog
216
217 elog "Feel free to download or contribute gentoo specific zabbix templates"
218 elog "via https://github.com/deploylinux/gentooZabbixTemplates (WIP)."
219
220 # repeat fowners/fperms functionality from src_install()
221 # here to catch wrong permissions on existing files in
222 # the live filesystem (yeah, that sucks).
223 chown -R zabbix:zabbix \
224 "${ROOT}"/etc/zabbix \
225 "${ROOT}"/var/lib/zabbix \
226 "${ROOT}"/var/lib/zabbix/home \
227 "${ROOT}"/var/lib/zabbix/scripts \
228 "${ROOT}"/var/log/zabbix
229 chmod 0750 \
230 "${ROOT}"/etc/zabbix \
231 "${ROOT}"/var/lib/zabbix \
232 "${ROOT}"/var/lib/zabbix/home \
233 "${ROOT}"/var/lib/zabbix/scripts \
234 "${ROOT}"/var/log/zabbix
235
236 chmod 0640 \
237 "${ROOT}"/etc/zabbix/zabbix_*
238
239 if use server || use proxy ; then
240 # check for fping
241 fping_perms=$(stat -c %a /usr/sbin/fping 2>/dev/null)
242 case "${fping_perms}" in
243 4[157][157][157])
244 ;;
245 *)
246 ewarn
247 ewarn "If you want to use the checks 'icmpping' and 'icmppingsec',"
248 ewarn "you have to make /usr/sbin/fping setuid root and executable"
249 ewarn "by everyone. Run the following command to fix it:"
250 ewarn
251 ewarn " chmod u=rwsx,g=rx,o=rx /usr/sbin/fping"
252 ewarn
253 ewarn "Please be aware that this might impose a security risk,"
254 ewarn "depending on the code quality of fping."
255 ewarn
256 ;;
257 esac
258 fi
259 }
260
261 src_configure() {
262
263 econf \
264 $(use_enable server) \
265 $(use_enable proxy) \
266 $(use_enable agent) \
267 $(use_enable ipv6) \
268 $(use_enable static) \
269 $(use_enable java) \
270 $(use_with ldap) \
271 $(use_with snmp net-snmp) \
272 $(use_with mysql) \
273 $(use_with postgres postgresql) \
274 $(use_with oracle) \
275 $(use_with sqlite sqlite3) \
276 $(use_with jabber) \
277 $(use_with curl libcurl) \
278 $(use_with openipmi openipmi) \
279 $(use_with ssh ssh2) \
280 $(use_with libxml2) \
281 $(use_with odbc unixodbc) \
282 || die "econf failed"
283 }
284
285 src_install() {
286 dodir \
287 /etc/zabbix \
288 /var/lib/zabbix \
289 /var/lib/zabbix/home \
290 /var/lib/zabbix/scripts \
291 /var/lib/zabbix/alertscripts \
292 /var/lib/zabbix/externalscripts \
293 /var/log/zabbix
294
295 keepdir \
296 /etc/zabbix \
297 /var/lib/zabbix \
298 /var/lib/zabbix/home \
299 /var/lib/zabbix/scripts \
300 /var/lib/zabbix/alertscripts \
301 /var/lib/zabbix/externalscripts \
302 /var/log/zabbix
303
304 if use server; then
305 insinto /etc/zabbix
306 doins "${FILESDIR}/2.2"/zabbix_server.conf
307 doinitd "${FILESDIR}/2.2"/init.d/zabbix-server
308 dosbin src/zabbix_server/zabbix_server
309 fowners zabbix:zabbix /etc/zabbix/zabbix_server.conf
310 fperms 0640 /etc/zabbix/zabbix_server.conf
311 dodir /usr/share/zabbix
312 /bin/cp -R "${S}/database/" "${D}"/usr/share/zabbix/
313 systemd_dounit "${FILESDIR}/zabbix-server.service"
314 systemd_newtmpfilesd "${FILESDIR}/zabbix-server.tmpfiles" zabbix-server.conf
315 fi
316
317 if use proxy; then
318 doinitd \
319 "${FILESDIR}/2.2"/init.d/zabbix-proxy
320 dosbin \
321 src/zabbix_proxy/zabbix_proxy
322 insinto /etc/zabbix
323 doins \
324 "${FILESDIR}/2.2"/zabbix_proxy.conf
325 dodir /usr/share/zabbix
326 /bin/cp -R "${S}/database/" "${D}"/usr/share/zabbix/
327 systemd_dounit "${FILESDIR}/zabbix-proxy.service"
328 systemd_newtmpfilesd "${FILESDIR}/zabbix-proxy.tmpfiles" zabbix-proxy.conf
329 fi
330
331 if use agent; then
332 insinto /etc/zabbix
333 doins \
334 "${FILESDIR}/2.2"/zabbix_agent.conf \
335 "${FILESDIR}/2.2"/zabbix_agentd.conf
336 doinitd "${FILESDIR}/2.2"/init.d/zabbix-agentd
337 dosbin \
338 src/zabbix_agent/zabbix_agent \
339 src/zabbix_agent/zabbix_agentd
340 dobin \
341 src/zabbix_sender/zabbix_sender \
342 src/zabbix_get/zabbix_get
343 fowners zabbix:zabbix \
344 /etc/zabbix/zabbix_agent.conf \
345 /etc/zabbix/zabbix_agentd.conf
346 fperms 0640 \
347 /etc/zabbix/zabbix_agent.conf \
348 /etc/zabbix/zabbix_agentd.conf
349 systemd_dounit "${FILESDIR}/zabbix-agentd.service"
350 systemd_newtmpfilesd "${FILESDIR}/zabbix-agentd.tmpfiles" zabbix-agentd.conf
351 fi
352
353 fowners zabbix:zabbix \
354 /etc/zabbix \
355 /var/lib/zabbix \
356 /var/lib/zabbix/home \
357 /var/lib/zabbix/scripts \
358 /var/lib/zabbix/alertscripts \
359 /var/lib/zabbix/externalscripts \
360 /var/log/zabbix
361 fperms 0750 \
362 /etc/zabbix \
363 /var/lib/zabbix \
364 /var/lib/zabbix/home \
365 /var/lib/zabbix/scripts \
366 /var/lib/zabbix/alertscripts \
367 /var/lib/zabbix/externalscripts \
368 /var/log/zabbix
369
370 dodoc README INSTALL NEWS ChangeLog \
371 conf/zabbix_agent.conf \
372 conf/zabbix_agentd.conf \
373 conf/zabbix_proxy.conf \
374 conf/zabbix_agentd/userparameter_examples.conf \
375 conf/zabbix_agentd/userparameter_mysql.conf \
376 conf/zabbix_server.conf
377
378 if use frontend; then
379 webapp_src_preinst
380 cp -R frontends/php/* "${D}/${MY_HTDOCSDIR}"
381 webapp_postinst_txt en "${FILESDIR}/"1.6.6/postinstall-en.txt
382 webapp_configfile \
383 "${MY_HTDOCSDIR}"/include/db.inc.php \
384 "${MY_HTDOCSDIR}"/include/config.inc.php
385 webapp_src_install
386 fi
387
388 if use java; then
389 dodir \
390 /${ZABBIXJAVA_BASE} \
391 /${ZABBIXJAVA_BASE}/bin \
392 /${ZABBIXJAVA_BASE}/lib
393 keepdir /${ZABBIXJAVA_BASE}
394 exeinto /${ZABBIXJAVA_BASE}/bin
395 doexe src/zabbix_java/bin/zabbix-java-gateway-${MY_PV}.jar
396 exeinto /${ZABBIXJAVA_BASE}/lib
397 doexe \
398 src/zabbix_java/lib/logback-classic-0.9.27.jar \
399 src/zabbix_java/lib/logback-console.xml \
400 src/zabbix_java/lib/logback-core-0.9.27.jar \
401 src/zabbix_java/lib/logback.xml \
402 src/zabbix_java/lib/org-json-2010-12-28.jar \
403 src/zabbix_java/lib/slf4j-api-1.6.1.jar
404 exeinto /${ZABBIXJAVA_BASE}/
405 doexe \
406 src/zabbix_java/settings.sh \
407 src/zabbix_java/startup.sh \
408 src/zabbix_java/shutdown.sh
409 fowners -R zabbix:zabbix /${ZABBIXJAVA_BASE}
410 fi
411
412 }
413
414 src_compile() {
415 if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
416 emake AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" || die "emake failed"
417 fi
418 }
419
420
421
422 1.1 net-analyzer/zabbix/zabbix-2.0.12-r1.ebuild
423
424 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/zabbix/zabbix-2.0.12-r1.ebuild?rev=1.1&view=markup
425 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/zabbix/zabbix-2.0.12-r1.ebuild?rev=1.1&content-type=text/plain
426
427 Index: zabbix-2.0.12-r1.ebuild
428 ===================================================================
429 # Copyright 1999-2014 Gentoo Foundation
430 # Distributed under the terms of the GNU General Public License v2
431 # $Header: /var/cvsroot/gentoo-x86/net-analyzer/zabbix/zabbix-2.0.12-r1.ebuild,v 1.1 2014/06/25 20:44:16 mattm Exp $
432
433 EAPI="5"
434
435 # needed to make webapp-config dep optional
436 WEBAPP_OPTIONAL="yes"
437 inherit flag-o-matic webapp depend.php autotools java-pkg-opt-2 user toolchain-funcs
438
439 DESCRIPTION="ZABBIX is software for monitoring of your applications, network and servers."
440 HOMEPAGE="http://www.zabbix.com/"
441 MY_P=${P/_/}
442 MY_PV=${PV/_/}
443 SRC_URI="http://prdownloads.sourceforge.net/zabbix/${MY_P}.tar.gz"
444 LICENSE="GPL-2"
445 SLOT="0"
446 WEBAPP_MANUAL_SLOT="yes"
447 KEYWORDS="~amd64 ~x86"
448 IUSE="agent java curl frontend ipv6 jabber ldap mysql openipmi oracle postgres proxy server ssh snmp sqlite iodbc odbc static"
449
450 COMMON_DEPEND="snmp? ( net-analyzer/net-snmp )
451 ldap? (
452 net-nds/openldap
453 =dev-libs/cyrus-sasl-2*
454 net-libs/gnutls
455 )
456 mysql? ( >=virtual/mysql-5.0 )
457 sqlite? ( >=dev-db/sqlite-3.3.5 )
458 postgres? ( >=dev-db/postgresql-base-8.3.0 )
459 oracle? ( >=dev-db/oracle-instantclient-basic-10.0.0.0 )
460 jabber? ( dev-libs/iksemel )
461 curl? ( net-misc/curl )
462 openipmi? ( sys-libs/openipmi )
463 ssh? ( net-libs/libssh2 )
464 java? ( >=virtual/jdk-1.4 )
465 odbc? (
466 iodbc? ( dev-db/libiodbc )
467 !iodbc? ( dev-db/unixODBC )
468 )"
469
470 RDEPEND="${COMMON_DEPEND}
471 proxy? ( <=net-analyzer/fping-2.9 )
472 server? ( <=net-analyzer/fping-2.9
473 app-admin/webapp-config )
474 java? (
475 >=virtual/jre-1.4
476 dev-java/slf4j-api
477 dev-java/json-simple
478 )
479 frontend? (
480 dev-lang/php[bcmath,ctype,sockets,gd,truetype,xml,session,xmlreader,xmlwriter,nls,sysvipc,unicode]
481 || ( dev-lang/php[apache2] dev-lang/php[cgi] dev-lang/php[fpm] )
482 media-libs/gd[png]
483 app-admin/webapp-config )"
484 DEPEND="${COMMON_DEPEND}
485 virtual/pkgconfig"
486
487 S=${WORKDIR}/${MY_P}
488
489 ZABBIXJAVA_BASE="opt/zabbix_java"
490
491 java_prepare() {
492 cd "${S}/src/zabbix_java/lib"
493 rm -v *.jar || die
494
495 java-pkg_jar-from slf4j-api
496 java-pkg_jar-from json-simple
497 }
498
499 src_prepare() {
500 epatch "${FILESDIR}/2.0/patches/zbx282.patch"
501 epatch "${FILESDIR}/2.2/patches/zbx8151.patch"
502 eautoreconf
503 }
504
505 pkg_setup() {
506 if use server || use proxy ; then
507 local dbnum dbtypes="mysql oracle postgres sqlite" dbtype
508 declare -i dbnum=0
509 for dbtype in ${dbtypes}; do
510 use ${dbtype} && let dbnum++
511 done
512 if [ ${dbnum} -gt 1 ]; then
513 eerror
514 eerror "You can't use more than one database type in Zabbix."
515 eerror "Select exactly one database type out of these: ${dbtypes}"
516 eerror
517 die "Multiple database types selected."
518 elif [ ${dbnum} -lt 1 ]; then
519 eerror
520 eerror "Select exactly one database type out of these: ${dbtypes}"
521 eerror
522 die "No database type selected."
523 fi
524 if use oracle; then
525 if [ -z "${ORACLE_HOME}" ]; then
526 eerror
527 eerror "The environment variable ORACLE_HOME must be set"
528 eerror "and point to the correct location."
529 eerror "It looks like you don't have Oracle installed."
530 eerror
531 die "Environment variable ORACLE_HOME is not set"
532 fi
533 if has_version 'dev-db/oracle-instantclient-basic'; then
534 ewarn
535 ewarn "Please ensure you have a full install of the Oracle client."
536 ewarn "dev-db/oracle-instantclient* is NOT sufficient."
537 ewarn
538 fi
539 fi
540 fi
541
542 if use frontend; then
543 webapp_pkg_setup
544 fi
545
546 enewgroup zabbix
547 enewuser zabbix -1 -1 /var/lib/zabbix/home zabbix
548 }
549
550 pkg_postinst() {
551 if use server || use proxy ; then
552 elog
553 elog "You may need to configure your database for Zabbix,"
554 elog "if you have not already done so. Most minor version"
555 elog "zabbix updates do not require db changes. However, "
556 elog "you should read the release notes to be sure."
557 elog
558 elog "Have a look at /usr/share/zabbix for"
559 elog "database creation and upgrades."
560 elog
561 elog "Execute schema, images, and data sql files in that order."
562 elog
563 elog "For more info read the Zabbix manual at"
564 elog "http://www.zabbix.com/documentation.php"
565 elog
566 elog "New use flags: java, odbc, iodbc"
567 elog
568
569 zabbix_homedir=$(egethome zabbix)
570 if [ -n "${zabbix_homedir}" ] && \
571 [ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then
572 ewarn
573 ewarn "The user 'zabbix' should have his homedir changed"
574 ewarn "to /var/lib/zabbix/home if you want to use"
575 ewarn "custom alert scripts."
576 ewarn
577 ewarn "A real homedir might be needed for configfiles"
578 ewarn "for custom alert scripts (e.g. ~/.sendxmpprc when"
579 ewarn "using sendxmpp for Jabber alerts)."
580 ewarn
581 ewarn "To change the homedir use:"
582 ewarn " usermod -d /var/lib/zabbix/home zabbix"
583 ewarn
584 fi
585 fi
586
587 if use server; then
588 elog
589 elog "For distributed monitoring you have to run:"
590 elog
591 elog "zabbix_server -n <nodeid>"
592 elog
593 elog "This will convert database data for use with Node ID"
594 elog "and also adds a local node."
595 elog
596 fi
597
598 elog "--"
599 elog
600 elog "You may need to add these lines to /etc/services:"
601 elog
602 elog "zabbix-agent 10050/tcp Zabbix Agent"
603 elog "zabbix-agent 10050/udp Zabbix Agent"
604 elog "zabbix-trapper 10051/tcp Zabbix Trapper"
605 elog "zabbix-trapper 10051/udp Zabbix Trapper"
606 elog
607
608 elog "Feel free to download or contribute gentoo specific zabbix templates"
609 elog "via https://github.com/deploylinux/gentooZabbixTemplates (WIP)."
610
611 # repeat fowners/fperms functionality from src_install()
612 # here to catch wrong permissions on existing files in
613 # the live filesystem (yeah, that sucks).
614 chown -R zabbix:zabbix \
615 "${ROOT}"/etc/zabbix \
616 "${ROOT}"/var/lib/zabbix \
617 "${ROOT}"/var/lib/zabbix/home \
618 "${ROOT}"/var/lib/zabbix/scripts \
619 "${ROOT}"/var/log/zabbix
620 chmod 0750 \
621 "${ROOT}"/etc/zabbix \
622 "${ROOT}"/var/lib/zabbix \
623 "${ROOT}"/var/lib/zabbix/home \
624 "${ROOT}"/var/lib/zabbix/scripts \
625 "${ROOT}"/var/log/zabbix
626
627 chmod 0640 \
628 "${ROOT}"/etc/zabbix/zabbix_*
629
630 if use server || use proxy ; then
631 # check for fping
632 fping_perms=$(stat -c %a /usr/sbin/fping 2>/dev/null)
633 case "${fping_perms}" in
634 4[157][157][157])
635 ;;
636 *)
637 ewarn
638 ewarn "If you want to use the checks 'icmpping' and 'icmppingsec',"
639 ewarn "you have to make /usr/sbin/fping setuid root and executable"
640 ewarn "by everyone. Run the following command to fix it:"
641 ewarn
642 ewarn " chmod u=rwsx,g=rx,o=rx /usr/sbin/fping"
643 ewarn
644 ewarn "Please be aware that this might impose a security risk,"
645 ewarn "depending on the code quality of fping."
646 ewarn
647 ;;
648 esac
649 fi
650 }
651
652 src_configure() {
653
654 local myconf
655
656 if use odbc && use iodbc ; then
657 myconf="${myconf} --with-iodbc --without-unixodbc"
658 elif use odbc && ! use iodbc; then
659 myconf="${myconf} --with-unixodbc --without-iodbc"
660 else
661 myconf="${myconf} --without-unixodbc --without-iodbc"
662 fi
663
664 econf \
665 $myconf \
666 $(use_enable server) \
667 $(use_enable proxy) \
668 $(use_enable agent) \
669 $(use_enable ipv6) \
670 $(use_enable static) \
671 $(use_enable java) \
672 $(use_with ldap) \
673 $(use_with snmp net-snmp) \
674 $(use_with mysql) \
675 $(use_with postgres postgresql) \
676 $(use_with oracle) \
677 $(use_with sqlite sqlite3) \
678 $(use_with jabber) \
679 $(use_with curl libcurl) \
680 $(use_with openipmi openipmi) \
681 $(use_with ssh ssh2) \
682 || die "econf failed"
683 }
684
685 src_install() {
686 dodir \
687 /etc/zabbix \
688 /var/lib/zabbix \
689 /var/lib/zabbix/home \
690 /var/lib/zabbix/scripts \
691 /var/log/zabbix
692
693 keepdir \
694 /etc/zabbix \
695 /var/lib/zabbix \
696 /var/lib/zabbix/home \
697 /var/lib/zabbix/scripts \
698 /var/log/zabbix
699
700 if use server; then
701 insinto /etc/zabbix
702 doins \
703 "${FILESDIR}/1.6.6"/zabbix_server.conf \
704 "${FILESDIR}/1.6.6"/zabbix_trapper.conf
705 doinitd \
706 "${FILESDIR}/2.0"/init.d/zabbix-server
707 dosbin \
708 src/zabbix_server/zabbix_server
709 dodir \
710 /usr/share/zabbix
711 insinto /usr/share/zabbix
712 doins -r \
713 database \
714 upgrades
715 #remove unneeded files left over from wholesale copy (bug #433708)
716 rm "${ED}"/usr/share/zabbix/{database,upgrades}/Makefile{,.in,.am}
717 fowners zabbix:zabbix \
718 /etc/zabbix/zabbix_server.conf \
719 /etc/zabbix/zabbix_trapper.conf
720 fperms 0640 \
721 /etc/zabbix/zabbix_server.conf \
722 /etc/zabbix/zabbix_trapper.conf
723 fi
724
725 if use proxy; then
726 doinitd \
727 "${FILESDIR}/2.0"/init.d/zabbix-proxy
728 dosbin \
729 src/zabbix_proxy/zabbix_proxy
730 insinto /etc/zabbix
731 doins \
732 "${FILESDIR}/2.0"/zabbix_proxy.conf
733 dodir \
734 /usr/share/zabbix
735 insinto /usr/share/zabbix
736 doins -r \
737 database \
738 upgrades
739 fi
740
741 if use agent; then
742 insinto /etc/zabbix
743 doins \
744 "${FILESDIR}/1.6.6"/zabbix_agent.conf \
745 "${FILESDIR}/1.6.6"/zabbix_agentd.conf
746 doinitd \
747 "${FILESDIR}/2.0"/init.d/zabbix-agentd
748 dosbin \
749 src/zabbix_agent/zabbix_agent \
750 src/zabbix_agent/zabbix_agentd
751 dobin \
752 src/zabbix_sender/zabbix_sender \
753 src/zabbix_get/zabbix_get
754 fowners zabbix:zabbix \
755 /etc/zabbix/zabbix_agent.conf \
756 /etc/zabbix/zabbix_agentd.conf
757 fperms 0640 \
758 /etc/zabbix/zabbix_agent.conf \
759 /etc/zabbix/zabbix_agentd.conf
760 fi
761
762 fowners zabbix:zabbix \
763 /etc/zabbix \
764 /var/lib/zabbix \
765 /var/lib/zabbix/home \
766 /var/lib/zabbix/scripts \
767 /var/log/zabbix
768 fperms 0750 \
769 /etc/zabbix \
770 /var/lib/zabbix \
771 /var/lib/zabbix/home \
772 /var/lib/zabbix/scripts \
773 /var/log/zabbix
774
775 dodoc README INSTALL NEWS ChangeLog \
776 conf/zabbix_agent.conf \
777 conf/zabbix_agentd.conf \
778 conf/zabbix_proxy.conf \
779 conf/zabbix_agentd/userparameter_examples.conf \
780 conf/zabbix_agentd/userparameter_mysql.conf \
781 conf/zabbix_server.conf
782
783 if use frontend; then
784 webapp_src_preinst
785 cp -R frontends/php/* "${D}/${MY_HTDOCSDIR}"
786 webapp_postinst_txt en "${FILESDIR}/"1.6.6/postinstall-en.txt
787 webapp_configfile \
788 "${MY_HTDOCSDIR}"/include/db.inc.php \
789 "${MY_HTDOCSDIR}"/include/config.inc.php
790 webapp_src_install
791 fi
792
793 if use java; then
794 dodir \
795 /${ZABBIXJAVA_BASE} \
796 /${ZABBIXJAVA_BASE}/bin \
797 /${ZABBIXJAVA_BASE}/lib
798 keepdir /${ZABBIXJAVA_BASE}
799 exeinto /${ZABBIXJAVA_BASE}/bin
800 doexe src/zabbix_java/bin/zabbix-java-gateway-${MY_PV}.jar
801 exeinto /${ZABBIXJAVA_BASE}/lib
802 doexe \
803 src/zabbix_java/lib/logback-classic-0.9.27.jar \
804 src/zabbix_java/lib/logback-console.xml \
805 src/zabbix_java/lib/logback-core-0.9.27.jar \
806 src/zabbix_java/lib/logback.xml \
807 src/zabbix_java/lib/org-json-2010-12-28.jar \
808 src/zabbix_java/lib/slf4j-api-1.6.1.jar
809 exeinto /${ZABBIXJAVA_BASE}/
810 doexe \
811 src/zabbix_java/settings.sh \
812 src/zabbix_java/startup.sh \
813 src/zabbix_java/shutdown.sh
814 fowners -R zabbix:zabbix /${ZABBIXJAVA_BASE}
815 fi
816
817 }
818
819 src_compile() {
820 if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
821 emake AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" || die "emake failed"
822 fi
823 }