aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/zabbix2
diff options
context:
space:
mode:
authorEdwin Groothuis <edwin@FreeBSD.org>2004-02-28 22:05:46 +0000
committerEdwin Groothuis <edwin@FreeBSD.org>2004-02-28 22:05:46 +0000
commit17a0f98920a143baf40a2eb01994cd95ce6fcbc9 (patch)
tree6140b4a7ad4e36e4aebf1e50d7abd1bafc95d937 /net-mgmt/zabbix2
parent6f8cc2c2e681198cb9f4e19462b6459dab861a70 (diff)
downloadports-17a0f98920a143baf40a2eb01994cd95ce6fcbc9.tar.gz
ports-17a0f98920a143baf40a2eb01994cd95ce6fcbc9.zip
Notes
Diffstat (limited to 'net-mgmt/zabbix2')
-rw-r--r--net-mgmt/zabbix2/Makefile31
-rw-r--r--net-mgmt/zabbix2/files/patch-include::db.c41
2 files changed, 67 insertions, 5 deletions
diff --git a/net-mgmt/zabbix2/Makefile b/net-mgmt/zabbix2/Makefile
index 171a724f80d1..aa28891e01d2 100644
--- a/net-mgmt/zabbix2/Makefile
+++ b/net-mgmt/zabbix2/Makefile
@@ -17,6 +17,14 @@ COMMENT= Very advanced network monitoring system
NOT_FOR_ARCHS= amd64
+.ifndef(ZABBIX_AGENT_ONLY)
+OPTIONS= PGSQL "Use a PostgreSQL backend" Off \
+ MYSQL "Use a MySQL backend" On \
+ FPING "Use fping for pinging hosts" On
+.endif
+
+.include <bsd.port.pre.mk>
+
.ifdef(ZABBIX_AGENT_ONLY)
PKGNAMESUFFIX= -agent
PLIST= ${MASTERDIR}/pkg-plist.agent
@@ -24,15 +32,28 @@ PKGMESSAGE= nonexistent
.else # ZABBIX_AGENT_ONLY
LIB_DEPENDS= netsnmp.6:${PORTSDIR}/net-mgmt/net-snmp
RUN_DEPENDS= php:${PORTSDIR}/lang/php4-nms
+.endif # ZABBIX_AGENT_ONLY
-.ifndef(WITHOUT_FPING)
+.ifdef(WITH_FPING)
RUN_DEPENDS+= ${LOCALBASE}/sbin/fping:${PORTSDIR}/net/fping
.endif
+.ifndef(WITH_PGSQL)
+. ifndef(WITH_MYSQL)
+IGNORE= You should configure to use either a MySQL or PostgreSQL backend.
+. endif
+.endif
+
+.ifdef(WITH_PGSQL)
+CONFIGURE_ARGS+=--with-pgsql
+LIB_DEPENDS+= pq.3:${PORTSDIR}/databases/postgresql-client
+.endif
+.ifdef(WITH_MYSQL)
USE_MYSQL= yes
-CONFIGURE_ARGS= --with-mysql --with-net-snmp
+CONFIGURE_ARGS= --with-mysql
+.endif
+CONFIGURE_ARGS+=--with-netsnmp
PKGMESSAGE= ${WRKDIR}/pkg-message
-.endif # ZABBIX_AGENT_ONLY
USE_REINPLACE= yes
USE_RC_SUBR= yes
@@ -60,7 +81,7 @@ pre-patch:
.ifndef(ZABBIX_AGENT_ONLY)
post-patch:
@${REINPLACE_CMD} 's|%LOCALBASE%|${LOCALBASE}|' ${WRKSRC}/src/zabbix_sucker/zabbix_sucker.c
-.ifdef WITHOUT_FPING
+.ifndef WITH_FPING
@${ECHO} 'DisablePinger=yes' >> ${WRKSRC}/misc/conf/zabbix_suckerd.conf
.endif
.endif # ZABBIX_AGENT_ONLY
@@ -95,4 +116,4 @@ do-install:
@${CAT} ${PKGMESSAGE}
.endif
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/net-mgmt/zabbix2/files/patch-include::db.c b/net-mgmt/zabbix2/files/patch-include::db.c
new file mode 100644
index 000000000000..65b688a2ee3d
--- /dev/null
+++ b/net-mgmt/zabbix2/files/patch-include::db.c
@@ -0,0 +1,41 @@
+--- include/db.c.orig Sun Feb 15 09:55:55 2004
++++ include/db.c Sun Feb 15 09:56:53 2004
+@@ -123,6 +123,10 @@
+ */
+ int DBexecute(char *query)
+ {
++#ifdef HAVE_PGSQL
++ PGresult *result;
++#endif
++
+ /* zabbix_set_log_level(LOG_LEVEL_DEBUG);*/
+ zabbix_log( LOG_LEVEL_DEBUG, "Executing query:%s",query);
+ #ifdef HAVE_MYSQL
+@@ -138,8 +142,6 @@
+ }
+ #endif
+ #ifdef HAVE_PGSQL
+- PGresult *result;
+-
+ result = PQexec(conn,query);
+
+ if( result==NULL)
+@@ -168,6 +170,9 @@
+ */
+ DB_RESULT *DBselect(char *query)
+ {
++#ifdef HAVE_PGSQL
++ PGresult *result;
++#endif
+ /* zabbix_set_log_level(LOG_LEVEL_DEBUG);*/
+ zabbix_log( LOG_LEVEL_DEBUG, "Executing query:%s",query);
+ #ifdef HAVE_MYSQL
+@@ -185,8 +190,6 @@
+ return mysql_store_result(&mysql);
+ #endif
+ #ifdef HAVE_PGSQL
+- PGresult *result;
+-
+ result = PQexec(conn,query);
+
+ if( result==NULL)