# 
# Copyright (C) 2009 DrayTek Corp.
#
# This is not free software, 
#

include $(TOPDIR)/rules.mk

PKG_NAME:=drayvoip
PKG_VERSION:=1.0.0
PKG_RELEASE:=1

include $(INCLUDE_DIR)/package.mk

define Package/drayvoip
  SECTION:=voip
  CATEGORY:=DrayTek Applications
  TITLE:=DrayTek SIP UA and PSM
  MAINTAINER:=Kevin Yu@DrayTek Corp.
  URL:=http://www.draytek.com/rd2/
  PKG_BUILD_DEPENDS:=+libosip2 +webif-webstax
endef

define Package/drayvoip/description
	drayvoip is a VoIP application implement by DrayTek Corp.
endef
 
define Package/drayvoip/conffiles
/etc/config/voip.conf
endef

#
# copy the source code to build folder
#
define Build/Compile
	@echo "Compile..................."
	$(INSTALL_DIR) $(PKG_BUILD_DIR)/binary
	tar xzfO $(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_arm.ipk ./data.tar.gz | tar -C $(PKG_BUILD_DIR)/binary -xzf -
endef
 
#
# $(1) = /build_dir/arm/drayvoip-1.0.0/ipkg/drayvoip
#
define Package/drayvoip/install
	@echo "Install.................."
	$(CP) $(PKG_BUILD_DIR)/binary/* $(1)
endef

$(eval $(call BuildPackage,drayvoip))

