%{!?_licensedir:%global license %%doc} %{!?luaver: %global luaver %(lua -e "print(string.sub(_VERSION, 5))")} %global luapkgdir %{_datadir}/lua/%{luaver} %global commit b3936576be7f792c3026be91ee91cbd1ff89cb1d %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global pkg_name argparse # Proper naming for the tarball from github. %global gittar %{name}-%{version}.tar.gz Name: lua-%{pkg_name} Version: 0.4.1 Release: 1%{?dist} Summary: Feature-rich command line parser for Lua License: MIT URL: https://github.com/mpeterv/%{pkg_name} Source0: %{url}/archive/%{commit}/%{gittar} BuildArch: noarch BuildRequires: lua-devel >= %{luaver} %if 0%{?fedora} Requires: lua(abi) = %{luaver} %else Requires: lua >= %{luaver} %endif %description Argparse is a feature-rich command line parser for Lua inspired by argparse for Python. Argparse supports positional arguments, options, flags, optional arguments, subcommands and more. Argparse automatically generates usage, help and error messages. %package doc Summary: Documentation for %{name} BuildArch: noarch BuildRequires: python3-sphinx BuildRequires: python3-sphinx_rtd_theme BuildRequires: dos2unix Requires: python3-sphinx_rtd_theme %description doc This package contains documentation for %{name}. %prep %setup -qn %{pkg_name}-%{commit} rm -rf doc %build sphinx-build-3 -b html -d build/doctree docsrc doc # Remove fonts so that we don't package them.. rm -rf doc/_static/fonts # Additional cleanup... rm -rf doc/.buildinfo dos2unix doc/_static/jquery.js %install install -m 644 -D -p src/%{pkg_name}.lua %{buildroot}%{luapkgdir}/%{pkg_name}.lua %files %license LICENSE %doc README.md %{luapkgdir}/%{pkg_name}.lua %files doc %license LICENSE %doc doc %changelog * Tue Aug 4 2015 Jeff Backus - 0.4.1-1 - Updated to latest version - Removed extraneous patch * Tue Aug 4 2015 Jeff Backus - 0.4.0-3 - Changed license handling to more readable form - Modified to rebuild sphinx documentation and remove fonts - Added patch to put license at head of argparse.lua * Mon Jul 27 2015 Jeff Backus - 0.4.0-2 - Fixed permissions on argparse.lua - Added proper handling of license for EPEL6 - Removed commented-out macros * Wed Jul 22 2015 Jeff Backus - 0.4.0-1 - Initial release