zabbix: preserve conffile over sysupgrade
[openwrt/svn-archive/packages.git] / admin / zabbix / Makefile
1 #
2 # Copyright (C) 2006-2012 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=zabbix
11 PKG_VERSION:=2.0.0
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@SF/zabbix
16 PKG_MD5SUM:=d34d398beddee0eaa999789100cf74e3
17
18 PKG_INSTALL:=1
19
20 PKG_FIXUP:=autoreconf
21
22 include $(INCLUDE_DIR)/package.mk
23 include $(INCLUDE_DIR)/nls.mk
24
25 define Package/zabbix/Default
26 SECTION:=admin
27 CATEGORY:=Administration
28 TITLE:=Zabbix
29 URL:=http://www.zabbix.com/
30 SUBMENU:=zabbix
31 MAINTAINER:=Mirko Vogt <mirko@openwrt.org>
32 endef
33
34 define Package/zabbix-agent
35 $(call Package/zabbix/Default)
36 TITLE+= agent
37 endef
38
39 define Package/zabbix-agentd
40 $(call Package/zabbix/Default)
41 TITLE+= agentd
42 endef
43
44 define Package/zabbix-sender
45 $(call Package/zabbix/Default)
46 TITLE+= sender
47 endef
48
49 define Package/zabbix-get
50 $(call Package/zabbix/Default)
51 TITLE+= get
52 endef
53
54 define Package/zabbix-server
55 $(call Package/zabbix/Default)
56 TITLE+= server
57 DEPENDS += +libsqlite3
58 endef
59
60 define Package/zabbix-proxy
61 $(call Package/zabbix/Default)
62 TITLE+= proxy
63 DEPENDS += +libsqlite3
64 endef
65
66 define Package/zabbix-agentd/config
67 select BUSYBOX_CONFIG_HOSTNAME if !PACKAGE_net-tools-hostname
68 select BUSYBOX_CONFIG_UNAME if !PACKAGE_coreutils-uname
69 endef
70
71 CONFIGURE_ARGS+= \
72 --enable-agent \
73 --enable-server \
74 --enable-proxy \
75 --disable-java \
76 --with-sqlite3="$(STAGING_DIR)/usr"
77
78 MAKE_FLAGS += ARCH="linux"
79
80 define Package/zabbix/install/sbin
81 $(INSTALL_DIR) \
82 $(1)/usr/sbin
83
84 $(INSTALL_BIN) \
85 $(PKG_INSTALL_DIR)/usr/sbin/zabbix_$(2) \
86 $(1)/usr/sbin/
87 endef
88
89 define Package/zabbix/install/bin
90 $(INSTALL_DIR) \
91 $(1)/usr/bin
92
93 $(INSTALL_BIN) \
94 $(PKG_INSTALL_DIR)/usr/bin/zabbix_$(2) \
95 $(1)/usr/bin/
96 endef
97
98 define Package/zabbix/install/etc
99 $(INSTALL_DIR) \
100 $(1)/etc
101
102 $(INSTALL_CONF) \
103 $(PKG_INSTALL_DIR)/etc/zabbix_$(2).conf \
104 $(1)/etc/
105 endef
106
107 define Package/zabbix/install/init.d
108 $(INSTALL_DIR) \
109 $(1)/etc/init.d
110
111 $(INSTALL_BIN) \
112 ./files/zabbix_$(2).init \
113 $(1)/etc/init.d/zabbix_$(2)
114 endef
115
116 define Package/zabbix-agent/conffiles
117 /etc/zabbix_agent.conf
118 endef
119 define Package/zabbix-agentd/conffiles
120 /etc/zabbix_agentd.conf
121 endef
122 define Package/zabbix-server/conffiles
123 /etc/zabbix_server.conf
124 endef
125 define Package/zabbix-proxy/conffiles
126 /etc/zabbix_proxy.conf
127 endef
128
129 define Package/zabbix-agent/install
130 $(call Package/zabbix/install/sbin,$(1),agent)
131 $(call Package/zabbix/install/etc,$(1),agent)
132 endef
133
134 define Package/zabbix-agentd/install
135 $(call Package/zabbix/install/sbin,$(1),agentd)
136 $(call Package/zabbix/install/etc,$(1),agentd)
137 $(call Package/zabbix/install/init.d,$(1),agentd)
138 endef
139
140 define Package/zabbix-sender/install
141 $(call Package/zabbix/install/bin,$(1),sender)
142 endef
143
144 define Package/zabbix-get/install
145 $(call Package/zabbix/install/bin,$(1),get)
146 endef
147
148 define Package/zabbix-server/install
149 $(call Package/zabbix/install/sbin,$(1),server)
150 $(call Package/zabbix/install/etc,$(1),server)
151 endef
152
153 define Package/zabbix-proxy/install
154 $(call Package/zabbix/install/sbin,$(1),proxy)
155 $(call Package/zabbix/install/etc,$(1),proxy)
156 endef
157
158 $(eval $(call BuildPackage,zabbix-agent))
159 $(eval $(call BuildPackage,zabbix-agentd))
160 $(eval $(call BuildPackage,zabbix-sender))
161 $(eval $(call BuildPackage,zabbix-server))
162 $(eval $(call BuildPackage,zabbix-proxy))
163 $(eval $(call BuildPackage,zabbix-get))