Makefile 1.7 KB

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