%{!?lua_version: %global lua_version %{lua: print(string.sub(_VERSION, 5))}} %{!?lua_pkgdir: %global lua_pkgdir %{_datadir}/lua/%{lua_version}} Name: lua-linenoise Version: 0.9 Release: 1%{?dist} Summary: A UTF-8 support module for Lua and LuaJIT. License: MIT URL: https://github.com/hoelzro/%{gname} Source0: https://github.com/hoelzro/%{name}/archive/refs/tags/%{version}.tar.gz BuildRequires: gcc BuildRequires: lua-devel BuildRequires: luarocks %description This module adds UTF-8 support to Lua. It uses data extracted from Unicode Character Database, and tested on Lua 5.2.3, Lua 5.3.0 and LuaJIT. It mainly used to be compatible with Lua's own string module, it passed all string and pattern matching test in lua test suite2. It also adds some useful routines against UTF-8 features, like a convenient interface to escape Unicode sequence in string; string insert/remove, since UTF-8 substring extract may expensive; calculate Unicode width, useful when implement e.g. console emulator; a useful interface to translate Unicode offset and byte offset. %prep %autosetup %install rm -rf %{buildroot} luarocks --tree=%{buildroot}/usr \ make --deps-mode=none --no-manifest CFLAGS="-fPIC %{build_cflags}" # Remove luarocks metadata rm -rf %{buildroot}/usr/lib %files %doc README.md %{_libdir}/lua/%{lua_version}/linenoise.so %changelog * Mon Oct 18 2021 Johannes Maibaum - 0.9-1 - Initial spec file for lua-linenoise