fix zabbix build with the SDK
[packages.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
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://kent.dl.sourceforge.net/sourceforge/zabbix/
17 PKG_CAT:=zcat
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   DESCRIPTION:=\
31         ZABBIX is an enterprise-class distributed monitoring solution for networks \\\
32         and applications. Native high-performance ZABBIX agents allow monitoring of \\\
33         performance and availability data of all operating systems.
34   URL:=http://www.zabbix.com/
35   SUBMENU:=zabbix
36 endef
37
38 define Package/zabbix-agent
39   $(call Package/zabbix/Default)
40   TITLE+= agent
41 endef
42
43 define Package/zabbix-sender
44   $(call Package/zabbix/Default)
45   TITLE+= sender
46 endef
47
48 define Package/zabbix-server
49   $(call Package/zabbix/Default)
50   TITLE+= server
51   DEPENDS:=+libsqlite3
52 endef
53
54
55 ifneq ($(SDK),)
56 CONFIG_PACKAGE_zabbix-server:=m
57 endif
58
59 PKG_CONFIGURE_OPTIONS:= \
60         --bindir="/usr/sbin" \
61         --enable-agent
62
63 ifneq ($(CONFIG_PACKAGE_zabbix-server),)
64 PKG_CONFIGURE_OPTIONS+= \
65         --enable-server \
66         --with-sqlite3="$(STAGING_DIR)/usr"
67 endif
68
69 define Build/Configure
70         $(call Build/Configure/Default, \
71                 $(PKG_CONFIGURE_OPTIONS) \
72         )
73 endef
74
75 define Build/Compile
76         $(MAKE) -C $(PKG_BUILD_DIR) \
77                 DESTDIR="$(PKG_INSTALL_DIR)" \
78                 all install
79 endef
80
81 define Package/zabbix-agent/conffiles
82 /etc/zabbix/zabbix_agentd.conf
83 endef
84
85 define Package/zabbix-agent/install
86         $(INSTALL_DIR) $(1)/usr/sbin
87         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/zabbix_agentd $(1)/usr/sbin/
88         $(INSTALL_DIR) $(1)/etc/zabbix
89         $(INSTALL_CONF) $(PKG_BUILD_DIR)/misc/conf/zabbix_agentd.conf $(1)/etc/zabbix/
90 endef
91
92 define Package/zabbix-sender/install
93         $(INSTALL_DIR) $(1)/usr/sbin
94         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/zabbix_sender $(1)/usr/sbin/
95         $(INSTALL_DIR) $(1)/etc/zabbix
96 endef
97
98 define Package/zabbix-server/conffiles
99 /etc/zabbix/zabbix_server.conf
100 endef
101
102 define Package/zabbix-server/install
103         $(INSTALL_DIR) $(1)/usr/sbin
104         $(CP) $(PKG_INSTALL_DIR)/usr/sbin/zabbix_server $(1)/usr/sbin/
105         $(INSTALL_DIR) $(1)/etc/zabbix
106         $(INSTALL_CONF) $(PKG_BUILD_DIR)/misc/conf/zabbix_server.conf $(1)/etc/zabbix/
107 endef
108
109 $(eval $(call BuildPackage,zabbix-agent))
110 $(eval $(call BuildPackage,zabbix-sender))
111 $(eval $(call BuildPackage,zabbix-server))