Makefile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=lua-md5
  9. PKG_VERSION:=1.2
  10. PKG_RELEASE:=1
  11. PKG_MAINTAINER:=Dirk Chang <dirk@kooiot.com>
  12. PKG_LICENSE:=MIT
  13. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  14. PKG_MIRROR_HASH:=89a186d9e8bb43a6d45207eeba2883600854ea05befda55b38f7ac215b0d5615
  15. PKG_SOURCE_URL:=https://github.com/keplerproject/md5.git
  16. PKG_SOURCE_PROTO:=git
  17. PKG_SOURCE_VERSION:=024b65738b4434860777fc43d7cacaefea29ec60
  18. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  19. PKG_INSTALL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/lua-md5
  22. SUBMENU:=Lua
  23. SECTION:=lang
  24. CATEGORY:=Languages
  25. TITLE:=Lua-MD5
  26. URL:=https://github.com/keplerproject/md5
  27. DEPENDS:=+lua
  28. endef
  29. define Package/lua-md5/description
  30. MD5 offers basic cryptographic facilities for Lua
  31. endef
  32. TARGET_CFLAGS += $(FPIC)
  33. # add make variable overrides here
  34. MAKE_FLAGS +=
  35. define Build/Configure
  36. endef
  37. define Build/Compile
  38. $(MAKE) -C $(PKG_BUILD_DIR) \
  39. PREFIX="$(STAGING_DIR)/usr" \
  40. LUA_LIBDIR="$(STAGING_DIR)/usr/lib/lua" \
  41. clean
  42. $(MAKE) -C $(PKG_BUILD_DIR) \
  43. PREFIX="$(STAGING_DIR)/usr" \
  44. LUA_LIBDIR="$(STAGING_DIR)/usr/lib/lua" \
  45. LIB_OPTION="-shared" \
  46. CC="$(TARGET_CROSS)gcc" \
  47. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
  48. all
  49. endef
  50. define Build/Install
  51. $(MAKE) -C $(PKG_BUILD_DIR) \
  52. LUA_LIBDIR="$(PKG_INSTALL_DIR)/usr/lib/lua" \
  53. LUA_DIR="$(PKG_INSTALL_DIR)/usr/lib/lua" \
  54. install
  55. endef
  56. define Package/lua-md5/install
  57. $(INSTALL_DIR) $(1)/usr/lib/lua
  58. $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/md5.lua $(1)/usr/lib/lua
  59. $(INSTALL_DIR) $(1)/usr/lib/lua/md5
  60. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/core.so $(1)/usr/lib/lua/md5/core.so
  61. endef
  62. $(eval $(call BuildPackage,lua-md5))