Merge pull request #2058 from jefferyto/python-txsocksx
[feed/packages.git] / admin / zabbix / Makefile
1 #
2 # Copyright (C) 2006-2015 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.4.6
12 PKG_RELEASE:=3
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=@SF/zabbix
16 PKG_MD5SUM:=06ad8d5808a0eddf2b9f0a256b6a5fde
17
18 PKG_LICENSE:=GPL-2.0
19 PKG_LICENSE_FILES:=COPYING
20
21 PKG_INSTALL:=1
22
23 PKG_FIXUP:=autoreconf
24
25 include $(INCLUDE_DIR)/package.mk
26 include $(INCLUDE_DIR)/nls.mk
27
28 define Package/zabbix/Default
29 SECTION:=admin
30 CATEGORY:=Administration
31 TITLE:=Zabbix
32 URL:=http://www.zabbix.com/
33 SUBMENU:=zabbix
34 MAINTAINER:=Etienne CHAMPETIER <champetier.etienne@gmail.com>
35 USERID:=zabbix=53:zabbix=53
36 DEPENDS += $(ICONV_DEPENDS)
37 endef
38
39 define Package/zabbix-agent
40 $(call Package/zabbix/Default)
41 TITLE+= agent
42 endef
43
44 define Package/zabbix-agentd
45 $(call Package/zabbix/Default)
46 TITLE+= agentd
47 endef
48
49 define Package/zabbix-extra-mac80211
50 $(call Package/zabbix/Default)
51 TITLE+= discovery/userparameters for mac80211
52 DEPENDS = +zabbix-agentd @PACKAGE_MAC80211_DEBUGFS @KERNEL_DEBUG_FS
53 endef
54
55 define Package/zabbix-extra-network
56 $(call Package/zabbix/Default)
57 TITLE+= discovery/userparameters for network
58 DEPENDS = +zabbix-agentd +libuci-lua +lua
59 endef
60
61 define Package/zabbix-extra-wifi
62 $(call Package/zabbix/Default)
63 TITLE+= discovery/userparameters for wifi
64 DEPENDS = +zabbix-agentd +libiwinfo-lua +libuci-lua +lua
65 endef
66
67 define Package/zabbix-sender
68 $(call Package/zabbix/Default)
69 TITLE+= sender
70 endef
71
72 define Package/zabbix-get
73 $(call Package/zabbix/Default)
74 TITLE+= get
75 endef
76
77 define Package/zabbix-server
78 $(call Package/zabbix/Default)
79 TITLE+= server
80 DEPENDS += +libsqlite3
81 endef
82
83 define Package/zabbix-proxy
84 $(call Package/zabbix/Default)
85 TITLE+= proxy
86 DEPENDS += +libsqlite3
87 endef
88
89 define Package/zabbix-extra-mac80211/description
90 An extra package for zabbix-agentd that adds a discovery rule for mac80211 wifi phy and many userparameters.
91 It contains an suid helper to allow zabbix-agentd to still run as zabbix user and not as root.
92 See http://wiki.openwrt.org/doc/howto/zabbix for ready to use zabbix templates.
93 endef
94
95 define Package/zabbix-extra-network/description
96 An extra package for zabbix-agentd that adds a discovery rule for openwrt network interfaces.
97 The idea here is to discover only interfaces listed in /etc/config/network (discover br-lan and not eth0.1 and wlan0)
98 See http://wiki.openwrt.org/doc/howto/zabbix for ready to use zabbix templates.
99 endef
100
101 define Package/zabbix-extra-wifi/description
102 An extra package for zabbix-agentd that adds a discovery rule for wifi interfaces and many userparameters.
103 As it uses libiwinfo, it works with all wifi devices supported by openwrt.
104 See http://wiki.openwrt.org/doc/howto/zabbix for ready to use zabbix templates.
105 endef
106
107 CONFIGURE_ARGS+= \
108 --enable-agent \
109 --enable-server \
110 --enable-proxy \
111 $(call autoconf_bool,CONFIG_IPV6,ipv6) \
112 --disable-java \
113 --with-sqlite3="$(STAGING_DIR)/usr"
114
115 MAKE_FLAGS += ARCH="linux"
116
117 define Package/zabbix/install/sbin
118 $(INSTALL_DIR) \
119 $(1)/usr/sbin
120
121 $(INSTALL_BIN) \
122 $(PKG_INSTALL_DIR)/usr/sbin/zabbix_$(2) \
123 $(1)/usr/sbin/
124 endef
125
126 define Package/zabbix/install/bin
127 $(INSTALL_DIR) \
128 $(1)/usr/bin
129
130 $(INSTALL_BIN) \
131 $(PKG_INSTALL_DIR)/usr/bin/zabbix_$(2) \
132 $(1)/usr/bin/
133 endef
134
135 define Package/zabbix/install/etc
136 $(INSTALL_DIR) \
137 $(1)/etc
138
139 $(INSTALL_CONF) \
140 $(PKG_INSTALL_DIR)/etc/zabbix_$(2).conf \
141 $(1)/etc/
142 endef
143
144 define Package/zabbix/install/init.d
145 $(INSTALL_DIR) \
146 $(1)/etc/init.d
147
148 $(INSTALL_BIN) \
149 ./files/zabbix_$(2).init \
150 $(1)/etc/init.d/zabbix_$(2)
151 endef
152
153 define Package/zabbix/install/zabbix.conf.d
154 $(INSTALL_DIR) \
155 $(1)/etc/zabbix_agentd.conf.d
156
157 $(INSTALL_BIN) \
158 ./files/$(2) \
159 $(1)/etc/zabbix_agentd.conf.d/$(2)
160 endef
161
162 define Package/zabbix-agent/conffiles
163 /etc/zabbix_agent.conf
164 endef
165 define Package/zabbix-agentd/conffiles
166 /etc/zabbix_agentd.conf
167 endef
168 define Package/zabbix-server/conffiles
169 /etc/zabbix_server.conf
170 endef
171 define Package/zabbix-proxy/conffiles
172 /etc/zabbix_proxy.conf
173 endef
174
175 ifdef CONFIG_PACKAGE_zabbix-extra-mac80211
176 define Build/Prepare/zabbix-extra-mac80211
177 mkdir -p $(PKG_BUILD_DIR)/zabbix-extra-mac80211
178 $(CP) ./files/zabbix_helper_mac80211.c $(PKG_BUILD_DIR)/zabbix-extra-mac80211/
179 endef
180
181 define Build/Compile/zabbix-extra-mac80211
182 $(TARGET_CC) $(TARGET_CFLAGS) $(PKG_BUILD_DIR)/zabbix-extra-mac80211/zabbix_helper_mac80211.c -o $(PKG_BUILD_DIR)/zabbix-extra-mac80211/zabbix_helper_mac80211
183 endef
184 endif
185
186 define Build/Prepare
187 $(call Build/Prepare/Default)
188 $(call Build/Prepare/zabbix-extra-mac80211)
189 endef
190
191 define Build/Compile
192 $(call Build/Compile/Default)
193 $(call Build/Compile/zabbix-extra-mac80211)
194 endef
195
196 define Package/zabbix-agent/install
197 $(call Package/zabbix/install/sbin,$(1),agent)
198 $(call Package/zabbix/install/etc,$(1),agent)
199 endef
200
201 define Package/zabbix-agentd/install
202 $(INSTALL_DIR) $(1)/etc/zabbix_agentd.conf.d
203 $(call Package/zabbix/install/sbin,$(1),agentd)
204 $(call Package/zabbix/install/etc,$(1),agentd)
205 $(call Package/zabbix/install/init.d,$(1),agentd)
206 endef
207
208 define Package/zabbix-extra-mac80211/install
209 $(call Package/zabbix/install/zabbix.conf.d,$(1),mac80211)
210 $(INSTALL_DIR) $(1)/usr/bin
211 $(INSTALL_BIN) $(PKG_BUILD_DIR)/zabbix-extra-mac80211/zabbix_helper_mac80211 $(1)/usr/bin/
212 chmod 4755 $(1)/usr/bin/zabbix_helper_mac80211
213 endef
214
215 define Package/zabbix-extra-network/install
216 $(call Package/zabbix/install/zabbix.conf.d,$(1),network)
217 endef
218
219 define Package/zabbix-extra-wifi/install
220 $(call Package/zabbix/install/zabbix.conf.d,$(1),wifi)
221 endef
222
223 define Package/zabbix-sender/install
224 $(call Package/zabbix/install/bin,$(1),sender)
225 endef
226
227 define Package/zabbix-get/install
228 $(call Package/zabbix/install/bin,$(1),get)
229 endef
230
231 define Package/zabbix-server/install
232 $(call Package/zabbix/install/sbin,$(1),server)
233 $(call Package/zabbix/install/etc,$(1),server)
234 endef
235
236 define Package/zabbix-proxy/install
237 $(call Package/zabbix/install/sbin,$(1),proxy)
238 $(call Package/zabbix/install/etc,$(1),proxy)
239 endef
240
241 $(eval $(call BuildPackage,zabbix-agent))
242 $(eval $(call BuildPackage,zabbix-agentd))
243 $(eval $(call BuildPackage,zabbix-extra-mac80211))
244 $(eval $(call BuildPackage,zabbix-extra-network))
245 $(eval $(call BuildPackage,zabbix-extra-wifi))
246 $(eval $(call BuildPackage,zabbix-sender))
247 $(eval $(call BuildPackage,zabbix-server))
248 $(eval $(call BuildPackage,zabbix-proxy))
249 $(eval $(call BuildPackage,zabbix-get))