Merge pull request #4853 from StevenHessing/noddos
[feed/packages.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_MIRROR_HASH:=fb2f6453537e10beb2cd99d30eb1b4259ab75452992ca8a65d621186cf320960
18 PKG_SOURCE_URL:=https://github.com/srdgame/librs232.git
19 PKG_SOURCE_PROTO:=git
20 PKG_SOURCE_VERSION:=a9d463181e7f7034fe6a55bc38e845fb04fa93ba
21 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
22
23 PKG_INSTALL:=1
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/lua-rs232
28 SUBMENU:=Lua
29 SECTION:=lang
30 CATEGORY:=Languages
31 TITLE:=Lua Serial Library
32 URL:=https://github.com/srdgame/librs232
33 DEPENDS:= +lua
34 endef
35
36 define Package/lua-rs232/description
37 multiplatform library for serial communications over RS-232
38 endef
39
40 CONFIGURE_ARGS += \
41 --with-lua-inc=$(STAGING_DIR)/usr/include \
42 --with-lua-lib=$(STAGING_DIR)/usr/lib
43
44 #define Build/Configure
45 # ( cd "$(PKG_BUILD_DIR)"; ./autogen.sh )
46 # $(call Build/Configure/Default)
47 #endef
48 define Build/Configure
49 endef
50
51 define Build/Compile
52 (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)
53 endef
54
55 define Build/Install
56 endef
57
58 define Package/lua-rs232/install
59 $(INSTALL_DIR) $(1)/usr/lib/lua
60 $(INSTALL_BIN) $(PKG_BUILD_DIR)/luars232.so $(1)/usr/lib/lua/
61 endef
62
63 $(eval $(call BuildPackage,lua-rs232))