diff --git a/1.0.6.tar.gz b/1.0.6.tar.gz
deleted file mode 100644
index 4b5c2d2..0000000
--- a/1.0.6.tar.gz
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:66811e30b316b53d1e3c4225248d4813b8b852c3e19121ba5ad47a9d4537d1ae
-size 14557
diff --git a/_multibuild b/_multibuild
index 72d2b45..e83a16c 100644
--- a/_multibuild
+++ b/_multibuild
@@ -1,5 +1,5 @@
-lua51
+luajit
lua53
lua54
diff --git a/_scmsync.obsinfo b/_scmsync.obsinfo
new file mode 100644
index 0000000..aec96bf
--- /dev/null
+++ b/_scmsync.obsinfo
@@ -0,0 +1,5 @@
+mtime: 1761593012
+commit: f2a6396c0fa4c97eef5e499d4bb01e282a11e727df08ae5be65753c9f57af1df
+url: https://src.opensuse.org/lua/lua-mpack.git
+revision: f2a6396c0fa4c97eef5e499d4bb01e282a11e727df08ae5be65753c9f57af1df
+projectscmsync: https://src.opensuse.org/lua/_ObsPrj.git
diff --git a/build.specials.obscpio b/build.specials.obscpio
new file mode 100644
index 0000000..b2668d0
--- /dev/null
+++ b/build.specials.obscpio
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4dd65341b5347701c3aa39103c3f1578451837b16c74da3191b07f6833680f0d
+size 308
diff --git a/lua-mpack.changes b/lua-mpack.changes
index a8ca212..49c2fdb 100644
--- a/lua-mpack.changes
+++ b/lua-mpack.changes
@@ -1,3 +1,27 @@
+-------------------------------------------------------------------
+Mon Oct 27 19:22:34 UTC 2025 - Matej Cepl
+
+- Update to 1.0.13:
+ - fix: make the package build with Lua API < 5.2
+ - support various lua executable formats
+- Remove upstreamed patch:
+ - luajit-build.patch
+
+-------------------------------------------------------------------
+Fri Oct 24 14:50:42 UTC 2025 - Matej Cepl
+
+- Switch off building lua51 build of the package.
+
+-------------------------------------------------------------------
+Mon Oct 13 13:21:48 UTC 2025 - Matej Cepl
+
+- Make the package buildable with LuaJIT.
+- Removed upstreamed patches:
+ - lua51-mpack-fix-compilation.patch
+ - lua51-mpack-fix-gcc7.patch
+- Add luajit-build.patch to make the source compatible with Lua
+ API < 5.2 (gh#libmpack/libmpack-lua!34).
+
-------------------------------------------------------------------
Thu Feb 22 09:55:44 UTC 2024 - Michael Vetter
diff --git a/lua-mpack.spec b/lua-mpack.spec
index ff108a7..8ec4872 100644
--- a/lua-mpack.spec
+++ b/lua-mpack.spec
@@ -19,24 +19,19 @@
%define flavor @BUILD_FLAVOR@
%define libmpack_version 1.0.5
%define mod_name mpack
-Version: 1.0.6
+Version: 1.0.13
Release: 0
Summary: Implementation of MessagePack for Lua 5.1
License: MIT
Group: Development/Libraries/Other
URL: https://github.com/libmpack/libmpack-lua
-Source: https://github.com/libmpack/libmpack-lua/archive/%{version}.tar.gz
-# libmpack source is necessary to build lua-mpack, next release should build
-# fine against system version
-# The latest source can be downloaded from: https://github.com/libmpack/libmpack
-Source1: https://github.com/libmpack/libmpack/archive/%{libmpack_version}/libmpack-%{libmpack_version}.tar.gz
-# PATCH-FIX-UPSTREAM lua51-mpack-fix-gcc7.patch gh#libmpack/libmpack-lua#3 -- Fix compilation error when using GCC7.
-Patch0: lua51-mpack-fix-gcc7.patch
-# PATCH-FIX-UPSTREAM lua51-mpack-fix-compilation.patch gh#libmpack/libmpack-lua#2 -- Fix compilation error when using `USE_SYSTEM_LUA=1`.
-Patch1: lua51-mpack-fix-compilation.patch
+Source: https://github.com/libmpack/libmpack-lua/archive/refs/tags/%{version}.tar.gz#/%{mod_name}-%{version}.tar.gz
+# libmpack source is necessary to build lua-mpack, need to package mpack to Factory
+Source1: https://github.com/libmpack/libmpack/archive/refs/tags/%{libmpack_version}.tar.gz#/libmpack-%{libmpack_version}.tar.gz
BuildRequires: %{flavor}-devel
BuildRequires: gcc
BuildRequires: libtool
+BuildRequires: pkgconfig
BuildRequires: lua-macros
Requires: %{flavor}
%lua_provides
@@ -54,12 +49,8 @@ and msgpack-rpc specifications.
%prep
%autosetup -p1 -n libmpack-lua-%{version}
-# Extract the libmpack source to the right directory.
-mkdir -p mpack-src
-pushd mpack-src
-cp %{SOURCE1} ./
-tar --strip-components=1 -xzf libmpack-%{libmpack_version}.tar.gz
-popd
+( mkdir -p "mpack-src" && cd "mpack-src"
+tar --extract --strip-components=1 --file %{SOURCE1} )
# Fix lua directory.
sed -i 's|LUA_CMOD_INSTALLDIR :=.*|LUA_CMOD_INSTALLDIR := $(shell echo "%{lua_archdir}")|g' Makefile
@@ -67,15 +58,16 @@ sed -i 's|LUA_CMOD_INSTALLDIR :=.*|LUA_CMOD_INSTALLDIR := $(shell echo "%{lua_ar
%build
make %{?_make_output_sync} %{?_smp_mflags} \
USE_SYSTEM_LUA=yes \
- MPACK_LUA_VERSION=%{lua_version} \
- CFLAGS="%{optflags} -fPIC"
+ USE_SYSTEM_MPACK=no \
+ LUA_IMPL="lua" \
+ CFLAGS="%{optflags} -fPIC %(pkgconf --cflags --libs lua)"
%install
-%make_install USE_SYSTEM_LUA=yes
+%make_install USE_SYSTEM_LUA=yes \
+ LUA_CMOD_INSTALLDIR="%{lua_archdir}"
%files
%doc mpack-src/LICENSE-MIT README.md
-%dir %{lua_archdir}
-%{lua_archdir}/*
+%{lua_archdir}/mpack.so
%changelog
diff --git a/lua51-mpack-fix-compilation.patch b/lua51-mpack-fix-compilation.patch
deleted file mode 100644
index d39d547..0000000
--- a/lua51-mpack-fix-compilation.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: libmpack-lua-1.0.6/Makefile
-===================================================================
---- libmpack-lua-1.0.6.orig/Makefile
-+++ libmpack-lua-1.0.6/Makefile
-@@ -99,7 +99,7 @@ $(MPACK): $(LUAROCKS) mpack-src lmpack.c
- $(LUAROCKS) make CFLAGS='$(CFLAGS)'
- else
- $(MPACK): mpack-src lmpack.c
-- $(CC) -shared $(CFLAGS) $(INCLUDES) $(LDFLAGS) $^ -o $@ $(LIBS)
-+ $(CC) -shared $(CFLAGS) $(INCLUDES) $(LDFLAGS) lmpack.c -o $@ $(LIBS)
- endif
-
- $(BUSTED): $(LUAROCKS)
diff --git a/lua51-mpack-fix-gcc7.patch b/lua51-mpack-fix-gcc7.patch
deleted file mode 100644
index c6fdf40..0000000
--- a/lua51-mpack-fix-gcc7.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Index: libmpack-lua-1.0.6/lmpack.c
-===================================================================
---- libmpack-lua-1.0.6.orig/lmpack.c
-+++ libmpack-lua-1.0.6/lmpack.c
-@@ -689,6 +689,7 @@ static void lmpack_unparse_enter(mpack_p
- node->tok = mpack_pack_nil();
- break;
- }
-+ /* Fallthrough */
- default:
- luaL_error(L, "can't serialize object");
- }
-
-%changelog
diff --git a/mpack-1.0.13.tar.gz b/mpack-1.0.13.tar.gz
new file mode 100644
index 0000000..f79ef6e
--- /dev/null
+++ b/mpack-1.0.13.tar.gz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:436a6a3973207403d3f20082002c32e74c25d9149ff2516dc06b0b41514044bf
+size 16556