aboutsummaryrefslogtreecommitdiff
path: root/net/zabbix-agent
diff options
context:
space:
mode:
Diffstat (limited to 'net/zabbix-agent')
-rw-r--r--net/zabbix-agent/Makefile41
-rw-r--r--net/zabbix-agent/distinfo3
-rw-r--r--net/zabbix-agent/files/patch-configure12
-rw-r--r--net/zabbix-agent/files/zabbix_agentd.in17
-rw-r--r--net/zabbix-agent/pkg-descr8
-rw-r--r--net/zabbix-agent/pkg-install45
6 files changed, 122 insertions, 4 deletions
diff --git a/net/zabbix-agent/Makefile b/net/zabbix-agent/Makefile
index 597d16f95886..d9634ae1e6aa 100644
--- a/net/zabbix-agent/Makefile
+++ b/net/zabbix-agent/Makefile
@@ -1,11 +1,44 @@
-# Ports collection makefile for: zabbix
+# Ports collection makefile for: zabbix-agent
# Date created: Jun 18 2003
# Whom: Sergey Akifyev <asa@gascom.ru>
#
# $FreeBSD$
#
-ZABBIX_AGENT_ONLY= yes
-MASTERDIR= ${.CURDIR}/../../net-mgmt/zabbix
+PORTNAME= zabbix
+PORTVERSION= 1.4
+PORTEPOCH= 1
+CATEGORIES= net
+MASTER_SITES= SF
+PKGNAMESUFFIX= -agent
-.include "${MASTERDIR}/Makefile"
+MAINTAINER= ports@FreeBSD.org
+COMMENT= Application and network monitoring solution
+
+USE_GMAKE= yes
+USE_RC_SUBR= zabbix_agentd
+GNU_CONFIGURE= yes
+CONFIGURE_ARGS= --enable-agent --disable-server
+MAKE_ARGS= ARCH=freebsd
+
+ZABBIX_BIN= agent agentd get sender
+ZABBIX_CFG= agent agentd
+ZABBIX_BINFILES=${ZABBIX_BIN:S|^|zabbix_|:C|.+|&/&|:S|agentd/|agent/|}
+ZABBIX_CFGFILES=${ZABBIX_CFG:S|^|zabbix_|:S|$|.conf|}
+PLIST_FILES= ${ZABBIX_BIN:S|^|bin/zabbix_|} \
+ ${ZABBIX_CFG:S|^|etc/zabbix/zabbix_|:S|$|.conf.sample|}
+
+post-patch:
+ @${FIND} ${WRKSRC}/src/ -type f|${XARGS} \
+ ${REINPLACE_CMD} -Ee 's|(/etc/zabbix)|${PREFIX}\1|;s|/usr/sbin|${LOCALBASE}/sbin|'
+
+do-install:
+ @${ECHO_CMD} '@unexec rmdir %D/etc/zabbix 2>/dev/null || true' >> ${TMPPLIST}
+ @${INSTALL_PROGRAM} ${ZABBIX_BINFILES:S,^,${WRKSRC}/src/,} ${PREFIX}/bin/
+ @${INSTALL} -d ${PREFIX}/etc/zabbix/
+.for FILE in ${ZABBIX_CFGFILES}
+ ${INSTALL_DATA} ${WRKSRC}/misc/conf/${FILE} ${PREFIX}/etc/zabbix/${FILE}.sample
+.endfor
+ ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
+
+.include <bsd.port.mk>
diff --git a/net/zabbix-agent/distinfo b/net/zabbix-agent/distinfo
new file mode 100644
index 000000000000..30a3b6723ef4
--- /dev/null
+++ b/net/zabbix-agent/distinfo
@@ -0,0 +1,3 @@
+MD5 (zabbix-1.4.tar.gz) = 29f605d939c10c571dac79a107a7745f
+SHA256 (zabbix-1.4.tar.gz) = ed1cb9437a5bd3d3f81b3969303c7bfb3d395f3e636fd19ddcbc52a1a800ba66
+SIZE (zabbix-1.4.tar.gz) = 3141667
diff --git a/net/zabbix-agent/files/patch-configure b/net/zabbix-agent/files/patch-configure
new file mode 100644
index 000000000000..ca3fbf1c242a
--- /dev/null
+++ b/net/zabbix-agent/files/patch-configure
@@ -0,0 +1,12 @@
+--- ./configure.orig Sat Jan 27 20:39:51 2007
++++ ./configure Sat Jan 27 20:48:34 2007
+@@ -275,6 +275,9 @@
+ # Factoring default headers for most tests.
+ ac_includes_default="\
+ #include <stdio.h>
++#include <sys/socket.h>
++#include <sys/param.h>
++#include <netinet/in.h>
+ #if HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
diff --git a/net/zabbix-agent/files/zabbix_agentd.in b/net/zabbix-agent/files/zabbix_agentd.in
new file mode 100644
index 000000000000..0be45c4d2b66
--- /dev/null
+++ b/net/zabbix-agent/files/zabbix_agentd.in
@@ -0,0 +1,17 @@
+#!/bin/sh
+# PROVIDE: zabbix_agentd
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+
+. %%RC_SUBR%%
+
+name="zabbix_agentd"
+rcvar=${name}_enable
+load_rc_config $name
+eval : \${${rcvar}='NO'}
+
+command="%%PREFIX%%/bin/${name}"
+required_files="%%PREFIX%%/etc/zabbix/${name}.conf"
+
+
+run_rc_command "$1"
diff --git a/net/zabbix-agent/pkg-descr b/net/zabbix-agent/pkg-descr
new file mode 100644
index 000000000000..52ecef039fcf
--- /dev/null
+++ b/net/zabbix-agent/pkg-descr
@@ -0,0 +1,8 @@
+Zabbix is software for application and network monitoring.
+Zabbix supports both polling and trapping techniques to
+collect data from monitored hosts. Flexible notification
+mechanism allows easy and quckly configure email notifications
+for pre-defined events. Zabbix is freely available under the
+terms of the GNU General Public License (GPL).
+
+WWW: http://www.zabbix.com/
diff --git a/net/zabbix-agent/pkg-install b/net/zabbix-agent/pkg-install
new file mode 100644
index 000000000000..bd120120918d
--- /dev/null
+++ b/net/zabbix-agent/pkg-install
@@ -0,0 +1,45 @@
+#!/bin/sh
+# Script was taken from mysql323-server port, and modified
+# to suit zabbix needs
+
+[ -n "${PACKAGE_BUILDING}" ] && exit 0
+
+[ "${2}" = "POST-INSTALL" ] && exit 0
+
+PATH=/bin:/usr/sbin
+
+USER=zabbix
+GROUP=${USER}
+UID=112
+GID=${UID}
+
+if pw group show "${GROUP}" 2>/dev/null; then
+ echo "You already have a group \"${GROUP}\", so I will use it."
+else
+ if pw groupadd ${GROUP} -g ${GID}; then
+ echo "Added group \"${GROUP}\"."
+ else
+ echo "Adding group \"${GROUP}\" failed..."
+ exit 1
+ fi
+fi
+
+if pw user show "${USER}" 2>/dev/null; then
+ echo "You already have a user \"${USER}\", so I will use it."
+ if pw usermod ${USER} -d /nonexistent
+ then
+ echo "Changed home directory of \"${USER}\" to /nonexistent"
+ else
+ echo "Changing home directory of \"${USER}\" to /nonexistent failed..."
+ exit 1
+ fi
+else
+ if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
+ -d /nonexistent -s /sbin/nologin -c "Zabbix Sandbox"
+ then
+ echo "Added user \"${USER}\"."
+ else
+ echo "Adding user \"${USER}\" failed..."
+ exit 1
+ fi
+fi