aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/zabbix
diff options
context:
space:
mode:
authoredwin <edwin@FreeBSD.org>2004-02-29 06:05:46 +0800
committeredwin <edwin@FreeBSD.org>2004-02-29 06:05:46 +0800
commit9125cb0170affe1750111a4856bea824a5720186 (patch)
tree9e4c4e081cefd357f6558ab19843c2c0c26a024d /net-mgmt/zabbix
parent8bb347c06f676bf78d81b0c9434d745dd4d74948 (diff)
downloadfreebsd-ports-gnome-9125cb0170affe1750111a4856bea824a5720186.tar.gz
freebsd-ports-gnome-9125cb0170affe1750111a4856bea824a5720186.tar.zst
freebsd-ports-gnome-9125cb0170affe1750111a4856bea824a5720186.zip
Let the port choose between a PGSQL or MYSQL backend.
Fix compilation of net/zabbix when using the PGSQL backend. (author informed) PR: 61773, 62856 Submitted by: Michal F. Hanula <f@7f000001.org>, edwin@Mavetju.org Approved by: maintainer timeout
Diffstat (limited to 'net-mgmt/zabbix')
-rw-r--r--net-mgmt/zabbix/Makefile31
-rw-r--r--net-mgmt/zabbix/files/patch-include::db.c41
2 files changed, 67 insertions, 5 deletions
diff --git a/net-mgmt/zabbix/Makefile b/net-mgmt/zabbix/Makefile
index 171a724f80d1..aa28891e01d2 100644
--- a/net-mgmt/zabbix/Makefile
+++ b/net-mgmt/zabbix/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/zabbix/files/patch-include::db.c b/net-mgmt/zabbix/files/patch-include::db.c
new file mode 100644
index 000000000000..65b688a2ee3d
--- /dev/null
+++ b/net-mgmt/zabbix/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)