Name: lua5.1-penlight Version: 1.9.2 Release: 1%{?dist} Summary: Penlight Lua Libraries for Lua 5.1 License: MIT URL: https://github.com/lunarmodules/Penlight Source0: https://github.com/lunarmodules/Penlight/archive/%{version}/Penlight-%{version}.tar.gz %global luaver 5.1 %global luapkgdir %{_datadir}/lua/%{luaver} # there's a circular (build) dependency with lua-ldoc %bcond_without docs BuildArch: noarch BuildRequires: lua >= %{luaver} BuildRequires: lua5.1-filesystem BuildRequires: lua-markdown %if %{with docs} BuildRequires: lua-ldoc %endif # with docs Requires: lua >= %{luaver} Requires: lua5.1-filesystem %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} %global __requires_exclude_from %{_docdir} %description A set of pure Lua libraries focusing on input data handling (such as reading configuration files), functional programming (such as map, reduce, placeholder expressions, etc.), and OS path management. Much of the functionality is inspired by the Python standard libraries. %if %{with docs} %package doc Summary: API docs for lua5.1-penlight Requires: %{name} = %{version}-%{release} %description doc %{summary} %endif # with docs %package examples Summary: Examples of lua5.1-penlight usage Requires: %{name} = %{version}-%{release} %description examples %{summary} %prep %setup -q -n Penlight-%{version} %build # nothing to do here %install mkdir -p %{buildroot}%{luapkgdir} cp -av lua/pl %{buildroot}%{luapkgdir} # fix scripts chmod -x %{buildroot}%{luapkgdir}/pl/dir.lua # build and install README etc. mkdir -p %{buildroot}%{_pkgdocdir} markdown.lua {README,CHANGELOG,CONTRIBUTING,LICENSE}.md cp -av {README,CHANGELOG,CONTRIBUTING}.html %{buildroot}%{_pkgdocdir} %if %{with docs} # build and install docs ldoc . cp -av docs %{buildroot}%{_pkgdocdir} %endif # with docs # install examples cp -av examples %{buildroot}%{_pkgdocdir} %check # currently disabled: missing luacov # LUA_PATH="%%{buildroot}%%{luapkgdir}/?/init.lua;%%{buildroot}%%{luapkgdir}/?.lua;;" \ # lua run.lua tests %files %dir %{_pkgdocdir} %license LICENSE.html %{_pkgdocdir}/README.html %{_pkgdocdir}/CHANGELOG.html %{_pkgdocdir}/CONTRIBUTING.html %{luapkgdir}/pl %if %{with docs} %files doc %{_pkgdocdir}/docs %endif # with docs %files examples %{_pkgdocdir}/examples %changelog * Wed Mar 10 2021 Jaden Pleasants - 1.9.2-1 - Initial package adaptation