Пакет lua5.1-module-lpeg: Specfile

%define target_lua_version 5.1

# Original package name LPeg
%define oname lpeg
%define oversion 1.0.2-1
%define rockspec lpeg-1.0.2-1.rockspec
Name: lua%target_lua_version-module-%oname
Version: 1.0.2
Release: alt1_lr1
Summary: Parsing Expression Grammars For Lua
License: MIT/X11
Group: Development/Other
Url: http://www.inf.puc-rio.br/~roberto/lpeg.html
Provides: luarocks%target_lua_version(%oname) = %EVR

%if "%target_lua_version" == "5.3"
Obsoletes: lua-%oname < %EVR
Provides: lua-%oname = %version
%else
Obsoletes: lua5-%oname < %EVR
Provides: lua5-%oname = %version
%endif

Source: http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.0.2.tar.gz
Source1: https://luarocks.org/manifests/luarocks/lpeg-1.0.2-1.rockspec

BuildPreReq: rpm-macros-lua >= 1.4
# Automatically added by buildreq on ...
BuildRequires: liblua%target_lua_version-devel lua%target_lua_version-luarocks

%description
      LPeg is a new pattern-matching library for Lua, based on Parsing
      Expression Grammars (PEGs). The nice thing about PEGs is that it
      has a formal basis (instead of being an ad-hoc set of features),
      allows an efficient and simple implementation, and does most things
      we expect from a pattern-matching library (and more, as we can
      define entire grammars).

%prep
%setup -n %oname-%version

%install
%luarocks_make %SOURCE1

%check
%lua_path_add_buildroot
%lua test.lua

%files
%lua_modulesdir/*
%lua_modulesdir_noarch/*
%luarocks_dbdir/%oname
%doc HISTORY *.html *.gif test.lua
%exclude %luarocks_dbdir/manifest

%changelog
* Fri Jun 07 2019 Ildar Mulyukov <ildar@altlinux.ru> 1.0.2-alt1_lr1
- autogenerated by lrimport
- restuctured according to https://www.altlinux.org/Lua_Policy

* Mon Oct 22 2018 Vladimir D. Seleznev <vseleznv@altlinux.org> 1.0.1-alt3
- really fixed ftbfs

* Thu Oct 18 2018 Vladimir D. Seleznev <vseleznv@altlinux.org> 1.0.1-alt2
- fixed ftbfs: changed BR lua-devel to liblua5.3-devel

* Thu Jun 14 2018 Yuri N. Sedunov <aris@altlinux.org> 1.0.1-alt1
- 1.0.1 (ALT #35032)

* Wed Oct 05 2016 Vladimir D. Seleznev <vseleznv@altlinux.org> 0.12.2-alt1_2
- converted for ALT Linux by srpmconvert tools

* Fri Jan 07 2011 Ildar Mulyukov <ildar@altlinux.ru> 0.10-alt1_lr1
- autogenerated by lrimport