Fresh pull from upstream (stable) package feed
[librecmc/package-feed.git] / lang / lua-rs232 / Makefile
1 #
2 # Copyright (C) 2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=lua-rs232
11 PKG_VERSION:=1.0.3
12 PKG_RELEASE:=1
13 PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
14 PKG_LICENSE:=MIT
15
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17 PKG_SOURCE_URL:=https://github.com/srdgame/librs232.git
18 PKG_SOURCE_PROTO:=git
19 PKG_SOURCE_VERSION:=a9d463181e7f7034fe6a55bc38e845fb04fa93ba
20 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
21
22 PKG_INSTALL:=1
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/lua-rs232
27   SUBMENU:=Lua
28   SECTION:=lang
29   CATEGORY:=Languages
30   TITLE:=Lua Serial Library
31   URL:=https://github.com/srdgame/librs232
32   DEPENDS:= +lua
33 endef
34
35 define Package/lua-rs232/description
36   multiplatform library for serial communications over RS-232
37 endef
38
39 CONFIGURE_ARGS += \
40         --with-lua-inc=$(STAGING_DIR)/usr/include \
41         --with-lua-lib=$(STAGING_DIR)/usr/lib
42
43 #define Build/Configure
44 #       ( cd "$(PKG_BUILD_DIR)"; ./autogen.sh )
45 #       $(call Build/Configure/Default)
46 #endef
47 define Build/Configure
48 endef
49
50 define Build/Compile
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)
52 endef
53
54 define Build/Install
55 endef
56
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/
60 endef
61
62 $(eval $(call BuildPackage,lua-rs232))