From 19087c26da3253e8ef763568d259738c5e906f2e Mon Sep 17 00:00:00 2001 From: Aron Griffis Date: Mar 09 2019 13:22:33 +0000 Subject: Add compat 5.1 build for neovim, rhbz #1685781 --- diff --git a/lua-mpack.spec b/lua-mpack.spec index cdc7156..3024f3e 100644 --- a/lua-mpack.spec +++ b/lua-mpack.spec @@ -1,17 +1,21 @@ -#%{!?lua_version: %global lua_version %(lua -e "print(string.sub(_VERSION, 5))")} %global lua_version 5.3 %global lua_libdir %{_libdir}/lua/%{lua_version} %global lua_pkgdir %{_datadir}/lua/%{lua_version} +%global lua_compat_version 5.1 +%global lua_compat_libdir %{_libdir}/lua/%{lua_compat_version} +%global lua_compat_pkgdir %{_datadir}/lua/%{lua_compat_version} +%global lua_compat_builddir %{_builddir}/compat-lua-%{name}-%{version}-%{release} + %global libmpack_version 1.0.5 BuildRequires: libtool -BuildRequires: lua >= 5.3 -BuildRequires: lua-devel >= 5.3 +BuildRequires: lua >= %{lua_version} +BuildRequires: lua-devel >= %{lua_version} Name: lua-mpack Version: 1.0.7 -Release: 4%{?dist} +Release: 5%{?dist} License: MIT Summary: Implementation of MessagePack for Lua @@ -27,6 +31,16 @@ Source2: test_mpack.lua mpack is a small binary serialization/RPC library that implements both the msgpack and msgpack-rpc specifications. +%package -n compat-%{name} +Summary: Implementation of MessagePack for Lua %{lua_compat_version} +BuildRequires: compat-lua >= %{lua_compat_version} +BuildRequires: compat-lua-devel >= %{lua_compat_version} +Requires: lua(abi) = %{lua_compat_version} + +%description -n compat-%{name} +mpack is a small binary serialization/RPC library that implements +both the msgpack and msgpack-rpc specifications for Lua %{lua_compat_version}. + %prep %autosetup -p1 -n libmpack-lua-%{version} @@ -39,13 +53,26 @@ popd echo '#!/bin/sh' > ./configure chmod +x ./configure +rm -rf %{lua_compat_builddir} +cp -a . %{lua_compat_builddir} + %build %configure make %{?_smp_mflags} \ USE_SYSTEM_MPACK=no \ USE_SYSTEM_LUA=yes \ - LUA_INCLUDE="$(pkg-config --clfags lua)" + MPACK_LUA_VERSION=%{lua_version}.x \ + LUA_INCLUDE="$(pkg-config --cflags lua)" + +pushd %{lua_compat_builddir} +%configure +make %{?_smp_mflags} \ + USE_SYSTEM_MPACK=no \ + USE_SYSTEM_LUA=yes \ + MPACK_LUA_VERSION=%{lua_compat_version}.x \ + LUA_INCLUDE="$(pkg-config --cflags lua-%{lua_compat_version})" +popd %install make \ @@ -55,6 +82,15 @@ make \ DESTDIR=%{buildroot} \ install +pushd %{lua_compat_builddir} +make \ + USE_SYSTEM_MPACK=no \ + USE_SYSTEM_LUA=yes \ + LUA_CMOD_INSTALLDIR=%{lua_compat_libdir} \ + DESTDIR=%{buildroot} \ + install +popd + %check lua %{SOURCE2} @@ -62,7 +98,13 @@ lua %{SOURCE2} %doc README.md %{lua_libdir}/mpack.so +%files -n compat-%{name} +%{lua_compat_libdir}/mpack.so + %changelog +* Tue Mar 05 2019 Aron Griffis - 1.0.7-5 +- Add compat 5.1 build for neovim + * Fri Feb 01 2019 Fedora Release Engineering - 1.0.7-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild