2 # Copyright (C) 2006-2009 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
/
31 define Package
/zabbix-agent
32 $(call Package
/zabbix
/Default
)
36 define Package
/zabbix-sender
37 $(call Package
/zabbix
/Default
)
41 define Package
/zabbix-server
42 $(call Package
/zabbix
/Default
)
44 DEPENDS
+= +libsqlite3
49 CONFIG_PACKAGE_zabbix-server
:=m
52 PKG_CONFIGURE_OPTIONS
:= \
53 --bindir="/usr/sbin" \
56 ifneq ($(CONFIG_PACKAGE_zabbix-server
),)
57 PKG_CONFIGURE_OPTIONS
+= \
59 --with-sqlite3
="$(STAGING_DIR)/usr"
62 define Build
/Configure
63 $(call Build
/Configure
/Default
, \
64 $(PKG_CONFIGURE_OPTIONS
) \
69 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
70 DESTDIR
="$(PKG_INSTALL_DIR)" \
74 define Package
/zabbix-agent
/conffiles
75 /etc
/zabbix
/zabbix_agentd.conf
78 define Package
/zabbix-agent
/install
79 $(INSTALL_DIR
) $(1)/usr
/sbin
80 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/zabbix_agentd
$(1)/usr
/sbin
/
81 $(INSTALL_DIR
) $(1)/etc
/zabbix
82 $(INSTALL_CONF
) .
/files
/zabbix_agentd.conf
$(1)/etc
/zabbix
/
83 $(INSTALL_DIR
) $(1)/etc
/init.d
84 $(INSTALL_BIN
) .
/files
/zabbix_agentd.init
$(1)/etc
/init.d
/zabbix_agentd
87 define Package
/zabbix-agent
/postinst
94 # check if we are on real system
95 if
[ -z
"$${IPKG_INSTROOT}" ]; then
96 # create copies of passwd and group, if we use squashfs
97 rootfs
=`mount |awk '/root/ { print $$5 }'`
98 if
[ "$$rootfs" = "squashfs" ]; then
99 if
[ -h
/etc
/group
]; then
101 cp
/rom
/etc
/group
/etc
/group
103 if
[ -h
/etc
/passwd
]; then
105 cp
/rom
/etc
/passwd
/etc
/passwd
111 if
[ -z
"$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
112 echo
"adding group $$name to /etc/group"
113 echo
"$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc
/group
116 if
[ -z
"$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
117 echo
"adding user $$name to /etc/passwd"
118 echo
"$${name}:x:$${id}:$${id}:$${name}:/tmp/.$${name}:/bin/false" >> $${IPKG_INSTROOT}/etc
/passwd
121 chown
$${name} $${IPKG_INSTROOT}/etc
/zabbix
/zabbix_agentd.conf
125 define Package
/zabbix-sender
/install
126 $(INSTALL_DIR
) $(1)/usr
/sbin
127 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/zabbix_sender
$(1)/usr
/sbin
/
128 $(INSTALL_DIR
) $(1)/etc
/zabbix
131 define Package
/zabbix-server
/conffiles
132 /etc
/zabbix
/zabbix_server.conf
135 define Package
/zabbix-server
/install
136 $(INSTALL_DIR
) $(1)/usr
/sbin
137 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/zabbix_server
$(1)/usr
/sbin
/
138 $(INSTALL_DIR
) $(1)/etc
/zabbix
139 $(INSTALL_CONF
) $(PKG_BUILD_DIR
)/misc
/conf
/zabbix_server.conf
$(1)/etc
/zabbix
/
142 $(eval
$(call BuildPackage
,zabbix-agent
))
143 $(eval
$(call BuildPackage
,zabbix-sender
))
144 $(eval
$(call BuildPackage
,zabbix-server
))