You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.5 KiB

  1. #
  2. # Copyright (C) 20013-2014 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-sha2
  9. PKG_VERSION:=0.2.0
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_MIRROR_HASH:=79e65bd7cb1b8ef64e125c9e57f40b7d38678599587c1894ce57838814403945
  13. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  14. PKG_SOURCE_URL:=https://github.com/lgierth/lua-sha2.git
  15. PKG_SOURCE_PROTO:=git
  16. PKG_SOURCE_VERSION:=02bd4bfdc8062c7e1ae51c5a72906efc0a6375ee
  17. PKG_LICENSE:=MIT
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/lua-sha2
  20. SUBMENU:=Lua
  21. SECTION:=lang
  22. CATEGORY:=Languages
  23. TITLE:=Lua binding for Aaron Gifford's SHA-2 implementation
  24. URL:=https://code.google.com/p/sha2/
  25. MAINTAINER:=Lars Gierth <larsg@systemli.org>
  26. DEPENDS:=+lua
  27. endef
  28. define Package/lua-sha2/description
  29. Lua Binding for the SHA-2 (SHA-256/384/512) BSD-licensed C implementation by Aaron Gifford.
  30. Also contains a HMAC implementation in Lua.
  31. endef
  32. TARGET_CFLAGS += -fPIC -DSHA2_USE_INTTYPES_H -DBYTE_ORDER -DLITTLE_ENDIAN
  33. TARGET_LDFLAGS += -fPIC -DSHA2_USE_INTTYPES_H -DBYTE_ORDER -DLITTLE_ENDIAN
  34. define Build/Configure
  35. endef
  36. define Package/lua-sha2/install
  37. $(INSTALL_DIR) $(1)/usr/lib/lua/hmac
  38. $(INSTALL_DATA) $(PKG_BUILD_DIR)/sha2.so $(1)/usr/lib/lua
  39. $(INSTALL_DATA) $(PKG_BUILD_DIR)/hmac.lua $(1)/usr/lib/lua
  40. $(INSTALL_DATA) $(PKG_BUILD_DIR)/hmac/sha2.lua $(1)/usr/lib/lua/hmac
  41. $(INSTALL_DATA) $(PKG_BUILD_DIR)/hmac/md5.lua $(1)/usr/lib/lua/hmac
  42. endef
  43. $(eval $(call BuildPackage,lua-sha2))