2013-04-23 16:20:25 +02:00
|
|
|
# Created by: Jim Riggs <ports@christianserving.org>
|
2009-12-13 23:30:18 +01:00
|
|
|
# $FreeBSD$
|
|
|
|
|
2012-08-15 16:28:31 +02:00
|
|
|
PORTNAME= zabbix2
|
2013-08-31 07:33:55 +02:00
|
|
|
PORTVERSION= 2.0.8
|
|
|
|
PORTREVISION?= 0
|
2009-12-13 23:30:18 +01:00
|
|
|
CATEGORIES= net-mgmt
|
|
|
|
MASTER_SITES= SF/zabbix/ZABBIX%20Latest%20Stable/${PORTVERSION}
|
|
|
|
PKGNAMESUFFIX?= -server
|
2012-08-15 16:28:31 +02:00
|
|
|
DISTNAME= zabbix-${PORTVERSION}
|
2009-12-13 23:30:18 +01:00
|
|
|
|
2012-08-15 16:28:31 +02:00
|
|
|
MAINTAINER= pakhom706@gmail.com
|
2009-12-13 23:30:18 +01:00
|
|
|
COMMENT= Enterprise-class open source distributed monitoring (${PKGNAMESUFFIX:S/^-//})
|
|
|
|
|
2011-04-22 17:07:36 +02:00
|
|
|
LICENSE= GPLv2
|
|
|
|
|
2012-08-15 16:28:31 +02:00
|
|
|
CONFLICTS= ${PKGBASE}-1.[0-8]*
|
2009-12-13 23:30:18 +01:00
|
|
|
|
|
|
|
.if ${PKGNAMESUFFIX} != "-agent"
|
2012-08-15 16:28:31 +02:00
|
|
|
CONFLICTS+= ${PORTNAME}-1.[0-8]*
|
2009-12-13 23:30:18 +01:00
|
|
|
.endif
|
|
|
|
|
|
|
|
ZABBIX_BUILD= ${PKGNAMESUFFIX:S/^-//}
|
|
|
|
|
|
|
|
.if ${ZABBIX_BUILD} != "frontend" # frontend only needs the version/distribution settings
|
|
|
|
.if ${ZABBIX_BUILD} != "agent"
|
2012-08-15 16:28:31 +02:00
|
|
|
MAN8+= zabbix_${ZABBIX_BUILD}.8
|
|
|
|
USE_RC_SUBR= zabbix_${ZABBIX_BUILD}
|
2009-12-13 23:30:18 +01:00
|
|
|
.else
|
2012-08-15 16:28:31 +02:00
|
|
|
MAN1+= zabbix_get.1 zabbix_sender.1
|
|
|
|
MAN8+= zabbix_${ZABBIX_BUILD}d.8
|
|
|
|
USE_RC_SUBR= zabbix_${ZABBIX_BUILD}d
|
2009-12-13 23:30:18 +01:00
|
|
|
.endif
|
|
|
|
|
2013-04-27 13:59:28 +02:00
|
|
|
USES= pkgconfig iconv
|
2012-08-15 16:28:31 +02:00
|
|
|
|
2009-12-13 23:30:18 +01:00
|
|
|
USERS= zabbix
|
|
|
|
GROUPS= zabbix
|
|
|
|
|
2012-08-15 16:28:31 +02:00
|
|
|
.if ${ZABBIX_BUILD} != "proxy"
|
|
|
|
PLIST_SUB= PROXY="@comment "
|
|
|
|
.else
|
|
|
|
PLIST_SUB= PROXY=""
|
|
|
|
.endif
|
|
|
|
|
2013-05-09 00:05:49 +02:00
|
|
|
.if ${ZABBIX_BUILD} == "server"
|
|
|
|
PLIST_SUB+= SERVER=""
|
|
|
|
.else
|
|
|
|
PLIST_SUB+= SERVER="@comment "
|
|
|
|
.endif
|
|
|
|
|
2013-09-23 16:26:59 +02:00
|
|
|
PLIST_SUB+= ZABBIX_BUILD=${ZABBIX_BUILD} PORTVERSION=${PORTVERSION}
|
2009-12-18 17:10:14 +01:00
|
|
|
SUB_LIST= ZABBIX_BUILD=${ZABBIX_BUILD} ZABBIX_REQUIRE=${ZABBIX_REQUIRE}
|
2009-12-13 23:30:18 +01:00
|
|
|
|
|
|
|
MAKE_ARGS+= ARCH=freebsd
|
|
|
|
GNU_CONFIGURE= yes
|
2012-08-15 16:28:31 +02:00
|
|
|
CONFIGURE_ARGS+= --enable-${ZABBIX_BUILD} \
|
|
|
|
--sysconfdir=${ETCDIR} \
|
|
|
|
--datadir=${ETCDIR}
|
2009-12-13 23:30:18 +01:00
|
|
|
|
|
|
|
.if ${ZABBIX_BUILD} != "agent"
|
2009-12-18 17:10:14 +01:00
|
|
|
LIB_DEPENDS= netsnmp:${PORTSDIR}/net-mgmt/net-snmp \
|
2011-04-22 17:07:36 +02:00
|
|
|
execinfo:${PORTSDIR}/devel/libexecinfo
|
2009-12-18 17:10:14 +01:00
|
|
|
|
|
|
|
SUB_FILES= pkg-message
|
|
|
|
|
|
|
|
CONFIGURE_ARGS+= --with-net-snmp
|
|
|
|
|
2009-12-13 23:30:18 +01:00
|
|
|
OPTIONSFILE= ${PORT_DBDIR}/${PORTNAME}${PKGNAMESUFFIX}/options
|
2012-08-15 16:28:31 +02:00
|
|
|
|
2012-12-13 04:58:50 +01:00
|
|
|
OPTIONS_DEFINE= IPV6 FPING JABBER CURL LDAP IPMI SSH NMAP ODBC JAVAGW
|
2012-08-15 16:28:31 +02:00
|
|
|
OPTIONS_DEFAULT= MYSQL IPV6 FPING JABBER CURL LDAP
|
|
|
|
|
|
|
|
CURL_DESC= Support for web monitoring
|
|
|
|
FPING_DESC= Build/install fping for ping checks
|
|
|
|
IPMI_DESC= Support for IPMI checks
|
|
|
|
JABBER_DESC= Support for Jabber media type
|
|
|
|
LDAP_DESC= Support for LDAP server checks
|
|
|
|
NMAP_DESC= Build/install nmap for o/s detection
|
|
|
|
SSH_DESC= Support for SSH-based checks
|
|
|
|
ODBC_DESC= Support for database checks via ODBC
|
2012-12-13 04:58:50 +01:00
|
|
|
JAVAGW_DESC= Support for Java gateway
|
2012-08-15 16:28:31 +02:00
|
|
|
IODBC_DESC= Use iODBC for ODBC support
|
|
|
|
UNIXODBC_DESC= Use UnixODBC for ODBC support
|
|
|
|
|
|
|
|
OPTIONS_SINGLE= DB ODBC
|
|
|
|
OPTIONS_SINGLE_DB= MYSQL PGSQL SQLITE
|
|
|
|
OPTIONS_SINGLE_ODBC= IODBC UNIXODBC
|
2009-12-13 23:30:18 +01:00
|
|
|
|
2013-09-21 00:24:43 +02:00
|
|
|
NO_STAGE= yes
|
2009-12-13 23:30:18 +01:00
|
|
|
.include <bsd.port.options.mk>
|
|
|
|
|
2012-08-15 16:28:31 +02:00
|
|
|
.if ${PORT_OPTIONS:MMYSQL}
|
2009-12-18 17:10:14 +01:00
|
|
|
ZABBIX_REQUIRE= " mysql"
|
2009-12-13 23:30:18 +01:00
|
|
|
USE_MYSQL= yes
|
|
|
|
CONFIGURE_ARGS+= --with-mysql
|
2012-08-15 16:28:31 +02:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${PORT_OPTIONS:MPGSQL}
|
2009-12-18 17:10:14 +01:00
|
|
|
ZABBIX_REQUIRE= " postgresql"
|
2009-12-13 23:30:18 +01:00
|
|
|
USE_PGSQL= yes
|
2012-08-15 16:28:31 +02:00
|
|
|
CONFIGURE_ARGS+= --with-postgresql
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${PORT_OPTIONS:MSQLITE}
|
2009-12-18 17:10:14 +01:00
|
|
|
ZABBIX_REQUIRE=
|
2010-04-02 14:08:29 +02:00
|
|
|
USE_SQLITE= 3
|
2009-12-13 23:30:18 +01:00
|
|
|
CONFIGURE_ARGS+= --with-sqlite3
|
|
|
|
.endif
|
|
|
|
|
2012-08-15 16:28:31 +02:00
|
|
|
.if ${PORT_OPTIONS:MCURL}
|
2011-04-22 17:07:36 +02:00
|
|
|
LIB_DEPENDS+= curl:${PORTSDIR}/ftp/curl
|
|
|
|
CONFIGURE_ARGS+= --with-libcurl
|
2010-08-23 22:15:43 +02:00
|
|
|
.endif
|
|
|
|
|
2012-08-15 16:28:31 +02:00
|
|
|
.if ${PORT_OPTIONS:MLDAP}
|
2009-12-13 23:30:18 +01:00
|
|
|
USE_OPENLDAP= yes
|
|
|
|
CONFIGURE_ARGS+= --with-ldap
|
|
|
|
.endif
|
|
|
|
|
2012-08-15 16:28:31 +02:00
|
|
|
.if ${PORT_OPTIONS:MIPMI}
|
2010-06-30 21:43:40 +02:00
|
|
|
LIB_DEPENDS+= OpenIPMI:${PORTSDIR}/sysutils/openipmi
|
|
|
|
CONFIGURE_ARGS+= --with-openipmi
|
|
|
|
.endif
|
|
|
|
|
2012-08-15 16:28:31 +02:00
|
|
|
.if ${PORT_OPTIONS:MJABBER}
|
2009-12-13 23:30:18 +01:00
|
|
|
LIB_DEPENDS+= iksemel:${PORTSDIR}/textproc/iksemel
|
|
|
|
CONFIGURE_ARGS+= --with-jabber
|
|
|
|
.endif
|
|
|
|
|
2012-08-15 16:28:31 +02:00
|
|
|
.if ${PORT_OPTIONS:MFPING}
|
2009-12-13 23:30:18 +01:00
|
|
|
RUN_DEPENDS+= fping:${PORTSDIR}/net/fping
|
|
|
|
.endif
|
2010-04-02 14:08:29 +02:00
|
|
|
|
2012-08-15 16:28:31 +02:00
|
|
|
.if ${PORT_OPTIONS:MSSH}
|
2010-04-02 14:08:29 +02:00
|
|
|
LIB_DEPENDS+= ssh2:${PORTSDIR}/security/libssh2
|
|
|
|
CONFIGURE_ARGS+= --with-ssh2
|
|
|
|
.endif
|
2010-08-23 22:15:43 +02:00
|
|
|
|
2012-08-15 16:28:31 +02:00
|
|
|
.if ${PORT_OPTIONS:MIODBC}
|
2010-08-23 22:15:43 +02:00
|
|
|
LIB_DEPENDS+= iodbc:${PORTSDIR}/databases/libiodbc
|
|
|
|
CONFIGURE_ARGS+= --with-iodbc
|
|
|
|
.endif
|
|
|
|
|
2012-08-15 16:28:31 +02:00
|
|
|
.if ${PORT_OPTIONS:MUNIXODBC}
|
2010-08-23 22:15:43 +02:00
|
|
|
LIB_DEPENDS+= odbc:${PORTSDIR}/databases/unixODBC
|
|
|
|
CONFIGURE_ARGS+= --with-unixodbc
|
|
|
|
.endif
|
2009-12-13 23:30:18 +01:00
|
|
|
.endif # if ${ZABBIX_BUILD} != "agent"
|
|
|
|
|
2012-08-15 16:28:31 +02:00
|
|
|
.if ${PORT_OPTIONS:MIPV6}
|
2009-12-13 23:30:18 +01:00
|
|
|
CONFIGURE_ARGS+= --enable-ipv6
|
|
|
|
.endif
|
|
|
|
|
2012-08-15 16:28:31 +02:00
|
|
|
.if ${PORT_OPTIONS:MNMAP}
|
|
|
|
RUN_DEPENDS+= nmap:${PORTSDIR}/security/nmap \
|
|
|
|
sudo:${PORTSDIR}/security/sudo
|
|
|
|
.endif
|
|
|
|
|
2012-12-13 04:58:50 +01:00
|
|
|
.if ${PORT_OPTIONS:MJAVAGW}
|
2013-08-31 07:33:55 +02:00
|
|
|
USE_JAVA= yes
|
|
|
|
CONFIGURE_ARGS+= --enable-java
|
2012-12-13 04:58:50 +01:00
|
|
|
PLIST_SUB+= ZABBIX_JAVA="sbin/zabbix_java"
|
2013-08-31 07:33:55 +02:00
|
|
|
PLIST_SUB+= JAVAGW=""
|
2012-12-13 04:58:50 +01:00
|
|
|
.else
|
2013-08-31 07:33:55 +02:00
|
|
|
PLIST_SUB+= JAVAGW="@comment "
|
2012-12-13 04:58:50 +01:00
|
|
|
.endif
|
|
|
|
|
2009-12-13 23:30:18 +01:00
|
|
|
post-patch:
|
|
|
|
@${GREP} -rl "/etc/zabbix" ${WRKSRC} \
|
2011-10-15 03:26:35 +02:00
|
|
|
| ${XARGS} ${REINPLACE_CMD} -e 's#/etc/zabbix#${ETCDIR}#g'
|
2012-08-15 16:28:31 +02:00
|
|
|
@${REINPLACE_CMD} -e 's#/usr/sbin/fping#${LOCALBASE}/sbin/fping#g' ${WRKSRC}/conf/zabbix_*.conf
|
2009-12-13 23:30:18 +01:00
|
|
|
|
|
|
|
.if ${ZABBIX_BUILD} != "agent"
|
2012-08-15 16:28:31 +02:00
|
|
|
.if empty(PORT_OPTIONS:MFPING)
|
|
|
|
@${ECHO} 'DisablePinger=yes' >> ${WRKSRC}/conf/zabbix_${ZABBIX_BUILD}.conf
|
|
|
|
.endif
|
|
|
|
.for d in mysql oracle postgresql sqlite3
|
|
|
|
@${REINPLACE_CMD} -e 's|/bin/ping|/sbin/ping|g; \
|
|
|
|
s|/usr/bin/traceroute|/usr/sbin/traceroute|g; \
|
|
|
|
s|sudo /usr/bin/nmap|sudo ${LOCALBASE}/bin/nmap|g;' \
|
|
|
|
${WRKSRC}/database/${d}/data.sql
|
|
|
|
.endfor
|
|
|
|
.endif
|
|
|
|
@${REINPLACE_CMD} -Ee 's|(@sysconfdir@/(\$$\([A-Z]*_CONFIG\)))" ([|][|] cp "../../conf/\$$\([A-Z]*_CONFIG\)" "\$$\(DESTDIR\)@sysconfdir@)"|\1.sample" \3/\2.sample"|;' \
|
|
|
|
${WRKSRC}/src/zabbix_${ZABBIX_BUILD}/Makefile.in
|
|
|
|
@${FIND} ${WRKSRC} -type f \( -name '*.bak' -or -name '*.orig' \) -exec ${RM} -f {} +
|
2009-12-13 23:30:18 +01:00
|
|
|
|
|
|
|
post-install:
|
|
|
|
.if ${ZABBIX_BUILD} != "agent"
|
2012-08-15 16:28:31 +02:00
|
|
|
@${MKDIR} "${DATADIR}/${ZABBIX_BUILD}/database"
|
2009-12-13 23:30:18 +01:00
|
|
|
@cd ${WRKSRC}/upgrades/ && ${COPYTREE_SHARE} dbpatches ${DATADIR}/${ZABBIX_BUILD}/upgrades/
|
2012-08-15 16:28:31 +02:00
|
|
|
@cd ${WRKSRC}/database/ && ${COPYTREE_SHARE} "ibm_db2 mysql oracle postgresql sqlite3" ${DATADIR}/${ZABBIX_BUILD}/database/
|
2009-12-13 23:30:18 +01:00
|
|
|
@${CAT} ${PKGMESSAGE}
|
|
|
|
.endif
|
|
|
|
.endif # if ${ZABBIX_BUILD} != "frontend"
|
|
|
|
|
|
|
|
.include <bsd.port.mk>
|