diff --git a/lua-socket.spec b/lua-socket.spec index 8acc98df6e1c2799c4cf85c9b955119ee3f39021..c7220f1b59dd29c79a91aef3272cc645aef1b7e3 100644 --- a/lua-socket.spec +++ b/lua-socket.spec @@ -1,17 +1,13 @@ Name: lua-socket -Version: 3.0 -Release: 0.19 +Version: 3.0.0 +Release: 1 Summary: Network support for the Lua language License: MIT -URL: https://www.tecgraf.puc-rio.br/~diego/professional/luasocket/ -Source0: https://github.com/diegonehab/luasocket/archive/v3.0-rc1.tar.gz - -Patch0: luasocket-optflags.patch -Patch1: luasocket-no-global-vars.patch -Patch2: luasocket-3.0-settimeout.patch +URL: https://lunarmodules.github.io/luasocket/ +Source0: https://github.com/lunarmodules/luasocket/archive/refs/tags/v%{version}.tar.gz BuildRequires: gcc lua lua-devel /usr/bin/iconv -Requires: lua >= 5.3 +%{?lua_requires} %description LuaSocket is a Lua extension library that is composed by two parts: a C core @@ -30,36 +26,36 @@ Lua using %{name} %package_help %prep -%autosetup -n luasocket-3.0-rc1 -p1 +%autosetup -n luasocket-%{version} -p1 %build -%make_build LUAV=5.3 OPTFLAGS="%{optflags} -fPIC" LDFLAGS="%{?__global_ldflags} -shared -o " linux +%make_build LUAV=%lua_version CFLAGS_linux="%{build_cflags} -fPIC -I%{_includedir} -DLUASOCKET_NODEBUG -DLUA_COMPAT_APIINTCASTS" LDFLAGS="%{?__global_ldflags} -shared -o " linux /usr/bin/iconv -f ISO8859-1 -t UTF8 LICENSE >LICENSE.UTF8 mv -f LICENSE.UTF8 LICENSE %install make install-unix OPTFLAGS="%{optflags}" INSTALL_TOP=$RPM_BUILD_ROOT \ - INSTALL_TOP_CDIR=$RPM_BUILD_ROOT%{_libdir}/lua/5.3 \ - INSTALL_TOP_LDIR=$RPM_BUILD_ROOT%{_datadir}/lua/5.3 + INSTALL_TOP_CDIR=$RPM_BUILD_ROOT%{lua_libdir} \ + INSTALL_TOP_LDIR=$RPM_BUILD_ROOT%{lua_pkgdir} install -d $RPM_BUILD_ROOT%{_includedir}/luasocket install -p src/*.h $RPM_BUILD_ROOT%{_includedir}/luasocket %files -%defattr(-,root,root) -%{!?_licensedir:%global license %%doc} %license LICENSE -%{_libdir}/lua/5.3/* -%{_datadir}/lua/5.3/* +%{lua_libdir}/* +%{lua_pkgdir}/* %files devel -%defattr(-,root,root) %{_includedir}/luasocket %files help -%defattr(-,root,root) -%doc README doc/* +%doc README.md docs/* %changelog +* Fri Nov 01 2024 Funda Wang - 3.0.0-1 +- 3.0.0 final +- rebuild for lua 5.4 + * Mon Sep 16 2019 openEuler Buildteam - 3.0-0.19 - Package init diff --git a/lua-socket.yaml b/lua-socket.yaml index e4be9f9ba90bcdccc508c9cee5773b76d7f26206..b36498503cd8a352fc5a1a20a7119f0c5b56590d 100644 --- a/lua-socket.yaml +++ b/lua-socket.yaml @@ -1,4 +1,4 @@ version_control: github src_repo: diegonehab/luasocket tag_prefix: ^v -seperator: . +separator: . diff --git a/luasocket-3.0-settimeout.patch b/luasocket-3.0-settimeout.patch deleted file mode 100644 index 724ec24f98f1ecbb1de68f0941502d5640eb9cf6..0000000000000000000000000000000000000000 --- a/luasocket-3.0-settimeout.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 396e9e5ee67dd3169aef6ef734d1f5e6f0ec76a9 Mon Sep 17 00:00:00 2001 -From: Diego Nehab -Date: Mon, 9 Sep 2013 14:23:00 -0300 -Subject: [PATCH] Fixed timeout bug introduced by commit e81a6ff - ---- - src/buffer.c | 12 ++++-------- - 1 file changed, 4 insertions(+), 8 deletions(-) - -diff --git a/src/buffer.c b/src/buffer.c -index 4ef4e8e..423d804 100644 ---- a/src/buffer.c -+++ b/src/buffer.c -@@ -78,9 +78,7 @@ int buffer_meth_send(lua_State *L, p_buffer buf) { - const char *data = luaL_checklstring(L, 2, &size); - long start = (long) luaL_optnumber(L, 3, 1); - long end = (long) luaL_optnumber(L, 4, -1); --#ifdef LUASOCKET_DEBUG -- p_timeout tm = timeout_markstart(buf->tm); --#endif -+ timeout_markstart(buf->tm); - if (start < 0) start = (long) (size+start+1); - if (end < 0) end = (long) (size+end+1); - if (start < 1) start = (long) 1; -@@ -98,7 +96,7 @@ int buffer_meth_send(lua_State *L, p_buffer buf) { - } - #ifdef LUASOCKET_DEBUG - /* push time elapsed during operation as the last return value */ -- lua_pushnumber(L, timeout_gettime() - timeout_getstart(tm)); -+ lua_pushnumber(L, timeout_gettime() - timeout_getstart(buf->tm)); - #endif - return lua_gettop(L) - top; - } -@@ -111,9 +109,7 @@ int buffer_meth_receive(lua_State *L, p_buffer buf) { - luaL_Buffer b; - size_t size; - const char *part = luaL_optlstring(L, 3, "", &size); --#ifdef LUASOCKET_DEBUG -- p_timeout tm = timeout_markstart(buf->tm); --#endif -+ timeout_markstart(buf->tm); - /* initialize buffer with optional extra prefix - * (useful for concatenating previous partial results) */ - luaL_buffinit(L, &b); -@@ -149,7 +145,7 @@ int buffer_meth_receive(lua_State *L, p_buffer buf) { - } - #ifdef LUASOCKET_DEBUG - /* push time elapsed during operation as the last return value */ -- lua_pushnumber(L, timeout_gettime() - timeout_getstart(tm)); -+ lua_pushnumber(L, timeout_gettime() - timeout_getstart(buf->tm)); - #endif - return lua_gettop(L) - top; - } diff --git a/luasocket-no-global-vars.patch b/luasocket-no-global-vars.patch deleted file mode 100644 index e32f25dc20704d01aab8dbe4ff7af7c3a592a63f..0000000000000000000000000000000000000000 --- a/luasocket-no-global-vars.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/src/http.lua b/src/http.lua -index ac4b2d6..f83dcc5 100644 ---- a/src/http.lua -+++ b/src/http.lua -@@ -22,7 +22,7 @@ local _M = socket.http - -- Program constants - ----------------------------------------------------------------------------- - -- connection timeout in seconds --TIMEOUT = 60 -+_M.TIMEOUT = 60 - -- default port for document retrieval - _M.PORT = 80 - -- user agent field sent in request -@@ -186,7 +186,7 @@ end - local function adjusturi(reqt) - local u = reqt - -- if there is a proxy, we need the full url. otherwise, just a part. -- if not reqt.proxy and not PROXY then -+ if not reqt.proxy and not _M.PROXY then - u = { - path = socket.try(reqt.path, "invalid path 'nil'"), - params = reqt.params, -@@ -198,7 +198,7 @@ local function adjusturi(reqt) - end - - local function adjustproxy(reqt) -- local proxy = reqt.proxy or PROXY -+ local proxy = reqt.proxy or _M.PROXY - if proxy then - proxy = url.parse(proxy) - return proxy.host, proxy.port or 3128 diff --git a/luasocket-optflags.patch b/luasocket-optflags.patch deleted file mode 100644 index d02908da50233d8859a5e65ec04eadbf25579d1a..0000000000000000000000000000000000000000 --- a/luasocket-optflags.patch +++ /dev/null @@ -1,60 +0,0 @@ ---- a/src/makefile -+++ b/src/makefile -@@ -53,7 +53,7 @@ CDIR_linux?=lib/lua/$(LUAV) - LDIR_linux?=share/lua/$(LUAV) - - # where lua headers are found for mingw builds --# LUAINC_mingw: -+# LUAINC_mingw: - # /opt/local/include - LUAINC_mingw_base?=/usr/include - LUAINC_mingw?=$(LUAINC_mingw_base)/lua/$(LUAV) -@@ -135,7 +135,7 @@ DEF_macosx= -DLUASOCKET_$(DEBUG) -DUNIX_ - -DMIME_API='__attribute__((visibility("default")))' - CFLAGS_macosx= -I$(LUAINC) $(DEF) -pedantic -Wall -O2 -fno-common \ - -fvisibility=hidden --LDFLAGS_macosx= -bundle -undefined dynamic_lookup -o -+LDFLAGS_macosx= -bundle -undefined dynamic_lookup -o - LD_macosx= export MACOSX_DEPLOYMENT_TARGET="10.3"; gcc - SOCKET_macosx=usocket.o - -@@ -149,9 +149,9 @@ DEF_linux=-DLUASOCKET_$(DEBUG) -DLUA_$(C - -DLUASOCKET_API='__attribute__((visibility("default")))' \ - -DUNIX_API='__attribute__((visibility("default")))' \ - -DMIME_API='__attribute__((visibility("default")))' --CFLAGS_linux= -I$(LUAINC) $(DEF) -pedantic -Wall -Wshadow -Wextra \ -- -Wimplicit -O2 -ggdb3 -fpic -fvisibility=hidden --LDFLAGS_linux=-O -shared -fpic -o -+CFLAGS_linux= -I$(LUAINC) $(DEF) $(OPTFLAGS) \ -+ -fvisibility=hidden -+LDFLAGS_linux=$(OPTFLAGS) -shared -o - LD_linux=gcc - SOCKET_linux=usocket.o - -@@ -166,7 +166,7 @@ DEF_mingw= -DLUASOCKET_INET_PTON -DLUASO - -DMIME_API='__declspec(dllexport)' - CFLAGS_mingw= -I$(LUAINC) $(DEF) -pedantic -Wall -O2 -fno-common \ - -fvisibility=hidden --LDFLAGS_mingw= $(LUALIB) -shared -Wl,-s -lws2_32 -o -+LDFLAGS_mingw= $(LUALIB) -shared -Wl,-s -lws2_32 -o - LD_mingw=gcc - SOCKET_mingw=wsocket.o - -@@ -181,7 +181,7 @@ DEF_win32= //D "WIN32" //D "NDEBUG" //D - //D "LUASOCKET_API=__declspec(dllexport)" //D "_CRT_SECURE_NO_WARNINGS" \ - //D "_WINDLL" //D "LUA_$(COMPAT)_MODULE" \ - //D "MIME_API=__declspec(dllexport)" \ -- //D "LUASOCKET_$(DEBUG)" -+ //D "LUASOCKET_$(DEBUG)" - CFLAGS_win32=//I "$(LUAINC)" $(DEF) //O2 //Ot //MD //W3 //nologo - LDFLAGS_win32= //nologo //link //NOLOGO //DLL //INCREMENTAL:NO \ - //MANIFEST //MANIFESTFILE:"intermediate.manifest" \ -@@ -323,7 +323,7 @@ $(UNIX_SO): $(UNIX_OBJS) - $(SERIAL_SO): $(SERIAL_OBJS) - $(LD) $(SERIAL_OBJS) $(LDFLAGS)$@ - --install: -+install: - $(INSTALL_DIR) $(INSTALL_TOP_LDIR) - $(INSTALL_DATA) $(TO_TOP_LDIR) $(INSTALL_TOP_LDIR) - $(INSTALL_DIR) $(INSTALL_SOCKET_LDIR) diff --git a/v3.0-rc1.tar.gz b/v3.0-rc1.tar.gz deleted file mode 100644 index 74b1adca9f2e417cc2b931e49b64547323cb058c..0000000000000000000000000000000000000000 Binary files a/v3.0-rc1.tar.gz and /dev/null differ diff --git a/v3.0.0.tar.gz b/v3.0.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..d8f436420b7f94f6b8b07e69b6a1bfcc0d1ef2cb Binary files /dev/null and b/v3.0.0.tar.gz differ