#
# Copyright (C) 2006-2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=youcan
PKG_VERSION:=1.0.0

include $(INCLUDE_DIR)/package.mk

define Package/youcan
  SECTION:=LNXALL
  CATEGORY:=LNXALL Software
  TITLE:=Youth of Unity Control Area Network application, YOUCAN
  DEPENDS:=+liblua
endef

define Package/youcan/description
    reimplementation of the old protocol_parser application
endef

define Build/Compile
	cd $(PKG_BUILD_DIR) && make TARGET_CC="$(TARGET_CC)" \
		TARGET_CFLAGS="$(TARGET_CFLAGS)" TARGET_STRIP="$(TARGET_CROSS)strip"
endef

define Package/youcan/install
	$(INSTALL_DIR) $(1)/app
	$(INSTALL_DIR) $(1)/usr/lib
	$(INSTALL_DIR) $(1)/etc/init.d
	$(INSTALL_BIN) ./files/youcan $(1)/etc/init.d/
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/youcan $(1)/app/
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/cmod/libcmod.so $(1)/usr/lib/
endef

undefine DESCRIPTION # to avoid error: DESCRIPTION:= is obsolete, use Package/PKG_NAME/descriptio
$(eval $(call BuildPackage,youcan))
