-#
-# Copyright (C) 2006 OpenWrt.org
+#
+# Copyright (C) 2006-2009 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
-# $Id$
include $(TOPDIR)/rules.mk
PKG_NAME:=zabbix
-PKG_VERSION:=1.3.2
-PKG_RELEASE:=1
-PKG_MD5SUM:=698a07f4e53820e44ef4a72c7c191e92
+PKG_VERSION:=1.6
+PKG_RELEASE:=2
+PKG_MD5SUM:=39d4c871439b1b4f0429964b4abbfc45
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://kent.dl.sourceforge.net/sourceforge/zabbix/
-PKG_CAT:=zcat
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
-PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
+PKG_SOURCE_URL:=@SF/zabbix
PKG_BUILD_DEPENDS:=libsqlite3
SECTION:=admin
CATEGORY:=Administration
TITLE:=Zabbix
- DESCRIPTION:=\
- ZABBIX is an enterprise-class distributed monitoring solution for networks \\\
- and applications. Native high-performance ZABBIX agents allow monitoring of \\\
- performance and availability data of all operating systems.
URL:=http://www.zabbix.com/
SUBMENU:=zabbix
+ DEPENDS:=+libcurl
endef
define Package/zabbix-agent
define Package/zabbix-server
$(call Package/zabbix/Default)
TITLE+= server
- DEPENDS:=+libsqlite3
+ DEPENDS += +libsqlite3
endef
define Package/zabbix-agent/install
$(INSTALL_DIR) $(1)/usr/sbin
- $(CP) $(PKG_INSTALL_DIR)/usr/sbin/zabbix_agentd $(1)/usr/sbin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/zabbix_agentd $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/zabbix
- $(INSTALL_CONF) $(PKG_BUILD_DIR)/misc/conf/zabbix_agentd.conf $(1)/etc/zabbix/
+ $(INSTALL_CONF) ./files/zabbix_agentd.conf $(1)/etc/zabbix/
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/zabbix_agentd.init $(1)/etc/init.d/zabbix_agentd
+endef
+
+define Package/zabbix-agent/postinst
+#!/bin/sh
+
+name=zabbix
+id=53
+
+# do not change below
+# check if we are on real system
+if [ -z "$${IPKG_INSTROOT}" ]; then
+ # create copies of passwd and group, if we use squashfs
+ rootfs=`mount |awk '/root/ { print $$5 }'`
+ if [ "$$rootfs" = "squashfs" ]; then
+ if [ -h /etc/group ]; then
+ rm /etc/group
+ cp /rom/etc/group /etc/group
+ fi
+ if [ -h /etc/passwd ]; then
+ rm /etc/passwd
+ cp /rom/etc/passwd /etc/passwd
+ fi
+ fi
+fi
+
+echo ""
+if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
+ echo "adding group $$name to /etc/group"
+ echo "$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc/group
+fi
+
+if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
+ echo "adding user $$name to /etc/passwd"
+ echo "$${name}:x:$${id}:$${id}:$${name}:/tmp/.$${name}:/bin/false" >> $${IPKG_INSTROOT}/etc/passwd
+fi
+
+chown $${name} $${IPKG_INSTROOT}/etc/zabbix/zabbix_agentd.conf
+
endef
define Package/zabbix-sender/install
$(INSTALL_DIR) $(1)/usr/sbin
- $(CP) $(PKG_INSTALL_DIR)/usr/sbin/zabbix_sender $(1)/usr/sbin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/zabbix_sender $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/zabbix
endef
define Package/zabbix-server/install
$(INSTALL_DIR) $(1)/usr/sbin
- $(CP) $(PKG_INSTALL_DIR)/usr/sbin/zabbix_server $(1)/usr/sbin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/zabbix_server $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/zabbix
$(INSTALL_CONF) $(PKG_BUILD_DIR)/misc/conf/zabbix_server.conf $(1)/etc/zabbix/
endef