%{!?lua_version: %global lua_version %{lua: print(string.sub(_VERSION, 5))}} %{!?lua_pkgdir: %global lua_pkgdir %{_datadir}/lua/%{lua_version}} %global luapkgname repl Name: lua-%{luapkgname} Version: 0.10 Release: 1%{?dist} Summary: A Lua REPL implemented in Lua for embedding in other programs. License: MIT URL: https://github.com/hoelzro/lua-%{luapkgname} Source0: https://github.com/hoelzro/lua-%{luapkgname}/archive/refs/tags/%{version}.tar.gz BuildArch: noarch BuildRequires: lua-devel BuildRequires: luarocks %description REPL.lua - a reusable Lua REPL written in Lua, and an alternative to /usr/bin/lua This project has two uses: * An alternative to the standalone interpreter included with Lua, one that supports things like plugins, tab completion, and automatic insertion of return in front of expressions. * A REPL library you may embed in your application, to provide all of the niceties of the standalone interpreter included with Lua and then some. Many software projects have made the choice to embed Lua in their projects to allow their users some extra flexibility. Some of these projects would also like to provide a Lua REPL in their programs for debugging or rapid development. Most Lua programmers are familiar with the standalone Lua interpreter as a Lua REPL; however, it is bound to the command line. Until now, Lua programmers would have to implement their own REPL from scratch if they wanted to include one in their programs. This project aims to provide a REPL implemented in pure Lua that almost any project can make use of. This library also includes an example application (rep.lua), which serves as an alternative to the standalone interpreter included with Lua. If the lua-linenoise library is installed, it uses linenoise for history and tab completion; otherwise, it tries to use rlwrap for basic line editing. If you would like the arrow keys to work as expected rather than printing things like `^[[A`, please install the lua-linenoise library or the rlwrap program. %prep %autosetup %install rm -rf %{buildroot} luarocks --tree=%{buildroot}/usr \ make --deps-mode=none --no-manifest sed -i "s#%{buildroot}##" %{buildroot}/usr/bin/rep.lua %files %doc README.md %{_bindir}/rep.lua %{_prefix}/lib/* %{lua_pkgdir}/* %changelog * Mon Jan 31 2022 Johannes Maibaum - 0.10-1 - Update lua-repl to 0.10 * Mon Oct 18 2021 Johannes Maibaum - 0.9-1 - Initial spec file for lua-repl