5774c001992f0b32040610b803d0f286bb9b9e03
[openwrt/svn-archive/archive.git] / admin / zabbix / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=zabbix
12 PKG_VERSION:=1.3.2
13 PKG_RELEASE:=1
14 PKG_MD5SUM:=698a07f4e53820e44ef4a72c7c191e92
15
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=@SF/zabbix
18
19 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
20 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
21
22 PKG_BUILD_DEPENDS:=libsqlite3
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/zabbix/Default
27 SECTION:=admin
28 CATEGORY:=Administration
29 TITLE:=Zabbix
30 URL:=http://www.zabbix.com/
31 SUBMENU:=zabbix
32 endef
33
34 define Package/zabbix-agent
35 $(call Package/zabbix/Default)
36 TITLE+= agent
37 endef
38
39 define Package/zabbix-sender
40 $(call Package/zabbix/Default)
41 TITLE+= sender
42 endef
43
44 define Package/zabbix-server
45 $(call Package/zabbix/Default)
46 TITLE+= server
47 DEPENDS:=+libsqlite3
48 endef
49
50
51 ifneq ($(SDK),)
52 CONFIG_PACKAGE_zabbix-server:=m
53 endif
54
55 PKG_CONFIGURE_OPTIONS:= \
56 --bindir="/usr/sbin" \
57 --enable-agent
58
59 ifneq ($(CONFIG_PACKAGE_zabbix-server),)
60 PKG_CONFIGURE_OPTIONS+= \
61 --enable-server \
62 --with-sqlite3="$(STAGING_DIR)/usr"
63 endif
64
65 define Build/Configure
66 $(call Build/Configure/Default, \
67 $(PKG_CONFIGURE_OPTIONS) \
68 )
69 endef
70
71 define Build/Compile
72 $(MAKE) -C $(PKG_BUILD_DIR) \
73 DESTDIR="$(PKG_INSTALL_DIR)" \
74 all install
75 endef
76
77 define Package/zabbix-agent/conffiles
78 /etc/zabbix/zabbix_agentd.conf
79 endef
80
81 define Package/zabbix-agent/install
82 $(INSTALL_DIR) $(1)/usr/sbin
83 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/zabbix_agentd $(1)/usr/sbin/
84 $(INSTALL_DIR) $(1)/etc/zabbix
85 $(INSTALL_CONF) $(PKG_BUILD_DIR)/misc/conf/zabbix_agentd.conf $(1)/etc/zabbix/
86 endef
87
88 define Package/zabbix-sender/install
89 $(INSTALL_DIR) $(1)/usr/sbin
90 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/zabbix_sender $(1)/usr/sbin/
91 $(INSTALL_DIR) $(1)/etc/zabbix
92 endef
93
94 define Package/zabbix-server/conffiles
95 /etc/zabbix/zabbix_server.conf
96 endef
97
98 define Package/zabbix-server/install
99 $(INSTALL_DIR) $(1)/usr/sbin
100 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/zabbix_server $(1)/usr/sbin/
101 $(INSTALL_DIR) $(1)/etc/zabbix
102 $(INSTALL_CONF) $(PKG_BUILD_DIR)/misc/conf/zabbix_server.conf $(1)/etc/zabbix/
103 endef
104
105 $(eval $(call BuildPackage,zabbix-agent))
106 $(eval $(call BuildPackage,zabbix-sender))
107 $(eval $(call BuildPackage,zabbix-server))