2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
13 PKG_MD5SUM
:=39d4c871439b1b4f0429964b4abbfc45
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
16 PKG_SOURCE_URL
:=@SF
/zabbix
18 PKG_BUILD_DEPENDS
:=libsqlite3
20 include $(INCLUDE_DIR
)/package.mk
22 define Package
/zabbix
/Default
24 CATEGORY
:=Administration
26 URL
:=http
://www.zabbix.com
/
30 define Package
/zabbix-agent
31 $(call Package
/zabbix
/Default
)
35 define Package
/zabbix-sender
36 $(call Package
/zabbix
/Default
)
40 define Package
/zabbix-server
41 $(call Package
/zabbix
/Default
)
48 CONFIG_PACKAGE_zabbix-server
:=m
51 PKG_CONFIGURE_OPTIONS
:= \
52 --bindir="/usr/sbin" \
55 ifneq ($(CONFIG_PACKAGE_zabbix-server
),)
56 PKG_CONFIGURE_OPTIONS
+= \
58 --with-sqlite3
="$(STAGING_DIR)/usr"
61 define Build
/Configure
62 $(call Build
/Configure
/Default
, \
63 $(PKG_CONFIGURE_OPTIONS
) \
68 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
69 DESTDIR
="$(PKG_INSTALL_DIR)" \
73 define Package
/zabbix-agent
/conffiles
74 /etc
/zabbix
/zabbix_agentd.conf
77 define Package
/zabbix-agent
/install
78 $(INSTALL_DIR
) $(1)/usr
/sbin
79 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/zabbix_agentd
$(1)/usr
/sbin
/
80 $(INSTALL_DIR
) $(1)/etc
/zabbix
81 $(INSTALL_CONF
) .
/files
/zabbix_agentd.conf
$(1)/etc
/zabbix
/
82 $(INSTALL_DIR
) $(1)/etc
/init.d
83 $(INSTALL_BIN
) .
/files
/zabbix_agentd.init
$(1)/etc
/init.d
/zabbix_agentd
86 define Package
/zabbix-agent
/postinst
93 # check if we are on real system
94 if
[ -z
"$${IPKG_INSTROOT}" ]; then
95 # create copies of passwd and group, if we use squashfs
96 rootfs
=`mount |awk '/root/ { print $$5 }'`
97 if
[ "$$rootfs" = "squashfs" ]; then
98 if
[ -h
/etc
/group
]; then
100 cp
/rom
/etc
/group
/etc
/group
102 if
[ -h
/etc
/passwd
]; then
104 cp
/rom
/etc
/passwd
/etc
/passwd
110 if
[ -z
"$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
111 echo
"adding group $$name to /etc/group"
112 echo
"$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc
/group
115 if
[ -z
"$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
116 echo
"adding user $$name to /etc/passwd"
117 echo
"$${name}:x:$${id}:$${id}:$${name}:/tmp/.$${name}:/bin/false" >> $${IPKG_INSTROOT}/etc
/passwd
122 define Package
/zabbix-sender
/install
123 $(INSTALL_DIR
) $(1)/usr
/sbin
124 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/zabbix_sender
$(1)/usr
/sbin
/
125 $(INSTALL_DIR
) $(1)/etc
/zabbix
128 define Package
/zabbix-server
/conffiles
129 /etc
/zabbix
/zabbix_server.conf
132 define Package
/zabbix-server
/install
133 $(INSTALL_DIR
) $(1)/usr
/sbin
134 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/zabbix_server
$(1)/usr
/sbin
/
135 $(INSTALL_DIR
) $(1)/etc
/zabbix
136 $(INSTALL_CONF
) $(PKG_BUILD_DIR
)/misc
/conf
/zabbix_server.conf
$(1)/etc
/zabbix
/
139 $(eval
$(call BuildPackage
,zabbix-agent
))
140 $(eval
$(call BuildPackage
,zabbix-sender
))
141 $(eval
$(call BuildPackage
,zabbix-server
))