mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 01:39:16 -04:00
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
This commit is contained in:
parent
6f8cc2c2e6
commit
17a0f98920
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=102469
4 changed files with 134 additions and 10 deletions
|
@ -17,6 +17,14 @@ COMMENT= Very advanced network monitoring system
|
||||||
|
|
||||||
NOT_FOR_ARCHS= amd64
|
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)
|
.ifdef(ZABBIX_AGENT_ONLY)
|
||||||
PKGNAMESUFFIX= -agent
|
PKGNAMESUFFIX= -agent
|
||||||
PLIST= ${MASTERDIR}/pkg-plist.agent
|
PLIST= ${MASTERDIR}/pkg-plist.agent
|
||||||
|
@ -24,15 +32,28 @@ PKGMESSAGE= nonexistent
|
||||||
.else # ZABBIX_AGENT_ONLY
|
.else # ZABBIX_AGENT_ONLY
|
||||||
LIB_DEPENDS= netsnmp.6:${PORTSDIR}/net-mgmt/net-snmp
|
LIB_DEPENDS= netsnmp.6:${PORTSDIR}/net-mgmt/net-snmp
|
||||||
RUN_DEPENDS= php:${PORTSDIR}/lang/php4-nms
|
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
|
RUN_DEPENDS+= ${LOCALBASE}/sbin/fping:${PORTSDIR}/net/fping
|
||||||
.endif
|
.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
|
USE_MYSQL= yes
|
||||||
CONFIGURE_ARGS= --with-mysql --with-net-snmp
|
CONFIGURE_ARGS= --with-mysql
|
||||||
|
.endif
|
||||||
|
CONFIGURE_ARGS+=--with-netsnmp
|
||||||
PKGMESSAGE= ${WRKDIR}/pkg-message
|
PKGMESSAGE= ${WRKDIR}/pkg-message
|
||||||
.endif # ZABBIX_AGENT_ONLY
|
|
||||||
|
|
||||||
USE_REINPLACE= yes
|
USE_REINPLACE= yes
|
||||||
USE_RC_SUBR= yes
|
USE_RC_SUBR= yes
|
||||||
|
@ -60,7 +81,7 @@ pre-patch:
|
||||||
.ifndef(ZABBIX_AGENT_ONLY)
|
.ifndef(ZABBIX_AGENT_ONLY)
|
||||||
post-patch:
|
post-patch:
|
||||||
@${REINPLACE_CMD} 's|%LOCALBASE%|${LOCALBASE}|' ${WRKSRC}/src/zabbix_sucker/zabbix_sucker.c
|
@${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
|
@${ECHO} 'DisablePinger=yes' >> ${WRKSRC}/misc/conf/zabbix_suckerd.conf
|
||||||
.endif
|
.endif
|
||||||
.endif # ZABBIX_AGENT_ONLY
|
.endif # ZABBIX_AGENT_ONLY
|
||||||
|
@ -95,4 +116,4 @@ do-install:
|
||||||
@${CAT} ${PKGMESSAGE}
|
@${CAT} ${PKGMESSAGE}
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
.include <bsd.port.mk>
|
.include <bsd.port.post.mk>
|
||||||
|
|
41
net-mgmt/zabbix/files/patch-include::db.c
Normal file
41
net-mgmt/zabbix/files/patch-include::db.c
Normal file
|
@ -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)
|
|
@ -17,6 +17,14 @@ COMMENT= Very advanced network monitoring system
|
||||||
|
|
||||||
NOT_FOR_ARCHS= amd64
|
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)
|
.ifdef(ZABBIX_AGENT_ONLY)
|
||||||
PKGNAMESUFFIX= -agent
|
PKGNAMESUFFIX= -agent
|
||||||
PLIST= ${MASTERDIR}/pkg-plist.agent
|
PLIST= ${MASTERDIR}/pkg-plist.agent
|
||||||
|
@ -24,15 +32,28 @@ PKGMESSAGE= nonexistent
|
||||||
.else # ZABBIX_AGENT_ONLY
|
.else # ZABBIX_AGENT_ONLY
|
||||||
LIB_DEPENDS= netsnmp.6:${PORTSDIR}/net-mgmt/net-snmp
|
LIB_DEPENDS= netsnmp.6:${PORTSDIR}/net-mgmt/net-snmp
|
||||||
RUN_DEPENDS= php:${PORTSDIR}/lang/php4-nms
|
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
|
RUN_DEPENDS+= ${LOCALBASE}/sbin/fping:${PORTSDIR}/net/fping
|
||||||
.endif
|
.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
|
USE_MYSQL= yes
|
||||||
CONFIGURE_ARGS= --with-mysql --with-net-snmp
|
CONFIGURE_ARGS= --with-mysql
|
||||||
|
.endif
|
||||||
|
CONFIGURE_ARGS+=--with-netsnmp
|
||||||
PKGMESSAGE= ${WRKDIR}/pkg-message
|
PKGMESSAGE= ${WRKDIR}/pkg-message
|
||||||
.endif # ZABBIX_AGENT_ONLY
|
|
||||||
|
|
||||||
USE_REINPLACE= yes
|
USE_REINPLACE= yes
|
||||||
USE_RC_SUBR= yes
|
USE_RC_SUBR= yes
|
||||||
|
@ -60,7 +81,7 @@ pre-patch:
|
||||||
.ifndef(ZABBIX_AGENT_ONLY)
|
.ifndef(ZABBIX_AGENT_ONLY)
|
||||||
post-patch:
|
post-patch:
|
||||||
@${REINPLACE_CMD} 's|%LOCALBASE%|${LOCALBASE}|' ${WRKSRC}/src/zabbix_sucker/zabbix_sucker.c
|
@${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
|
@${ECHO} 'DisablePinger=yes' >> ${WRKSRC}/misc/conf/zabbix_suckerd.conf
|
||||||
.endif
|
.endif
|
||||||
.endif # ZABBIX_AGENT_ONLY
|
.endif # ZABBIX_AGENT_ONLY
|
||||||
|
@ -95,4 +116,4 @@ do-install:
|
||||||
@${CAT} ${PKGMESSAGE}
|
@${CAT} ${PKGMESSAGE}
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
.include <bsd.port.mk>
|
.include <bsd.port.post.mk>
|
||||||
|
|
41
net-mgmt/zabbix2/files/patch-include::db.c
Normal file
41
net-mgmt/zabbix2/files/patch-include::db.c
Normal file
|
@ -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)
|
Loading…
Add table
Reference in a new issue