From b1a8fd93aec4001b55b099028ccea960b716367e Mon Sep 17 00:00:00 2001 From: Lars Gierth Date: Mon, 1 Sep 2014 00:10:59 +0200 Subject: [PATCH] lua-sha2: import from https://github.com/SeattleMeshnet/meshbox.git Signed-off-by: Lars Gierth --- lang/lua-sha2/Makefile | 64 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 lang/lua-sha2/Makefile diff --git a/lang/lua-sha2/Makefile b/lang/lua-sha2/Makefile new file mode 100644 index 000000000..4338d6648 --- /dev/null +++ b/lang/lua-sha2/Makefile @@ -0,0 +1,64 @@ +# +# Copyright (C) 20013-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=lua-sha2 +PKG_VERSION:=0.2.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_URL:=https://code.google.com/p/sha2/ +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=02bd4bfdc806 +PKG_LICENSE:=MIT + +include $(INCLUDE_DIR)/package.mk + +define Package/lua-sha2 + SUBMENU:=Lua + SECTION:=lang + CATEGORY:=Languages + TITLE:=Lua binding for Aaron Gifford's SHA-2 implementation + URL:=https://code.google.com/p/sha2/ + MAINTAINER:=Lars Gierth + DEPENDS:=+lua +endef + +define Package/lua-sha2/description + Lua Binding for the SHA-2 (SHA-256/384/512) BSD-licensed C implementation by Aaron Gifford. + Also contains a HMAC implementation in Lua. +endef + +define Build/Configure +endef + +define Build/Compile + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR) -I$(STAGING_DIR)/usr/include -fPIC -DSHA2_USE_INTTYPES_H -DBYTE_ORDER -DLITTLE_ENDIAN" \ + LIBS="$(TARGET_LIBS)" \ + $(MAKE) -C $(PKG_BUILD_DIR) sha2lib.o sha2.o +endef + + +define Package/lua-sha2/install + CC="$(TARGET_CC)" \ + CFLAGS="$(TARGET_CFLAGS) -I$(PKG_BUILD_DIR) -I$(STAGING_DIR)/usr/include -fPIC -DSHA2_USE_INTTYPES_H -DBYTE_ORDER -DLITTLE_ENDIAN" \ + LIBS="$(TARGET_LIBS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + $(TARGET_CC) -shared -o $(PKG_BUILD_DIR)/sha2.so \ + $(PKG_BUILD_DIR)/sha2.o $(PKG_BUILD_DIR)/sha2lib.o + + $(INSTALL_DIR) $(1)/usr/lib/lua/hmac + $(INSTALL_DATA) $(PKG_BUILD_DIR)/sha2.so $(1)/usr/lib/lua + $(INSTALL_DATA) $(PKG_BUILD_DIR)/hmac.lua $(1)/usr/lib/lua + $(INSTALL_DATA) $(PKG_BUILD_DIR)/hmac/sha2.lua $(1)/usr/lib/lua/hmac + $(INSTALL_DATA) $(PKG_BUILD_DIR)/hmac/md5.lua $(1)/usr/lib/lua/hmac +endef + +$(eval $(call BuildPackage,lua-sha2))