2 # Copyright (C) 2015 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_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=https://github.com/srdgame/librs232.git
19 PKG_SOURCE_VERSION:=a9d463181e7f7034fe6a55bc38e845fb04fa93ba
20 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
24 include $(INCLUDE_DIR)/package.mk
26 define Package/lua-rs232
30 TITLE:=Lua Serial Library
31 URL:=https://github.com/srdgame/librs232
35 define Package/lua-rs232/description
36 multiplatform library for serial communications over RS-232
40 --with-lua-inc=$(STAGING_DIR)/usr/include \
41 --with-lua-lib=$(STAGING_DIR)/usr/lib
43 #define Build/Configure
44 # ( cd "$(PKG_BUILD_DIR)"; ./autogen.sh )
45 # $(call Build/Configure/Default)
47 define Build/Configure
51 (cd "$(PKG_BUILD_DIR)"; $(TARGET_CC) src/rs232.c src/rs232_posix.c bindings/lua/luars232.c -DLUAROCKS_HACK -std=gnu99 -I./include -I$(STAGING_DIR)/usr/include -L$(STAGING_DIR)/usr/lib -fPIC -shared -o luars232.so)
57 define Package/lua-rs232/install
58 $(INSTALL_DIR) $(1)/usr/lib/lua
59 $(INSTALL_BIN) $(PKG_BUILD_DIR)/luars232.so $(1)/usr/lib/lua/
62 $(eval $(call BuildPackage,lua-rs232))