# Copyright 2014 Kevin Decherf # Distributed under the terms of the GNU General Public License v2 require systemd-service SUMMARY="Enterprise-class Monitoring Tool" HOMEPAGE="http://www.zabbix.com" DOWNLOADS="mirror://sourceforge/zabbix/zabbix-${PV}.tar.gz" LICENCES="GPL-2" SLOT="0" PLATFORMS="~amd64" MYOPTIONS=" ipv6 snmp ( providers: libressl openssl ) [[ number-selected = exactly-one ]] " DEPENDENCIES=" build+run: dev-db/sqlite:3 providers:libressl? ( dev-libs/libressl:= ) providers:openssl? ( dev-libs/openssl:= ) group/zabbix user/zabbix snmp? ( net/net-snmp ) suggestion: net-analyzer/zabbix-agent " WORK="${WORKBASE}"/zabbix-${PV} DEFAULT_SRC_CONFIGURE_OPTION_ENABLES=( 'ipv6') DEFAULT_SRC_CONFIGURE_OPTION_WITHS=( 'snmp net-snmp' ) DEFAULT_SRC_CONFIGURE_PARAMS=( '--disable-agent' '--disable-server' '--enable-proxy' "--sysconfdir=/etc/zabbix" '--with-openssl' '--with-sqlite3' '--without-mbedtls' '--without-gnutls' ) DEFAULT_SRC_COMPILE_PARAMS=( AR=${AR} RANLIB=${RANLIB} ) DEFAULT_SRC_INSTALL_PARAMS=( AR=${AR} RANLIB=${RANLIB} ) src_install() { default local db_target=/usr/share/zabbix/database install_systemd_files insinto /usr/$(exhost --target)/lib/tmpfiles.d doins "${FILES}"/tmpfiles.d/zabbix-proxy.conf KEEPDIRS=( /etc/zabbix/zabbix_proxy.conf.d /usr/share/zabbix/externalscripts /usr/share/zabbix/alertscripts ) keepdir ${KEEPDIRS[@]} # This line is mandatory for systemd and can be useful for other init systems sed -i -e 's@^\(# PidFile.*\)@\1\nPidFile=/run/zabbix/zabbix-proxy.pid@' \ "${IMAGE}"/etc/zabbix/zabbix_proxy.conf elog "The database is not configured, schemes are available in /usr/share/zabbix/database" dodir "${db_target}" insinto "${db_target}" doins -r "${WORK}"/database/sqlite3 # Remove empty dirs edo find "${IMAGE}" -type d -empty -delete }