Explorar o código

lua-neturl: initial package

Signed-off-by: Tianling Shen <[email protected]>
Tianling Shen %!s(int64=3) %!d(string=hai) anos
pai
achega
f6a37fdf8b
Modificáronse 2 ficheiros con 55 adicións e 0 borrados
  1. 44 0
      lua-neturl/Makefile
  2. 11 0
      lua-neturl/patches/010-userinfo-regex.patch

+ 44 - 0
lua-neturl/Makefile

@@ -0,0 +1,44 @@
+# SPDX-License-Identifier: GPL-3.0-only
+#
+# Copyright (C) 2022 ImmortalWrt.org
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=neturl
+PKG_VERSION:=1.1-1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/golgote/neturl/tar.gz/v$(PKG_VERSION)?
+PKG_HASH:=25f3a94ba9f435ef1395555de2bf17d6f934d789fa515ed965405919e42be27b
+
+PKG_MAINTAINER:=Tianling Shen <[email protected]>
+PKG_LICENSE:=MIT
+PKG_LICNESE_FILES:=LICENSE.txt
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/lua-neturl
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=URL and Query string parser, builder, normalizer for Lua
+  URL:=https://github.com/golgote/neturl
+  DEPENDS:=+lua
+  PKGARCH:=all
+endef
+
+define Package/lua-neturl/description
+  This small Lua library provides a few functions to parse URL with
+  querystring and build new URL easily.
+endef
+
+define Build/Compile
+endef
+
+define Package/lua-neturl/install
+	$(INSTALL_DIR) $(1)/usr/lib/lua
+	$(CP) $(PKG_BUILD_DIR)/lib/net/url.lua $(1)/usr/lib/lua/
+endef
+
+$(eval $(call BuildPackage,lua-neturl))

+ 11 - 0
lua-neturl/patches/010-userinfo-regex.patch

@@ -0,0 +1,11 @@
+--- a/lib/net/url.lua
++++ b/lib/net/url.lua
+@@ -340,7 +340,7 @@ function M:setAuthority(authority)
+ 				self.password = v
+ 				return ''
+ 		end)
+-		if string.find(userinfo, "^[%w%+%.]+$") then
++		if string.find(userinfo, "^[%p%w%+%.]+$") then
+ 			self.user = userinfo
+ 		else
+ 			-- incorrect userinfo