From 9290e61257d087e05741875c074fc77c46ad0505 Mon Sep 17 00:00:00 2001 From: Matthew Marlowe Date: Wed, 2 Oct 2013 22:29:48 +0000 Subject: Added MY_PV bash variable to deal with _rc1 version numbers impacting naming of java jar files. Package-Manager: portage-2.1.11.62/cvs/Linux x86_64 Manifest-Sign-Key: 0x786037A7 --- net-analyzer/zabbix/ChangeLog | 9 +- net-analyzer/zabbix/Manifest | 18 +- net-analyzer/zabbix/zabbix-2.0.9_rc1-r1.ebuild | 397 +++++++++++++++++++++++++ net-analyzer/zabbix/zabbix-2.0.9_rc1.ebuild | 396 ------------------------ 4 files changed, 414 insertions(+), 406 deletions(-) create mode 100644 net-analyzer/zabbix/zabbix-2.0.9_rc1-r1.ebuild delete mode 100644 net-analyzer/zabbix/zabbix-2.0.9_rc1.ebuild (limited to 'net-analyzer/zabbix') diff --git a/net-analyzer/zabbix/ChangeLog b/net-analyzer/zabbix/ChangeLog index 52a54dc8102b..cff1a486a474 100644 --- a/net-analyzer/zabbix/ChangeLog +++ b/net-analyzer/zabbix/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for net-analyzer/zabbix # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/zabbix/ChangeLog,v 1.132 2013/10/02 20:13:21 mattm Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/zabbix/ChangeLog,v 1.133 2013/10/02 22:29:35 mattm Exp $ + +*zabbix-2.0.9_rc1-r1 (02 Oct 2013) + + 02 Oct 2013; Matthew Marlowe +zabbix-2.0.9_rc1-r1.ebuild, + -zabbix-2.0.9_rc1.ebuild: + Added MY_PV bash variable to deal with _rc1 version numbers impacting naming + of java jar files. *zabbix-2.0.9_rc1 (02 Oct 2013) diff --git a/net-analyzer/zabbix/Manifest b/net-analyzer/zabbix/Manifest index 4eb0d972f650..56a2a7f5b4ef 100644 --- a/net-analyzer/zabbix/Manifest +++ b/net-analyzer/zabbix/Manifest @@ -34,17 +34,17 @@ AUX zabbix-1.8.9-as-needed.patch 2737 SHA256 1c9b85c0a9d9161f983a590df387341c516 DIST zabbix-2.0.8.tar.gz 13457936 SHA256 c4b94960de0a1d0b20604a08503e9715c15845409368162c1e321040b8e4519a SHA512 5a65c7fcce33d98a0f441798ca83f16bb6ed31b8a1b025f39c4003a0906c148ed5ff9db41aec591f053083b6bacd3ea1a1c8b96c007c44da092bfa179693e403 WHIRLPOOL 8ae2815014a28895689e8083f21e26f8c0afd7bb5f12a177f8487d563a889941e15db5991668c56a2dad62bf1060a77195057fea6283059a8c4dcd39ff709c05 DIST zabbix-2.0.9rc1.tar.gz 13648577 SHA256 474ac3a0fb47a0f2dc43667948ae40fbe895ae754ae71377ff084cb33c716db3 SHA512 2d67f5850066c6c932b42a2ca371def9bbc77a52b29e8f98bb116261a94df5aa13160f45a5d5c18a856c5c61a0cdb18d73178701e1ee80e476ad6eeb36110963 WHIRLPOOL 44edc34c4b8f81899e55c4d4b9f68bf6b604df3acd15c1d1a5468c5ac2cca9394cc9091e37dfbe0ca71278aebb7d1df9e622ef799bd8e84944f391b0ff5b058b EBUILD zabbix-2.0.8.ebuild 10573 SHA256 0e5969036f51ec7d410a57f817752216d807da506a5ad17c674956e63f4f62dc SHA512 7e7625ea7fe731e490d0a66f12f7b40cbd71b4d262a52010f1ec2914c5e73af40127b51f983a8202f8264cae9ae56f77942d233bbb34cb53ef0cdd488f8e774e WHIRLPOOL 9fd66f46301119ac52fbe0e0145b0e33036ee12677b9532ed2cfe71934553476971cca6c857b86c8b711e5d6a52161e948ec5b9653f9870ce04b183e64dd011c -EBUILD zabbix-2.0.9_rc1.ebuild 10570 SHA256 4f2132e57552ec7b9feab4f0c6a297bbadc1018c150baeaa658554c523ea216c SHA512 75dea8b7fafcd1e4c7f1e782f9d4f8c4ac30641c59e43492efa1c41d854ad824a62cb11754c60800ffc1594130ad51cee3c1e9d069676e98d621e0e7b561ecdd WHIRLPOOL d6e04db08e47681d4cfd6e35ec0e4eec2a2e056c850b9e75f37a5f056e558c764d8ebcf2588575ba52a0e353f4328698b45b3ef8f026f9cc8d5b32c764192c9a -MISC ChangeLog 30967 SHA256 3bea35b8092372485c6418d255f3bd3c3eae57fe2a79d750bf836aaf2334d6a8 SHA512 ffdaa9c2400688468bc192cd582c289c1392e5f1b75574048b7999dbfa10901b9cac70092f8524ac4cfd6fa8bfe5726ec9e808f6257e17324cf6a0c6eddc90fe WHIRLPOOL ac9244c3612b6f1eae118d9c7b8c1bae6a4c5e1b93ae95e376bd095b37ef0ce07f49c1fc96ca1daadc4e7cf0b2fb16bb6a8af8b75a50f7983e9524e58cb39c57 +EBUILD zabbix-2.0.9_rc1-r1.ebuild 10591 SHA256 8d1aa7404139739c3672eb198a117e868823a991f043ea5cf4f8f8817e0d69cf SHA512 fe8b5b25a1a9288f7cc37d8520786670732d2cf38cf4bc04bf29becba5233aa0ff88a758fda7a6ff13c9c9c3f808a048b27e4a0bfdc6493f1d64cc0728f7038a WHIRLPOOL 02db58dda8e041b5221402119daf5443ae5c1f211d947fb2e6ae5d37b19675ec2f3e94971fa4864cf55f8e3dd979414c071fd8100f21496a049b3889efa6f00d +MISC ChangeLog 31211 SHA256 d081aa6f1f87ed79f644e3650628dff183b053ce55f3d75796b0156523b36589 SHA512 69fc98846c17730646d5a5088ebc7589392a4807b7147cc5bda2969b35aac35d242fcc9f8b0fe0129288c135b6648de81a6f1b116577fde321c2d797cd037a0c WHIRLPOOL b7dd6e1c6ec96a4d9db8b4bcf0c81fa27af34b7129066db3811e6ec47066b9b8ec2f14df4a4da331f67c3cd4b4aa939de202ff1f70dea67f4770d0aa7b97c546 MISC metadata.xml 1192 SHA256 a1ad2643da11113f3315b4eb42782f514437c7093badc9d91a921c43f1a79141 SHA512 c4295da1665f2de24d2966a6a434a28c4dbf6a41779eb8f32ed2178b6979c17c92d2f2af042dda759af8a27a6371bbd02378f83846f538ef59954c506ec38cdd WHIRLPOOL 2d07f85c566949b01c169119b117bbda48326480639473636ff7082fd74d355ec40b4e153b29a2595152433ae2800eb775cca8533243d42061aa9f41fed8f0e6 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) -iQEcBAEBCAAGBQJSTH5oAAoJEC1LWXx4YDennXIH/A8kN8Oj4DtQK5SoAg/T5Jbu -JVTrsSd2fOykyrS38F20R+WQvxkikkNjt1glPopfjpUS2UtxP8dj2aIx1akB1KY8 -vLAe0mWb70SNqwAJ5ACpWZIMAt6T3B+grKV/Kf19Vr6+P0aXyWjKc/jQ+SqEK9qF -K8d05sqfEm64TYCLcetnkUTYTGoanV3mgtD6vdz4RZtTwnh3go/pEU5iD92rNn0u -v9y5I+DqRBL/uagRwIpmoTzqp5Z5k+F8v3pSjgah3t+i4nCN2TdpMaHk12MlyMgC -ThAsKPV+bu90Qq/98ZFr6Z7/YbkocKY4rbfaDupYyWytXAi1U1e4Kb+SBIRAwtc= -=paGC +iQEcBAEBCAAGBQJSTJ5XAAoJEC1LWXx4YDenT3UH/0lJsupRsffZblS767jgxpZK +Wr/lsIvOj4AIlHzp6dVmzBz8febdzMUpYqQ23oEAFN7ZFXNYrWS0RwZRlS4PvNT7 +PA2cct5a96Zk0UPeCxyDsYeTSKosWvKuHuaa890n6UG6SSCCl1E5qunpWAIFTFnq +weFC7hGmeplv2BvFP/xo4TAP3rSfo4s1ixIrTm72QjSDiKSDkWZmSD9FTuK6JhuM +CGAoj2mWtauxxsr62nfy67VS/XctFL9ezGkRm9ZpPANBPjy+qJjzSdx2Af+ePFOs +yeKIZH/CO4GbidvprQCbTKm6TtSytfc75FyQZFkCvXaw33pvoAtryCS12lAfdyI= +=n1tA -----END PGP SIGNATURE----- diff --git a/net-analyzer/zabbix/zabbix-2.0.9_rc1-r1.ebuild b/net-analyzer/zabbix/zabbix-2.0.9_rc1-r1.ebuild new file mode 100644 index 000000000000..898cab5b4f49 --- /dev/null +++ b/net-analyzer/zabbix/zabbix-2.0.9_rc1-r1.ebuild @@ -0,0 +1,397 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/zabbix/zabbix-2.0.9_rc1-r1.ebuild,v 1.1 2013/10/02 22:29:35 mattm Exp $ + +EAPI="5" + +# needed to make webapp-config dep optional +WEBAPP_OPTIONAL="yes" +inherit flag-o-matic webapp depend.php autotools java-pkg-opt-2 user toolchain-funcs + +DESCRIPTION="ZABBIX is software for monitoring of your applications, network and servers." +HOMEPAGE="http://www.zabbix.com/" +MY_P=${P/_/} +MY_PV=${PV/_/} +SRC_URI="http://prdownloads.sourceforge.net/zabbix/${MY_P}.tar.gz" +LICENSE="GPL-2" +SLOT="0" +WEBAPP_MANUAL_SLOT="yes" +KEYWORDS="" +IUSE="agent java curl frontend ipv6 jabber ldap mysql openipmi oracle postgres proxy server ssh snmp sqlite iodbc odbc static" + +COMMON_DEPEND="snmp? ( net-analyzer/net-snmp ) + ldap? ( + net-nds/openldap + =dev-libs/cyrus-sasl-2* + net-libs/gnutls + ) + mysql? ( >=virtual/mysql-5.0 ) + sqlite? ( >=dev-db/sqlite-3.3.5 ) + postgres? ( >=dev-db/postgresql-base-8.3.0 ) + oracle? ( >=dev-db/oracle-instantclient-basic-10.0.0.0 ) + jabber? ( dev-libs/iksemel ) + curl? ( net-misc/curl ) + openipmi? ( sys-libs/openipmi ) + ssh? ( net-libs/libssh2 ) + java? ( >=virtual/jdk-1.4 ) + odbc? ( + iodbc? ( dev-db/libiodbc ) + !iodbc? ( dev-db/unixODBC ) + )" + +RDEPEND="${COMMON_DEPEND} + proxy? ( <=net-analyzer/fping-2.9 ) + server? ( <=net-analyzer/fping-2.9 + app-admin/webapp-config ) + java? ( + >=virtual/jre-1.4 + dev-java/slf4j-api + dev-java/json-simple + ) + frontend? ( + dev-lang/php[bcmath,ctype,sockets,gd,truetype,xml,session,xmlreader,xmlwriter,nls,sysvipc,unicode] + || ( dev-lang/php[apache2] dev-lang/php[cgi] dev-lang/php[fpm] ) + media-libs/gd[png] + app-admin/webapp-config )" +DEPEND="${COMMON_DEPEND} + virtual/pkgconfig" + +S=${WORKDIR}/${MY_P} + +ZABBIXJAVA_BASE="opt/zabbix_java" + +java_prepare() { + cd "${S}/src/zabbix_java/lib" + rm -v *.jar || die + + java-pkg_jar-from slf4j-api + java-pkg_jar-from json-simple +} + +src_prepare() { + epatch "${FILESDIR}/2.0/patches/zbx282.patch" + eautoreconf +} + +pkg_setup() { + if use server || use proxy ; then + local dbnum dbtypes="mysql oracle postgres sqlite" dbtype + declare -i dbnum=0 + for dbtype in ${dbtypes}; do + use ${dbtype} && let dbnum++ + done + if [ ${dbnum} -gt 1 ]; then + eerror + eerror "You can't use more than one database type in Zabbix." + eerror "Select exactly one database type out of these: ${dbtypes}" + eerror + die "Multiple database types selected." + elif [ ${dbnum} -lt 1 ]; then + eerror + eerror "Select exactly one database type out of these: ${dbtypes}" + eerror + die "No database type selected." + fi + if use oracle; then + if [ -z "${ORACLE_HOME}" ]; then + eerror + eerror "The environment variable ORACLE_HOME must be set" + eerror "and point to the correct location." + eerror "It looks like you don't have Oracle installed." + eerror + die "Environment variable ORACLE_HOME is not set" + fi + if has_version 'dev-db/oracle-instantclient-basic'; then + ewarn + ewarn "Please ensure you have a full install of the Oracle client." + ewarn "dev-db/oracle-instantclient* is NOT sufficient." + ewarn + fi + fi + fi + + if use frontend; then + webapp_pkg_setup + fi + + enewgroup zabbix + enewuser zabbix -1 -1 /var/lib/zabbix/home zabbix +} + +pkg_postinst() { + if use server || use proxy ; then + elog + elog "You may need to configure your database for Zabbix," + elog "if you have not already done so. Most minor version" + elog "zabbix updates do not require db changes. However, " + elog "you should read the release notes to be sure." + elog + elog "Have a look at /usr/share/zabbix for" + elog "database creation and upgrades." + elog + elog "Execute schema, images, and data sql files in that order." + elog + elog "For more info read the Zabbix manual at" + elog "http://www.zabbix.com/documentation.php" + elog + elog "New use flags: java, odbc, iodbc" + elog + + zabbix_homedir=$(egethome zabbix) + if [ -n "${zabbix_homedir}" ] && \ + [ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then + ewarn + ewarn "The user 'zabbix' should have his homedir changed" + ewarn "to /var/lib/zabbix/home if you want to use" + ewarn "custom alert scripts." + ewarn + ewarn "A real homedir might be needed for configfiles" + ewarn "for custom alert scripts (e.g. ~/.sendxmpprc when" + ewarn "using sendxmpp for Jabber alerts)." + ewarn + ewarn "To change the homedir use:" + ewarn " usermod -d /var/lib/zabbix/home zabbix" + ewarn + fi + fi + + if use server; then + elog + elog "For distributed monitoring you have to run:" + elog + elog "zabbix_server -n " + elog + elog "This will convert database data for use with Node ID" + elog "and also adds a local node." + elog + fi + + elog "--" + elog + elog "You may need to add these lines to /etc/services:" + elog + elog "zabbix-agent 10050/tcp Zabbix Agent" + elog "zabbix-agent 10050/udp Zabbix Agent" + elog "zabbix-trapper 10051/tcp Zabbix Trapper" + elog "zabbix-trapper 10051/udp Zabbix Trapper" + elog + + elog "Zabbix is incompatible with fping 3.0 - (Zabbix bug #ZBX-4894)." + elog + elog "Feel free to download or contribute gentoo specific zabbix templates" + elog "via https://github.com/deploylinux/gentooZabbixTemplates (WIP). We may" + elog "eventually create a seperate package in portage for them." + + # repeat fowners/fperms functionality from src_install() + # here to catch wrong permissions on existing files in + # the live filesystem (yeah, that sucks). + chown -R zabbix:zabbix \ + "${ROOT}"/etc/zabbix \ + "${ROOT}"/var/lib/zabbix \ + "${ROOT}"/var/lib/zabbix/home \ + "${ROOT}"/var/lib/zabbix/scripts \ + "${ROOT}"/var/log/zabbix + chmod 0750 \ + "${ROOT}"/etc/zabbix \ + "${ROOT}"/var/lib/zabbix \ + "${ROOT}"/var/lib/zabbix/home \ + "${ROOT}"/var/lib/zabbix/scripts \ + "${ROOT}"/var/log/zabbix + + chmod 0640 \ + "${ROOT}"/etc/zabbix/zabbix_* + + if use server || use proxy ; then + # check for fping + fping_perms=$(stat -c %a /usr/sbin/fping 2>/dev/null) + case "${fping_perms}" in + 4[157][157][157]) + ;; + *) + ewarn + ewarn "If you want to use the checks 'icmpping' and 'icmppingsec'," + ewarn "you have to make /usr/sbin/fping setuid root and executable" + ewarn "by everyone. Run the following command to fix it:" + ewarn + ewarn " chmod u=rwsx,g=rx,o=rx /usr/sbin/fping" + ewarn + ewarn "Please be aware that this might impose a security risk," + ewarn "depending on the code quality of fping." + ewarn + ebeep 3 + epause 5 + ;; + esac + fi +} + +src_configure() { + + local myconf + + if use odbc && use iodbc ; then + myconf="${myconf} --with-iodbc --without-unixodbc" + elif use odbc && ! use iodbc; then + myconf="${myconf} --with-unixodbc --without-iodbc" + else + myconf="${myconf} --without-unixodbc --without-iodbc" + fi + + econf \ + $myconf \ + $(use_enable server) \ + $(use_enable proxy) \ + $(use_enable agent) \ + $(use_enable ipv6) \ + $(use_enable static) \ + $(use_enable java) \ + $(use_with ldap) \ + $(use_with snmp net-snmp) \ + $(use_with mysql) \ + $(use_with postgres postgresql) \ + $(use_with oracle) \ + $(use_with sqlite sqlite3) \ + $(use_with jabber) \ + $(use_with curl libcurl) \ + $(use_with openipmi openipmi) \ + $(use_with ssh ssh2) \ + || die "econf failed" +} + +src_install() { + dodir \ + /etc/zabbix \ + /var/lib/zabbix \ + /var/lib/zabbix/home \ + /var/lib/zabbix/scripts \ + /var/log/zabbix + + keepdir \ + /etc/zabbix \ + /var/lib/zabbix \ + /var/lib/zabbix/home \ + /var/lib/zabbix/scripts \ + /var/log/zabbix + + if use server; then + insinto /etc/zabbix + doins \ + "${FILESDIR}/1.6.6"/zabbix_server.conf \ + "${FILESDIR}/1.6.6"/zabbix_trapper.conf + doinitd \ + "${FILESDIR}/2.0"/init.d/zabbix-server + dosbin \ + src/zabbix_server/zabbix_server + dodir \ + /usr/share/zabbix + insinto /usr/share/zabbix + doins -r \ + database \ + upgrades + fowners zabbix:zabbix \ + /etc/zabbix/zabbix_server.conf \ + /etc/zabbix/zabbix_trapper.conf + fperms 0640 \ + /etc/zabbix/zabbix_server.conf \ + /etc/zabbix/zabbix_trapper.conf + fi + + if use proxy; then + doinitd \ + "${FILESDIR}/2.0"/init.d/zabbix-proxy + dosbin \ + src/zabbix_proxy/zabbix_proxy + insinto /etc/zabbix + doins \ + "${FILESDIR}/2.0"/zabbix_proxy.conf + dodir \ + /usr/share/zabbix + insinto /usr/share/zabbix + doins -r \ + database \ + create + fi + + if use agent; then + insinto /etc/zabbix + doins \ + "${FILESDIR}/1.6.6"/zabbix_agent.conf \ + "${FILESDIR}/1.6.6"/zabbix_agentd.conf + doinitd \ + "${FILESDIR}/2.0"/init.d/zabbix-agentd + dosbin \ + src/zabbix_agent/zabbix_agent \ + src/zabbix_agent/zabbix_agentd + dobin \ + src/zabbix_sender/zabbix_sender \ + src/zabbix_get/zabbix_get + fowners zabbix:zabbix \ + /etc/zabbix/zabbix_agent.conf \ + /etc/zabbix/zabbix_agentd.conf + fperms 0640 \ + /etc/zabbix/zabbix_agent.conf \ + /etc/zabbix/zabbix_agentd.conf + fi + + fowners zabbix:zabbix \ + /etc/zabbix \ + /var/lib/zabbix \ + /var/lib/zabbix/home \ + /var/lib/zabbix/scripts \ + /var/log/zabbix + fperms 0750 \ + /etc/zabbix \ + /var/lib/zabbix \ + /var/lib/zabbix/home \ + /var/lib/zabbix/scripts \ + /var/log/zabbix + + dodoc README INSTALL NEWS ChangeLog \ + conf/zabbix_agent.conf \ + conf/zabbix_agentd.conf \ + conf/zabbix_proxy.conf \ + conf/zabbix_agentd/userparameter_examples.conf \ + conf/zabbix_agentd/userparameter_mysql.conf \ + conf/zabbix_server.conf + + if use frontend; then + webapp_src_preinst + cp -R frontends/php/* "${D}/${MY_HTDOCSDIR}" + webapp_postinst_txt en "${FILESDIR}/"1.6.6/postinstall-en.txt + webapp_configfile \ + "${MY_HTDOCSDIR}"/include/db.inc.php \ + "${MY_HTDOCSDIR}"/include/config.inc.php + webapp_src_install + fi + + if use java; then + dodir \ + /${ZABBIXJAVA_BASE} \ + /${ZABBIXJAVA_BASE}/bin \ + /${ZABBIXJAVA_BASE}/lib + keepdir /${ZABBIXJAVA_BASE} + exeinto /${ZABBIXJAVA_BASE}/bin + doexe src/zabbix_java/bin/zabbix-java-gateway-${MY_PV}.jar + exeinto /${ZABBIXJAVA_BASE}/lib + doexe \ + src/zabbix_java/lib/logback-classic-0.9.27.jar \ + src/zabbix_java/lib/logback-console.xml \ + src/zabbix_java/lib/logback-core-0.9.27.jar \ + src/zabbix_java/lib/logback.xml \ + src/zabbix_java/lib/org-json-2010-12-28.jar \ + src/zabbix_java/lib/slf4j-api-1.6.1.jar + exeinto /${ZABBIXJAVA_BASE}/ + doexe \ + src/zabbix_java/settings.sh \ + src/zabbix_java/startup.sh \ + src/zabbix_java/shutdown.sh + fowners -R zabbix:zabbix /${ZABBIXJAVA_BASE} + fi + +} + +src_compile() { + if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then + emake AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" || die "emake failed" + fi +} diff --git a/net-analyzer/zabbix/zabbix-2.0.9_rc1.ebuild b/net-analyzer/zabbix/zabbix-2.0.9_rc1.ebuild deleted file mode 100644 index 0f52bc34617b..000000000000 --- a/net-analyzer/zabbix/zabbix-2.0.9_rc1.ebuild +++ /dev/null @@ -1,396 +0,0 @@ -# Copyright 1999-2013 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/zabbix/zabbix-2.0.9_rc1.ebuild,v 1.1 2013/10/02 20:13:21 mattm Exp $ - -EAPI="5" - -# needed to make webapp-config dep optional -WEBAPP_OPTIONAL="yes" -inherit flag-o-matic webapp depend.php autotools java-pkg-opt-2 user toolchain-funcs - -DESCRIPTION="ZABBIX is software for monitoring of your applications, network and servers." -HOMEPAGE="http://www.zabbix.com/" -MY_P=${P/_/} -SRC_URI="http://prdownloads.sourceforge.net/zabbix/${MY_P}.tar.gz" -LICENSE="GPL-2" -SLOT="0" -WEBAPP_MANUAL_SLOT="yes" -KEYWORDS="" -IUSE="agent java curl frontend ipv6 jabber ldap mysql openipmi oracle postgres proxy server ssh snmp sqlite iodbc odbc static" - -COMMON_DEPEND="snmp? ( net-analyzer/net-snmp ) - ldap? ( - net-nds/openldap - =dev-libs/cyrus-sasl-2* - net-libs/gnutls - ) - mysql? ( >=virtual/mysql-5.0 ) - sqlite? ( >=dev-db/sqlite-3.3.5 ) - postgres? ( >=dev-db/postgresql-base-8.3.0 ) - oracle? ( >=dev-db/oracle-instantclient-basic-10.0.0.0 ) - jabber? ( dev-libs/iksemel ) - curl? ( net-misc/curl ) - openipmi? ( sys-libs/openipmi ) - ssh? ( net-libs/libssh2 ) - java? ( >=virtual/jdk-1.4 ) - odbc? ( - iodbc? ( dev-db/libiodbc ) - !iodbc? ( dev-db/unixODBC ) - )" - -RDEPEND="${COMMON_DEPEND} - proxy? ( <=net-analyzer/fping-2.9 ) - server? ( <=net-analyzer/fping-2.9 - app-admin/webapp-config ) - java? ( - >=virtual/jre-1.4 - dev-java/slf4j-api - dev-java/json-simple - ) - frontend? ( - dev-lang/php[bcmath,ctype,sockets,gd,truetype,xml,session,xmlreader,xmlwriter,nls,sysvipc,unicode] - || ( dev-lang/php[apache2] dev-lang/php[cgi] dev-lang/php[fpm] ) - media-libs/gd[png] - app-admin/webapp-config )" -DEPEND="${COMMON_DEPEND} - virtual/pkgconfig" - -S=${WORKDIR}/${MY_P} - -ZABBIXJAVA_BASE="opt/zabbix_java" - -java_prepare() { - cd "${S}/src/zabbix_java/lib" - rm -v *.jar || die - - java-pkg_jar-from slf4j-api - java-pkg_jar-from json-simple -} - -src_prepare() { - epatch "${FILESDIR}/2.0/patches/zbx282.patch" - eautoreconf -} - -pkg_setup() { - if use server || use proxy ; then - local dbnum dbtypes="mysql oracle postgres sqlite" dbtype - declare -i dbnum=0 - for dbtype in ${dbtypes}; do - use ${dbtype} && let dbnum++ - done - if [ ${dbnum} -gt 1 ]; then - eerror - eerror "You can't use more than one database type in Zabbix." - eerror "Select exactly one database type out of these: ${dbtypes}" - eerror - die "Multiple database types selected." - elif [ ${dbnum} -lt 1 ]; then - eerror - eerror "Select exactly one database type out of these: ${dbtypes}" - eerror - die "No database type selected." - fi - if use oracle; then - if [ -z "${ORACLE_HOME}" ]; then - eerror - eerror "The environment variable ORACLE_HOME must be set" - eerror "and point to the correct location." - eerror "It looks like you don't have Oracle installed." - eerror - die "Environment variable ORACLE_HOME is not set" - fi - if has_version 'dev-db/oracle-instantclient-basic'; then - ewarn - ewarn "Please ensure you have a full install of the Oracle client." - ewarn "dev-db/oracle-instantclient* is NOT sufficient." - ewarn - fi - fi - fi - - if use frontend; then - webapp_pkg_setup - fi - - enewgroup zabbix - enewuser zabbix -1 -1 /var/lib/zabbix/home zabbix -} - -pkg_postinst() { - if use server || use proxy ; then - elog - elog "You may need to configure your database for Zabbix," - elog "if you have not already done so. Most minor version" - elog "zabbix updates do not require db changes. However, " - elog "you should read the release notes to be sure." - elog - elog "Have a look at /usr/share/zabbix for" - elog "database creation and upgrades." - elog - elog "Execute schema, images, and data sql files in that order." - elog - elog "For more info read the Zabbix manual at" - elog "http://www.zabbix.com/documentation.php" - elog - elog "New use flags: java, odbc, iodbc" - elog - - zabbix_homedir=$(egethome zabbix) - if [ -n "${zabbix_homedir}" ] && \ - [ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then - ewarn - ewarn "The user 'zabbix' should have his homedir changed" - ewarn "to /var/lib/zabbix/home if you want to use" - ewarn "custom alert scripts." - ewarn - ewarn "A real homedir might be needed for configfiles" - ewarn "for custom alert scripts (e.g. ~/.sendxmpprc when" - ewarn "using sendxmpp for Jabber alerts)." - ewarn - ewarn "To change the homedir use:" - ewarn " usermod -d /var/lib/zabbix/home zabbix" - ewarn - fi - fi - - if use server; then - elog - elog "For distributed monitoring you have to run:" - elog - elog "zabbix_server -n " - elog - elog "This will convert database data for use with Node ID" - elog "and also adds a local node." - elog - fi - - elog "--" - elog - elog "You may need to add these lines to /etc/services:" - elog - elog "zabbix-agent 10050/tcp Zabbix Agent" - elog "zabbix-agent 10050/udp Zabbix Agent" - elog "zabbix-trapper 10051/tcp Zabbix Trapper" - elog "zabbix-trapper 10051/udp Zabbix Trapper" - elog - - elog "Zabbix is incompatible with fping 3.0 - (Zabbix bug #ZBX-4894)." - elog - elog "Feel free to download or contribute gentoo specific zabbix templates" - elog "via https://github.com/deploylinux/gentooZabbixTemplates (WIP). We may" - elog "eventually create a seperate package in portage for them." - - # repeat fowners/fperms functionality from src_install() - # here to catch wrong permissions on existing files in - # the live filesystem (yeah, that sucks). - chown -R zabbix:zabbix \ - "${ROOT}"/etc/zabbix \ - "${ROOT}"/var/lib/zabbix \ - "${ROOT}"/var/lib/zabbix/home \ - "${ROOT}"/var/lib/zabbix/scripts \ - "${ROOT}"/var/log/zabbix - chmod 0750 \ - "${ROOT}"/etc/zabbix \ - "${ROOT}"/var/lib/zabbix \ - "${ROOT}"/var/lib/zabbix/home \ - "${ROOT}"/var/lib/zabbix/scripts \ - "${ROOT}"/var/log/zabbix - - chmod 0640 \ - "${ROOT}"/etc/zabbix/zabbix_* - - if use server || use proxy ; then - # check for fping - fping_perms=$(stat -c %a /usr/sbin/fping 2>/dev/null) - case "${fping_perms}" in - 4[157][157][157]) - ;; - *) - ewarn - ewarn "If you want to use the checks 'icmpping' and 'icmppingsec'," - ewarn "you have to make /usr/sbin/fping setuid root and executable" - ewarn "by everyone. Run the following command to fix it:" - ewarn - ewarn " chmod u=rwsx,g=rx,o=rx /usr/sbin/fping" - ewarn - ewarn "Please be aware that this might impose a security risk," - ewarn "depending on the code quality of fping." - ewarn - ebeep 3 - epause 5 - ;; - esac - fi -} - -src_configure() { - - local myconf - - if use odbc && use iodbc ; then - myconf="${myconf} --with-iodbc --without-unixodbc" - elif use odbc && ! use iodbc; then - myconf="${myconf} --with-unixodbc --without-iodbc" - else - myconf="${myconf} --without-unixodbc --without-iodbc" - fi - - econf \ - $myconf \ - $(use_enable server) \ - $(use_enable proxy) \ - $(use_enable agent) \ - $(use_enable ipv6) \ - $(use_enable static) \ - $(use_enable java) \ - $(use_with ldap) \ - $(use_with snmp net-snmp) \ - $(use_with mysql) \ - $(use_with postgres postgresql) \ - $(use_with oracle) \ - $(use_with sqlite sqlite3) \ - $(use_with jabber) \ - $(use_with curl libcurl) \ - $(use_with openipmi openipmi) \ - $(use_with ssh ssh2) \ - || die "econf failed" -} - -src_install() { - dodir \ - /etc/zabbix \ - /var/lib/zabbix \ - /var/lib/zabbix/home \ - /var/lib/zabbix/scripts \ - /var/log/zabbix - - keepdir \ - /etc/zabbix \ - /var/lib/zabbix \ - /var/lib/zabbix/home \ - /var/lib/zabbix/scripts \ - /var/log/zabbix - - if use server; then - insinto /etc/zabbix - doins \ - "${FILESDIR}/1.6.6"/zabbix_server.conf \ - "${FILESDIR}/1.6.6"/zabbix_trapper.conf - doinitd \ - "${FILESDIR}/2.0"/init.d/zabbix-server - dosbin \ - src/zabbix_server/zabbix_server - dodir \ - /usr/share/zabbix - insinto /usr/share/zabbix - doins -r \ - database \ - upgrades - fowners zabbix:zabbix \ - /etc/zabbix/zabbix_server.conf \ - /etc/zabbix/zabbix_trapper.conf - fperms 0640 \ - /etc/zabbix/zabbix_server.conf \ - /etc/zabbix/zabbix_trapper.conf - fi - - if use proxy; then - doinitd \ - "${FILESDIR}/2.0"/init.d/zabbix-proxy - dosbin \ - src/zabbix_proxy/zabbix_proxy - insinto /etc/zabbix - doins \ - "${FILESDIR}/2.0"/zabbix_proxy.conf - dodir \ - /usr/share/zabbix - insinto /usr/share/zabbix - doins -r \ - database \ - create - fi - - if use agent; then - insinto /etc/zabbix - doins \ - "${FILESDIR}/1.6.6"/zabbix_agent.conf \ - "${FILESDIR}/1.6.6"/zabbix_agentd.conf - doinitd \ - "${FILESDIR}/2.0"/init.d/zabbix-agentd - dosbin \ - src/zabbix_agent/zabbix_agent \ - src/zabbix_agent/zabbix_agentd - dobin \ - src/zabbix_sender/zabbix_sender \ - src/zabbix_get/zabbix_get - fowners zabbix:zabbix \ - /etc/zabbix/zabbix_agent.conf \ - /etc/zabbix/zabbix_agentd.conf - fperms 0640 \ - /etc/zabbix/zabbix_agent.conf \ - /etc/zabbix/zabbix_agentd.conf - fi - - fowners zabbix:zabbix \ - /etc/zabbix \ - /var/lib/zabbix \ - /var/lib/zabbix/home \ - /var/lib/zabbix/scripts \ - /var/log/zabbix - fperms 0750 \ - /etc/zabbix \ - /var/lib/zabbix \ - /var/lib/zabbix/home \ - /var/lib/zabbix/scripts \ - /var/log/zabbix - - dodoc README INSTALL NEWS ChangeLog \ - conf/zabbix_agent.conf \ - conf/zabbix_agentd.conf \ - conf/zabbix_proxy.conf \ - conf/zabbix_agentd/userparameter_examples.conf \ - conf/zabbix_agentd/userparameter_mysql.conf \ - conf/zabbix_server.conf - - if use frontend; then - webapp_src_preinst - cp -R frontends/php/* "${D}/${MY_HTDOCSDIR}" - webapp_postinst_txt en "${FILESDIR}/"1.6.6/postinstall-en.txt - webapp_configfile \ - "${MY_HTDOCSDIR}"/include/db.inc.php \ - "${MY_HTDOCSDIR}"/include/config.inc.php - webapp_src_install - fi - - if use java; then - dodir \ - /${ZABBIXJAVA_BASE} \ - /${ZABBIXJAVA_BASE}/bin \ - /${ZABBIXJAVA_BASE}/lib - keepdir /${ZABBIXJAVA_BASE} - exeinto /${ZABBIXJAVA_BASE}/bin - doexe src/zabbix_java/bin/zabbix-java-gateway-${PV}.jar - exeinto /${ZABBIXJAVA_BASE}/lib - doexe \ - src/zabbix_java/lib/logback-classic-0.9.27.jar \ - src/zabbix_java/lib/logback-console.xml \ - src/zabbix_java/lib/logback-core-0.9.27.jar \ - src/zabbix_java/lib/logback.xml \ - src/zabbix_java/lib/org-json-2010-12-28.jar \ - src/zabbix_java/lib/slf4j-api-1.6.1.jar - exeinto /${ZABBIXJAVA_BASE}/ - doexe \ - src/zabbix_java/settings.sh \ - src/zabbix_java/startup.sh \ - src/zabbix_java/shutdown.sh - fowners -R zabbix:zabbix /${ZABBIXJAVA_BASE} - fi - -} - -src_compile() { - if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then - emake AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" || die "emake failed" - fi -} -- cgit v1.2.3-65-gdbad