Also contains a HMAC implementation in Lua.
endef
-define Build/Configure
-endef
+TARGET_CFLAGS += -fPIC -DSHA2_USE_INTTYPES_H -DBYTE_ORDER -DLITTLE_ENDIAN
+TARGET_LDFLAGS += -fPIC -DSHA2_USE_INTTYPES_H -DBYTE_ORDER -DLITTLE_ENDIAN
-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
+define Build/Configure
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
+ $(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))