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