%{!?luaver: %global luaver %(lua -e "print(string.sub(_VERSION, 5))" || echo 0)} %global luapkgdir %{_datadir}/lua/%{luaver} %global luacompatver 5.1 %global luacompatpkgdir %{_datadir}/lua/%{luacompatver} Name: lua-lpeg-patterns Version: 0.5 Release: 1%{?dist} Summary: A collection of LPEG patterns License: MIT URL: https://github.com/daurnimator/lpeg_patterns Source0: https://github.com/daurnimator/lpeg_patterns/archive/v%{version}.tar.gz BuildArch: noarch BuildRequires: lua %description A collection of LPEG patterns for validating/searching user input. %if 0%{?fedora} || 0%{?rhel} > 7 %package -n compat-%{name} Summary: A collection of LPEG patterns %description -n compat-%{name} A collection of LPEG patterns for validating/searching user input. %endif %prep %setup -q -n lpeg_patterns-%{version} %install mkdir -p %{buildroot}%{luapkgdir}/lpeg_patterns install -Dm644 lpeg_patterns/* -t %{buildroot}%{luapkgdir}/lpeg_patterns/ %if 0%{?fedora} || 0%{?rhel} > 7 install -Dm644 lpeg_patterns/* -t %{buildroot}%{luacompatpkgdir}/lpeg_patterns/ %endif %files %doc README.md %license LICENSE.md %{luapkgdir}/* %if 0%{?fedora} || 0%{?rhel} > 7 %files -n compat-%{name} %doc README.md %license LICENSE.md %{luacompatpkgdir}/* %endif %changelog * Mon Apr 08 2019 Tomas Krizek - 0.5-1 - Initial package for Fedora 28+ and EPEL 7+