%define luarocks_pkg_name lua-path %define luarocks_pkg_version 0.3.1-1 %define luarocks_pkg_prefix lua-path-0.3.1-1 %define luarocks_pkg_major 0.3.1 %define luarocks_pkg_minor 1 %{?!luadist:%define luadist(-) lua} Name: lua-path Version: %{luarocks_pkg_major} Release: %{luarocks_pkg_minor} Summary: File system path manipulation library Url: https://github.com/moteus/lua-path License: MIT/X11 Source0: lua-path-0.3.1-1.tar.gz Source1: lua-path-0.3.1-1.rockspec BuildRequires: lua-rpm-macros BuildRequires: luarocks-macros Requires(postun): alternatives Requires(post): alternatives Provides: %{luadist %{luarocks_pkg_name} = %{luarocks_pkg_version}} BuildArch: noarch %global __luarocks_requires %{_bindir}/true %global __luarocks_provides %{_bindir}/true Requires: %{luadist lua >= 5.1, < 5.5} %{?luarocks_subpackages:%luarocks_subpackages -f} %{?!luarocks_subpackages:Provides: luadist(%{luarocks_pkg_name}) = %{luarocks_pkg_version}} %description %prep %autosetup -p1 -n %{luarocks_pkg_prefix} %luarocks_prep %generate_buildrequires %{?luarocks_buildrequires_echo} %if %{with check} %luarocks_generate_buildrequires -c -b %else %luarocks_generate_buildrequires -b %endif %build %{?custom_build} %if %{defined luarocks_subpackages_build} %{luarocks_subpackages_build} %else %if %{defined luarocks_pkg_build} %luarocks_pkg_build %{lua_version} %else %luarocks_build --local %{SOURCE1} %endif %endif %install %{?custom_install} %if %{defined luarocks_subpackages_install} %{luarocks_subpackages_install} %else %if %{defined luarocks_pkg_install} %luarocks_pkg_install %{lua_version} %else %luarocks_install %{luarocks_pkg_prefix}.*.rock %endif %endif %{?lua_generate_file_list} %check %if %{with check} %{?luarocks_check} %endif %files %{?lua_files}%{!?lua_files:-f lua_files.list}