aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt/zabbix2-server
diff options
context:
space:
mode:
authordbaio <dbaio@FreeBSD.org>2018-08-04 20:37:18 +0800
committerdbaio <dbaio@FreeBSD.org>2018-08-04 20:37:18 +0800
commite78aa633916cf13c57bf836dad05b5b07efdd582 (patch)
treee9d7253ca8b105cadd272d1df47271990a691676 /net-mgmt/zabbix2-server
parent0ca4446936cb6f6e7cabce2545358f64b7335c55 (diff)
downloadfreebsd-ports-gnome-e78aa633916cf13c57bf836dad05b5b07efdd582.tar.gz
freebsd-ports-gnome-e78aa633916cf13c57bf836dad05b5b07efdd582.tar.zst
freebsd-ports-gnome-e78aa633916cf13c57bf836dad05b5b07efdd582.zip
Add Zabbix Java Gateway ports
This update separates Java Gateway componentes from the Zabbix Server port, creating an additional slave port for each version. This way is possible to deploy a Java Gateway without the need to install Zabbix Server components. In the current state there wasn't an rcfile for the Java Gateway. [1] PR: 217777 Reported by: Juan Garcia <juan@ish.com.au> [1] Approved by: Pakhom Golynga <pg@pakhom.spb.ru> (maintainer)
Diffstat (limited to 'net-mgmt/zabbix2-server')
-rw-r--r--net-mgmt/zabbix2-server/Makefile21
-rw-r--r--net-mgmt/zabbix2-server/files/zabbix_java.in27
-rw-r--r--net-mgmt/zabbix2-server/pkg-plist10
-rw-r--r--net-mgmt/zabbix2-server/pkg-plist.java11
4 files changed, 49 insertions, 20 deletions
diff --git a/net-mgmt/zabbix2-server/Makefile b/net-mgmt/zabbix2-server/Makefile
index 6e95442feebc..9a65d6aaf017 100644
--- a/net-mgmt/zabbix2-server/Makefile
+++ b/net-mgmt/zabbix2-server/Makefile
@@ -3,7 +3,7 @@
PORTNAME= zabbix2
PORTVERSION= 2.0.21
-PORTREVISION?= 0
+PORTREVISION?= 1
CATEGORIES= net-mgmt
MASTER_SITES= SF/zabbix/ZABBIX%20Latest%20Stable/${PORTVERSION}
PKGNAMESUFFIX?= -server
@@ -57,12 +57,12 @@ CONFIGURE_ARGS+= --enable-${ZABBIX_BUILD} \
--sysconfdir=${ETCDIR} \
--datadir=${ETCDIR}
-.if ${ZABBIX_BUILD} != "agent"
+.if ${ZABBIX_BUILD} != "agent" && ${ZABBIX_BUILD} != "java"
SUB_FILES= pkg-message
CONFIGURE_ARGS+= --with-net-snmp
-OPTIONS_DEFINE= IPV6 FPING JABBER CURL LDAP IPMI SSH NMAP JAVAGW
+OPTIONS_DEFINE= IPV6 FPING JABBER CURL LDAP IPMI SSH NMAP
OPTIONS_DEFAULT= MYSQL FPING JABBER CURL UNIXODBC
OPTIONS_SUB= yes
@@ -73,7 +73,6 @@ 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
-JAVAGW_DESC= Support for Java gateway
ODBC_DESC= Support for database checks via ODBC
OPTIONS_SINGLE= DB ODBC
@@ -113,16 +112,13 @@ IODBC_LIB_DEPENDS= libiodbc.so:databases/libiodbc
UNIXODBC_CONFIGURE_WITH= unixodbc
UNIXODBC_LIB_DEPENDS= libodbc.so:databases/unixODBC
-.endif # if ${ZABBIX_BUILD} != "agent"
+.endif # if ${ZABBIX_BUILD} != "agent" && ${ZABBIX_BUILD} != "java"
IPV6_CONFIGURE_ENABLE= ipv6
NMAP_RUN_DEPENDS= nmap:security/nmap \
sudo:security/sudo
-JAVAGW_CONFIGURE_ENABLE= java
-JAVAGW_USE= JAVA=yes
-
.include <bsd.port.options.mk>
post-patch:
@@ -133,6 +129,10 @@ post-patch:
${WRKSRC}/src/zabbix_proxy/proxy.c \
${WRKSRC}/src/zabbix_server/server.c
+.if ${ZABBIX_BUILD} == "java"
+ @${REINPLACE_CMD} -e 's#PID_FILE="/tmp/zabbix_java.pid"#PID_FILE="/var/run/zabbix/zabbix_java.pid"#g' \
+ ${WRKSRC}/src/zabbix_java/settings.sh
+.endif
.if ${ZABBIX_BUILD} != "agent"
.for d in mysql oracle postgresql sqlite3
@@ -147,11 +147,12 @@ post-patch:
@${FIND} ${WRKSRC} -type f \( -name '*.bak' -or -name '*.orig' \) -exec ${RM} {} +
post-install:
-.if ${PORT_OPTIONS:MJAVAGW}
+.if ${ZABBIX_BUILD} == "java"
@${MV} ${STAGEDIR}${PREFIX}/sbin/zabbix_java/settings.sh ${STAGEDIR}${PREFIX}/sbin/zabbix_java/settings.sh.sample
+ @${MKDIR} ${STAGEDIR}/var/run/zabbix
.endif
-.if ${ZABBIX_BUILD} != "agent"
+.if ${ZABBIX_BUILD} != "agent" && ${ZABBIX_BUILD} != "java"
@${MKDIR} "${STAGEDIR}${DATADIR}/${ZABBIX_BUILD}/database"
@cd ${WRKSRC}/upgrades/ && ${COPYTREE_SHARE} dbpatches ${STAGEDIR}${DATADIR}/${ZABBIX_BUILD}/upgrades/
@cd ${WRKSRC}/database/ && ${COPYTREE_SHARE} "ibm_db2 mysql oracle postgresql sqlite3" ${STAGEDIR}${DATADIR}/${ZABBIX_BUILD}/database/
diff --git a/net-mgmt/zabbix2-server/files/zabbix_java.in b/net-mgmt/zabbix2-server/files/zabbix_java.in
new file mode 100644
index 000000000000..afb4423f9997
--- /dev/null
+++ b/net-mgmt/zabbix2-server/files/zabbix_java.in
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# PROVIDE: zabbix_java
+# REQUIRE: NETWORKING SERVERS
+# BEFORE: DAEMON
+# KEYWORD: shutdown
+#
+# Options to configure zabbix_java via /etc/rc.conf:
+#
+# zabbix_java_enable (bool):
+# Enable service on boot.
+# Default: NO
+#
+
+. /etc/rc.subr
+
+name="zabbix_java"
+rcvar=zabbix_java_enable
+
+load_rc_config $name
+
+: ${zabbix_java_enable:=NO}
+
+start_cmd="/usr/bin/su -m zabbix -c %%PREFIX%%/sbin/zabbix_java/startup.sh"
+stop_cmd="/usr/bin/su -m zabbix -c %%PREFIX%%/sbin/zabbix_java/shutdown.sh"
+
+run_rc_command "$1"
diff --git a/net-mgmt/zabbix2-server/pkg-plist b/net-mgmt/zabbix2-server/pkg-plist
index 27f0b8297470..27c38b95b7f7 100644
--- a/net-mgmt/zabbix2-server/pkg-plist
+++ b/net-mgmt/zabbix2-server/pkg-plist
@@ -32,16 +32,6 @@ sbin/zabbix_%%ZABBIX_BUILD%%
%%DATADIR%%/%%ZABBIX_BUILD%%/upgrades/dbpatches/1.6/postgresql/patch.sql
%%DATADIR%%/%%ZABBIX_BUILD%%/upgrades/dbpatches/1.6/oracle/patch.sql
%%DATADIR%%/%%ZABBIX_BUILD%%/upgrades/dbpatches/1.6/mysql/patch.sql
-%%JAVAGW%%sbin/zabbix_java/shutdown.sh
-%%JAVAGW%%sbin/zabbix_java/lib/logback-console.xml
-%%JAVAGW%%sbin/zabbix_java/lib/logback-core-0.9.27.jar
-%%JAVAGW%%sbin/zabbix_java/lib/android-json-4.3_r3.1.jar
-%%JAVAGW%%sbin/zabbix_java/lib/logback-classic-0.9.27.jar
-%%JAVAGW%%sbin/zabbix_java/lib/logback.xml
-%%JAVAGW%%sbin/zabbix_java/lib/slf4j-api-1.6.1.jar
-%%JAVAGW%%sbin/zabbix_java/settings.sh.sample
-%%JAVAGW%%sbin/zabbix_java/startup.sh
-%%JAVAGW%%sbin/zabbix_java/bin/zabbix-java-gateway-%%PORTVERSION%%.jar
%%SERVER%%@dir %%ETCDIR%%/zabbix/alertscripts
@dir %%ETCDIR%%/zabbix/externalscripts
@dir %%ETCDIR%%/zabbix_%%ZABBIX_BUILD%%.conf.d
diff --git a/net-mgmt/zabbix2-server/pkg-plist.java b/net-mgmt/zabbix2-server/pkg-plist.java
new file mode 100644
index 000000000000..4b0bd8f968de
--- /dev/null
+++ b/net-mgmt/zabbix2-server/pkg-plist.java
@@ -0,0 +1,11 @@
+sbin/zabbix_java/shutdown.sh
+sbin/zabbix_java/lib/logback-console.xml
+sbin/zabbix_java/lib/logback-core-0.9.27.jar
+sbin/zabbix_java/lib/logback-classic-0.9.27.jar
+sbin/zabbix_java/lib/logback.xml
+sbin/zabbix_java/lib/slf4j-api-1.6.1.jar
+sbin/zabbix_java/lib/android-json-4.3_r3.1.jar
+@sample sbin/zabbix_java/settings.sh.sample
+sbin/zabbix_java/startup.sh
+sbin/zabbix_java/bin/zabbix-java-gateway-%%PORTVERSION%%.jar
+@dir(zabbix,zabbix,755) /var/run/zabbix