%global lua_minver 5.1 %{!?lua_version: %global lua_version %([[ -x /usr/bin/lua ]] && lua -e "print(string.sub(_VERSION, 5))" || echo %{lua_minver})} %global lua_libdir %{_libdir}/lua/%{lua_version} BuildRequires: libtool BuildRequires: lua >= 5.1 BuildRequires: lua-devel >= 5.1 Name: lua-bit32 Version: 5.3.0 Release: 2%{?dist} License: MIT Summary: Backport of Lua bit manipulation library introduced in 5.2 Url: https://luarocks.org/modules/siffiejoe/bit32 Requires: lua(abi) = %{lua_version} Source0: https://github.com/keplerproject/lua-compat-5.2/archive/bitlib-%{version}.tar.gz %description bit32 is the native Lua 5.2 bit manipulation library, in the version from Lua 5.3; it is compatible with Lua 5.1, 5.2 and 5.3. %prep %autosetup -n lua-compat-5.2-bitlib-%{version} %build gcc %{optflags} -I/usr/include -I./c-api $(pkg-config --libs lua) lbitlib.c -shared -fPIC -o bit32.so %install install -d %{buildroot}%{lua_libdir} install -p bit32.so %{buildroot}%{lua_libdir}/ %files %license LICENSE %doc README.md %{lua_libdir}/bit32.so %changelog * Wed May 10 2017 Michel Alexandre Salim - 5.3.0-2 - Remove defattr * Mon May 08 2017 Michel Alexandre Salim - 5.3.0-1 - Initial package