Merge pull request #4820 from dibdot/adblock
[feed/packages.git] / lang / lua-md5 / 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-md5
11 PKG_VERSION:=1.2
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:=89a186d9e8bb43a6d45207eeba2883600854ea05befda55b38f7ac215b0d5615
18 PKG_SOURCE_URL:=https://github.com/keplerproject/md5.git
19 PKG_SOURCE_PROTO:=git
20 PKG_SOURCE_VERSION:=024b65738b4434860777fc43d7cacaefea29ec60
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-md5
28 SUBMENU:=Lua
29 SECTION:=lang
30 CATEGORY:=Languages
31 TITLE:=Lua-MD5
32 URL:=https://github.com/keplerproject/md5
33 DEPENDS:=+lua
34 endef
35
36 define Package/lua-md5/description
37 MD5 offers basic cryptographic facilities for Lua
38 endef
39
40 TARGET_CFLAGS += $(FPIC)
41
42 # add make variable overrides here
43 MAKE_FLAGS +=
44
45 define Build/Configure
46 endef
47
48 define Build/Compile
49 $(MAKE) -C $(PKG_BUILD_DIR) \
50 PREFIX="$(STAGING_DIR)/usr" \
51 LUA_LIBDIR="$(STAGING_DIR)/usr/lib/lua" \
52 clean
53 $(MAKE) -C $(PKG_BUILD_DIR) \
54 PREFIX="$(STAGING_DIR)/usr" \
55 LUA_LIBDIR="$(STAGING_DIR)/usr/lib/lua" \
56 LIB_OPTION="-shared" \
57 CC="$(TARGET_CROSS)gcc" \
58 CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
59 all
60 endef
61
62 define Build/Install
63 $(MAKE) -C $(PKG_BUILD_DIR) \
64 LUA_LIBDIR="$(PKG_INSTALL_DIR)/usr/lib/lua" \
65 LUA_DIR="$(PKG_INSTALL_DIR)/usr/lib/lua" \
66 install
67 endef
68
69 define Package/lua-md5/install
70 $(INSTALL_DIR) $(1)/usr/lib/lua
71 $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/md5.lua $(1)/usr/lib/lua
72 $(INSTALL_DIR) $(1)/usr/lib/lua/md5
73 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/core.so $(1)/usr/lib/lua/md5/core.so
74 endef
75
76 $(eval $(call BuildPackage,lua-md5))