2013-03-17 03:21:17 -04:00
|
|
|
# $OpenBSD: Makefile,v 1.80 2013/03/17 07:21:17 ajacoutot Exp $
|
2009-04-22 11:03:52 -04:00
|
|
|
|
|
|
|
COMMENT-main = network and application monitoring - agent
|
|
|
|
COMMENT-server = network and application monitoring - server
|
|
|
|
COMMENT-web = network and application monitoring - web frontend
|
|
|
|
|
2013-01-24 13:48:15 -05:00
|
|
|
VERSION = 2.0.4
|
2009-04-22 11:03:52 -04:00
|
|
|
DISTNAME = zabbix-${VERSION}
|
2010-07-12 18:07:37 -04:00
|
|
|
FULLPKGNAME-main = zabbix-agent-${VERSION}
|
2010-02-27 13:47:19 -05:00
|
|
|
FULLPKGPATH-main = net/zabbix,-main
|
2010-07-12 18:07:37 -04:00
|
|
|
PKGNAME-server = zabbix-server-${VERSION}
|
|
|
|
FULLPKGNAME-web = zabbix-web-${VERSION}
|
2010-04-09 06:17:59 -04:00
|
|
|
FULLPKGPATH-web = net/zabbix,-web
|
2009-04-22 11:03:52 -04:00
|
|
|
CATEGORIES = net
|
|
|
|
|
2013-03-17 03:21:17 -04:00
|
|
|
REVISION-server = 0
|
|
|
|
|
2010-05-04 01:51:22 -04:00
|
|
|
MAJV = ${VERSION:C/^([0-9]+\.[0-9]+).*/\1/}
|
|
|
|
|
2009-04-22 11:03:52 -04:00
|
|
|
HOMEPAGE = http://www.zabbix.com/
|
|
|
|
|
2011-10-08 11:30:39 -04:00
|
|
|
MAINTAINER = Robert Nagy <robert@openbsd.org>
|
2010-11-16 05:08:49 -05:00
|
|
|
|
2009-04-22 11:03:52 -04:00
|
|
|
# GPLv2
|
|
|
|
PERMIT_PACKAGE_CDROM = Yes
|
|
|
|
|
|
|
|
MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=zabbix/}
|
|
|
|
|
2011-07-08 18:31:59 -04:00
|
|
|
MODULES= converters/libiconv lang/php
|
2010-11-19 17:31:32 -05:00
|
|
|
USE_GROFF = Yes
|
2011-07-08 18:40:30 -04:00
|
|
|
MODPHP_BUILDDEP = No
|
2010-01-15 04:08:02 -05:00
|
|
|
|
2010-04-09 12:41:45 -04:00
|
|
|
MULTI_PACKAGES = -main -web
|
2009-06-03 13:54:12 -04:00
|
|
|
PSEUDO_FLAVORS = no_server
|
2010-05-04 01:51:22 -04:00
|
|
|
FLAVORS = mysql pgsql sqlite3
|
2009-06-03 13:54:12 -04:00
|
|
|
|
2010-05-04 01:51:22 -04:00
|
|
|
SUBST_VARS += PREFIX-web ZABBIX_WEB MAJV
|
2009-04-22 11:03:52 -04:00
|
|
|
|
2012-10-10 18:04:57 -04:00
|
|
|
WANTLIB = c kvm m execinfo lber ldap crypto ssl z curl idn intl
|
|
|
|
|
2010-11-19 17:31:32 -05:00
|
|
|
LIB_DEPENDS = databases/openldap \
|
2012-10-10 18:04:57 -04:00
|
|
|
devel/libexecinfo \
|
|
|
|
net/curl
|
2009-04-22 11:03:52 -04:00
|
|
|
|
2011-07-08 18:31:59 -04:00
|
|
|
RUN_DEPENDS-main = ${MODLIBICONV_RUN_DEPENDS}
|
|
|
|
|
2009-04-22 11:03:52 -04:00
|
|
|
LIB_DEPENDS-server = ${LIB_DEPENDS} \
|
2010-11-19 17:31:32 -05:00
|
|
|
net/net-snmp \
|
|
|
|
textproc/iksemel
|
|
|
|
RUN_DEPENDS-server = net/fping
|
2010-11-06 05:01:06 -04:00
|
|
|
# we want the _zabbix user&group as well as README-main
|
2010-11-19 17:31:32 -05:00
|
|
|
RUN_DEPENDS-server += net/zabbix,-main>=${VERSION}
|
2012-03-20 08:00:37 -04:00
|
|
|
WANTLIB-server = ${WANTLIB} crypto idn intl ssl z curl netsnmp iksemel pthread
|
2009-04-22 11:03:52 -04:00
|
|
|
|
|
|
|
CONFIGURE_STYLE = gnu
|
|
|
|
CONFIGURE_ARGS = --enable-server \
|
|
|
|
--enable-agent \
|
|
|
|
--enable-proxy \
|
|
|
|
--enable-ipv6 \
|
|
|
|
--with-libcurl \
|
|
|
|
--with-net-snmp \
|
2009-08-31 16:52:29 -04:00
|
|
|
--with-ldap \
|
|
|
|
--with-jabber="${LOCALBASE}"
|
2009-04-22 11:03:52 -04:00
|
|
|
CONFIGURE_ENV = CPPFLAGS="-I${LOCALBASE}/include" \
|
2010-08-22 10:43:23 -04:00
|
|
|
LDFLAGS="-L${LOCALBASE}/lib -lexecinfo" \
|
2009-06-11 12:38:17 -04:00
|
|
|
ac_cv_search___res_query=no
|
2009-04-22 11:03:52 -04:00
|
|
|
|
|
|
|
PREFIX-web = /var/www
|
2009-06-11 12:38:17 -04:00
|
|
|
LIB_DEPENDS-web =
|
2011-07-08 18:40:30 -04:00
|
|
|
RUN_DEPENDS-web = ${MODPHP_RUN_DEPENDS} \
|
2012-06-21 03:00:20 -04:00
|
|
|
lang/php/${MODPHP_VERSION},-gd
|
2009-06-11 12:38:17 -04:00
|
|
|
WANTLIB-web =
|
2009-07-15 08:28:06 -04:00
|
|
|
ZABBIX_WEB = ${PREFIX-web}/zabbix
|
2009-06-03 13:54:12 -04:00
|
|
|
|
|
|
|
FLAVOR ?= no_server
|
2011-09-18 16:51:46 -04:00
|
|
|
.if empty(FLAVOR)
|
|
|
|
FLAVOR = sqlite3
|
|
|
|
.endif
|
2009-06-03 13:54:12 -04:00
|
|
|
|
|
|
|
#if non-backend-related flavors are added, add them to
|
|
|
|
#the following line as ":L:Nflavor1:Nflavor2" so that
|
|
|
|
#they don't trigger a "Conflicting flavors" error.
|
|
|
|
BACKEND = ${FLAVOR}
|
|
|
|
.if ${BACKEND} == "mysql"
|
2010-04-09 12:41:45 -04:00
|
|
|
MULTI_PACKAGES += -server
|
2010-11-19 17:31:32 -05:00
|
|
|
LIB_DEPENDS-server += databases/mysql,-main
|
2009-06-03 13:54:12 -04:00
|
|
|
CONFIGURE_ARGS += --with-mysql
|
2010-08-22 10:43:23 -04:00
|
|
|
WANTLIB-server += mysqlclient
|
2009-06-03 13:54:12 -04:00
|
|
|
.elif ${BACKEND} == "pgsql"
|
2010-04-09 12:41:45 -04:00
|
|
|
MULTI_PACKAGES += -server
|
2010-11-19 17:31:32 -05:00
|
|
|
LIB_DEPENDS-server += databases/postgresql,-main
|
2012-10-10 18:04:57 -04:00
|
|
|
CONFIGURE_ARGS += --with-postgresql
|
2010-08-22 10:43:23 -04:00
|
|
|
WANTLIB-server += pq
|
2010-05-04 01:51:22 -04:00
|
|
|
.elif ${BACKEND} == "sqlite3"
|
|
|
|
MULTI_PACKAGES += -server
|
|
|
|
CONFIGURE_ARGS += --with-sqlite3
|
2010-08-22 10:43:23 -04:00
|
|
|
WANTLIB-server += sqlite3
|
2009-06-03 13:54:12 -04:00
|
|
|
.elif ${BACKEND} == "no_server"
|
|
|
|
CONFIGURE_ARGS += --disable-server \
|
2010-04-09 12:41:45 -04:00
|
|
|
--disable-proxy
|
2009-06-03 13:54:12 -04:00
|
|
|
.else
|
|
|
|
ERRORS += "Fatal: Conflicting flavors: ${FLAVOR}";
|
|
|
|
.endif
|
2009-04-22 11:03:52 -04:00
|
|
|
|
2009-07-12 15:51:51 -04:00
|
|
|
pre-configure:
|
2012-10-10 18:04:57 -04:00
|
|
|
${SUBST_CMD} ${WRKSRC}/conf/zabbix_server.conf \
|
|
|
|
${WRKSRC}/conf/zabbix_proxy.conf
|
2009-07-12 15:51:51 -04:00
|
|
|
|
2009-04-22 11:03:52 -04:00
|
|
|
post-install:
|
|
|
|
${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX-web}/zabbix
|
|
|
|
cd ${WRKBUILD}/frontends/php && tar -cf - . | \
|
|
|
|
tar -C ${DESTDIR}${PREFIX-web}/zabbix -xf -
|
|
|
|
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/zabbix
|
2009-06-03 13:54:12 -04:00
|
|
|
${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX-web}/conf/
|
|
|
|
${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX-web}/conf/modules.sample
|
2010-11-06 05:01:06 -04:00
|
|
|
${SUBST_CMD} -c -o ${SHAREOWN} -g ${SHAREGRP} \
|
|
|
|
${FILESDIR}/zabbix.conf \
|
2009-06-03 13:54:12 -04:00
|
|
|
${DESTDIR}${PREFIX-web}/conf/modules.sample/zabbix.conf
|
2011-07-28 06:51:54 -04:00
|
|
|
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/php-${MODPHP_VERSION}
|
2010-11-06 05:01:06 -04:00
|
|
|
${SUBST_CMD} -c -o ${SHAREOWN} -g ${SHAREGRP} \
|
|
|
|
${FILESDIR}/zabbix.ini \
|
2011-07-28 06:51:54 -04:00
|
|
|
${PREFIX}/share/examples/php-${MODPHP_VERSION}/zabbix.ini
|
2009-04-22 11:03:52 -04:00
|
|
|
${INSTALL_DATA_DIR} ${PREFIX}/share/zabbix/schema
|
|
|
|
${INSTALL_DATA_DIR} ${PREFIX}/share/zabbix/data
|
|
|
|
${INSTALL_DATA_DIR} ${PREFIX}/share/zabbix/data/images
|
|
|
|
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/zabbix
|
2012-10-10 18:04:57 -04:00
|
|
|
${INSTALL_DATA} ${WRKBUILD}/conf/*.conf \
|
2009-04-22 11:03:52 -04:00
|
|
|
${PREFIX}/share/examples/zabbix
|
2012-10-10 18:04:57 -04:00
|
|
|
# Database schemas
|
|
|
|
cd ${WRKSRC}/database/ && tar -cf - mysql postgresql sqlite3 | \
|
|
|
|
tar -C ${PREFIX}/share/zabbix/schema -xf -
|
2009-04-22 11:03:52 -04:00
|
|
|
# Script to easy upgrading from previous major version
|
|
|
|
cd ${WRKSRC}/upgrades/ && tar -cf - dbpatches | \
|
|
|
|
tar -C ${PREFIX}/share/zabbix -xf -
|
|
|
|
|
2012-10-10 18:04:57 -04:00
|
|
|
@find ${PREFIX}/share/zabbix/schema -name data.sql -exec \
|
2012-11-04 17:16:04 -05:00
|
|
|
perl -pi -e "s,/bin/ping,/sbin/ping,g;s,/usr/bin/traceroute,/usr/sbin/traceroute,g" {} \;
|
2012-10-10 18:04:57 -04:00
|
|
|
|
2009-04-22 11:03:52 -04:00
|
|
|
.include <bsd.port.mk>
|