%{!?lua_version: %global lua_version %{lua: print(string.sub(_VERSION, 5))}} %{!?lua_pkgdir: %global lua_pkgdir %{_datadir}/lua/%{lua_version}} %global luapkgname cliargs Name: lua-%{luapkgname} Version: 3.0.2 Release: 1%{?dist} Summary: A command-line argument parsing module for Lua. %define luaversion %(echo "$(sed 's/\\.\\([0-9]\\)$/-\\1/' <<< %{version})") License: MIT URL: https://github.com/amireh/lua_%{luapkgname} Source0: https://github.com/amireh/lua_%{luapkgname}/archive/refs/tags/v%{luaversion}.tar.gz BuildArch: noarch BuildRequires: lua-devel BuildRequires: luarocks %description cliargs is a command-line argument parser for Lua. It supports several types of arguments: 1. required arguments 2. optional arguments with different notations: -short-key VALUE and/or --expanded-key=VALUE 3. optional arguments with multiple-values that get appended to a list 4. optional "flag" arguments (on/off options) with notations: -short-key and/or --expanded-key 5. a single optional "splat" argument which can be repeated (must be the last argument) Optional arguments can have default values (strings), flags always default to 'true'. %prep %autosetup -n lua_%{luapkgname}-%{luaversion} %install rm -rf %{buildroot} luarocks --tree=%{buildroot}/usr \ make --deps-mode=none --no-manifest # Remove luarocks metadata rm -rf %{buildroot}/usr/lib %files %doc README.md %license LICENSE %{lua_pkgdir}/* %changelog * Mon Oct 18 2021 Johannes Maibaum - 3.0.2-1 - Initial spec file for lua-cliargs