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
21 include $(INCLUDE_DIR
)/package.mk
23 define Package
/zabbix
/Default
25 CATEGORY
:=Administration
27 URL
:=http
://www.zabbix.com
/
32 define Package
/zabbix-agent
33 $(call Package
/zabbix
/Default
)
37 define Package
/zabbix-sender
38 $(call Package
/zabbix
/Default
)
42 define Package
/zabbix-server
43 $(call Package
/zabbix
/Default
)
45 DEPENDS
+= +libsqlite3
50 CONFIG_PACKAGE_zabbix-server
:=m
53 PKG_CONFIGURE_OPTIONS
:= \
54 --bindir="/usr/sbin" \
57 ifneq ($(CONFIG_PACKAGE_zabbix-server
),)
58 PKG_CONFIGURE_OPTIONS
+= \
60 --with-sqlite3
="$(STAGING_DIR)/usr"
63 MAKE_FLAGS
+= ARCH
="linux"
65 define Build
/Configure
66 $(call Build
/Configure
/Default
, \
67 $(PKG_CONFIGURE_OPTIONS
) \
71 define Package
/zabbix-agent
/conffiles
72 /etc
/zabbix
/zabbix_agentd.conf
75 define Package
/zabbix-agent
/install
76 $(INSTALL_DIR
) $(1)/usr
/sbin
77 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/zabbix_agentd
$(1)/usr
/sbin
/
78 $(INSTALL_DIR
) $(1)/etc
/zabbix
79 $(INSTALL_CONF
) .
/files
/zabbix_agentd.conf
$(1)/etc
/zabbix
/
80 $(INSTALL_DIR
) $(1)/etc
/init.d
81 $(INSTALL_BIN
) .
/files
/zabbix_agentd.init
$(1)/etc
/init.d
/zabbix_agentd
84 define Package
/zabbix-agent
/postinst
91 # check if we are on real system
92 if
[ -z
"$${IPKG_INSTROOT}" ]; then
93 # create copies of passwd and group, if we use squashfs
94 rootfs
=`mount |awk '/root/ { print $$5 }'`
95 if
[ "$$rootfs" = "squashfs" ]; then
96 if
[ -h
/etc
/group
]; then
98 cp
/rom
/etc
/group
/etc
/group
100 if
[ -h
/etc
/passwd
]; then
102 cp
/rom
/etc
/passwd
/etc
/passwd
108 if
[ -z
"$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
109 echo
"adding group $$name to /etc/group"
110 echo
"$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc
/group
113 if
[ -z
"$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
114 echo
"adding user $$name to /etc/passwd"
115 echo
"$${name}:x:$${id}:$${id}:$${name}:/tmp/.$${name}:/bin/false" >> $${IPKG_INSTROOT}/etc
/passwd
118 chown
$${name} $${IPKG_INSTROOT}/etc
/zabbix
/zabbix_agentd.conf
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
))