aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/zabbix3-server
diff options
context:
space:
mode:
authorDanilo G. Baio <dbaio@FreeBSD.org>2018-08-04 12:37:18 +0000
committerDanilo G. Baio <dbaio@FreeBSD.org>2018-08-04 12:37:18 +0000
commita895a93def9a629f9b6ffbe97ed626e70ce55d99 (patch)
treee9d7253ca8b105cadd272d1df47271990a691676 /net-mgmt/zabbix3-server
parent81e9c78c7efd3f6c19ae53a27304e4471a365c7c (diff)
downloadports-a895a93def9a629f9b6ffbe97ed626e70ce55d99.tar.gz
ports-a895a93def9a629f9b6ffbe97ed626e70ce55d99.zip
Notes
Diffstat (limited to 'net-mgmt/zabbix3-server')
-rw-r--r--net-mgmt/zabbix3-server/Makefile25
-rw-r--r--net-mgmt/zabbix3-server/files/zabbix_java.in27
-rw-r--r--net-mgmt/zabbix3-server/pkg-plist10
-rw-r--r--net-mgmt/zabbix3-server/pkg-plist.java11
4 files changed, 51 insertions, 22 deletions
diff --git a/net-mgmt/zabbix3-server/Makefile b/net-mgmt/zabbix3-server/Makefile
index 84efab4da3ff..9a811da0a9d2 100644
--- a/net-mgmt/zabbix3-server/Makefile
+++ b/net-mgmt/zabbix3-server/Makefile
@@ -3,7 +3,7 @@
PORTNAME= zabbix3
PORTVERSION= 3.0.19
-PORTREVISION?= 0
+PORTREVISION?= 1
CATEGORIES= net-mgmt
MASTER_SITES= SF/zabbix/ZABBIX%20Latest%20Stable/${PORTVERSION}
PKGNAMESUFFIX?= -server
@@ -53,7 +53,7 @@ CONFIGURE_ARGS+= --enable-${ZABBIX_BUILD} \
--datadir=${ETCDIR} \
--with-iconv=${ICONV_PREFIX}
-.if ${ZABBIX_BUILD} != "agent"
+.if ${ZABBIX_BUILD} != "agent" && ${ZABBIX_BUILD} != "java"
LIB_DEPENDS= libnetsnmp.so:net-mgmt/net-snmp
CPPFLAGS+= -I${LOCALBASE}/include
@@ -62,8 +62,7 @@ SUB_FILES= pkg-message
CONFIGURE_ARGS+= --with-net-snmp
-OPTIONS_DEFINE= IPV6 FPING JABBER CURL LDAP IPMI SSH NMAP JAVAGW \
- LIBXML2
+OPTIONS_DEFINE= IPV6 FPING JABBER CURL LDAP IPMI SSH NMAP LIBXML2
OPTIONS_DEFAULT= FPING CURL UNIXODBC MYSQL OPENSSL
OPTIONS_SUB= yes
@@ -76,7 +75,6 @@ LDAP_DESC= Support for LDAP server checks
NMAP_DESC= Build/install nmap for o/s detection
SSH_DESC= Support for SSH-based checks
ODBC_DESC= Support for database checks via ODBC
-JAVAGW_DESC= Support for Java gateway
LIBXML2_DESC= Support for libxml2 (required by monitoring VMware)
OPTIONS_SINGLE= DB ODBC SSL
@@ -117,19 +115,16 @@ IODBC_LIB_DEPENDS= libiodbc.so:databases/libiodbc
UNIXODBC_CONFIGURE_WITH=unixodbc
UNIXODBC_LIB_DEPENDS= libodbc.so:databases/unixODBC
-.else
+.elif ${ZABBIX_BUILD} == "agent"
OPTIONS_SINGLE= SSL
OPTIONS_SINGLE_SSL= OPENSSL GNUTLS
-.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
-
LIBXML2_CONFIGURE_WITH= libxml2
LIBXML2_LIB_DEPENDS= libxml2.so:textproc/libxml2
@@ -172,6 +167,11 @@ post-patch:
${WRKSRC}/conf/zabbix_agentd*.conf
.endif
+.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
@${REINPLACE_CMD} \
@@ -189,12 +189,13 @@ post-patch:
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:Q}/database
(cd ${WRKSRC}/upgrades/ && ${COPYTREE_SHARE} dbpatches \
${STAGEDIR}${DATADIR}/${ZABBIX_BUILD:Q}/upgrades/)
diff --git a/net-mgmt/zabbix3-server/files/zabbix_java.in b/net-mgmt/zabbix3-server/files/zabbix_java.in
new file mode 100644
index 000000000000..afb4423f9997
--- /dev/null
+++ b/net-mgmt/zabbix3-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/zabbix3-server/pkg-plist b/net-mgmt/zabbix3-server/pkg-plist
index 8f5bfd425c70..cbfd1bca38aa 100644
--- a/net-mgmt/zabbix3-server/pkg-plist
+++ b/net-mgmt/zabbix3-server/pkg-plist
@@ -33,16 +33,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/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/lib/android-json-4.3_r3.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
%%PROXY%%@dir %%ETCDIR%%/zabbix_proxy.conf.d
diff --git a/net-mgmt/zabbix3-server/pkg-plist.java b/net-mgmt/zabbix3-server/pkg-plist.java
new file mode 100644
index 000000000000..4b0bd8f968de
--- /dev/null
+++ b/net-mgmt/zabbix3-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