%global lua_version 5.3 %global lua_libdir %{_libdir}/lua/%{lua_version} %global lua_pkgdir %{_datadir}/lua/%{lua_version} %global lua_compat_version 5.1 %global lua_compat_libdir %{_libdir}/lua/%{lua_compat_version} %global lua_compat_pkgdir %{_datadir}/lua/%{lua_compat_version} %global lua_compat_builddir %{_builddir}/compat-lua-%{name}-%{version}-%{release} Name: lua-lpeg Version: 1.0.1 Release: 10%{?dist} Summary: Parsing Expression Grammars for Lua License: MIT URL: http://www.inf.puc-rio.br/~roberto/lpeg/ Source0: http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-%{version}.tar.gz Patch0: lpeg-1.0.1-inject-ldflags.patch BuildRequires: gcc BuildRequires: lua-devel >= %{lua_version} %if 0%{?fedora} || 0%{?rhel} >= 7 Requires: lua(abi) = %{lua_version} %else Requires: lua >= %{lua_version} %endif %description LPeg is a new pattern-matching library for Lua, based on Parsing Expression Grammars (PEGs). %package compat Summary: Parsing Expression Grammars for Lua %{lua_compat_version} Group: Development/Libraries BuildRequires: compat-lua-devel >= %{lua_compat_version} %if 0%{?fedora} || 0%{?rhel} >= 7 Requires: lua(abi) = %{lua_compat_version} %else Requires: lua >= %{lua_compat_version} %endif %description compat LPeg is a new pattern-matching library for Lua %{lua_compat_version} %prep %autosetup -n lpeg-%{version} rm -rf %{lua_compat_builddir} cp -a . %{lua_compat_builddir} %build make %{?_smp_mflags} COPT="%{optflags}" LDFLAGS="%{build_ldflags}" pushd %{lua_compat_builddir} make %{?_smp_mflags} COPT="-I%{_includedir}/lua-%{lua_compat_version} %{optflags}" LDFLAGS="-L%{lua_compat_libdir} %{build_ldflags}" popd %install %{__rm} -rf %{buildroot} %{__mkdir_p} %{buildroot}%{lua_libdir} %{__mkdir_p} %{buildroot}%{lua_pkgdir} %{__install} -p lpeg.so %{buildroot}%{lua_libdir}/lpeg.so.%{version} %{__ln_s} lpeg.so.%{version} %{buildroot}%{lua_libdir}/lpeg.so %{__install} -p -m 0644 re.lua %{buildroot}%{lua_pkgdir} pushd %{lua_compat_builddir} %{__mkdir_p} %{buildroot}%{lua_compat_libdir} %{__mkdir_p} %{buildroot}%{lua_compat_pkgdir} %{__install} -p lpeg.so %{buildroot}%{lua_compat_libdir}/lpeg.so.%{version} %{__ln_s} lpeg.so.%{version} %{buildroot}%{lua_compat_libdir}/lpeg.so %{__install} -p -m 0644 re.lua %{buildroot}%{lua_compat_pkgdir} popd %check lua test.lua %files %doc HISTORY lpeg.html re.html lpeg-128.gif test.lua %{lua_libdir}/* %{lua_pkgdir}/* %files compat %{lua_compat_libdir}/* %{lua_compat_pkgdir}/* %changelog * Tue Apr 02 2019 Tomas Krizek - 1.0.1-10 - Rename compat-lua-lpeg to lua-lpeg-compat to conform with other lua-*-compat packages * Mon Mar 11 2019 Aron Griffis - 1.0.1-9 - Add compat 5.1 build for neovim, rhbz #1685783 * Mon Mar 11 2019 Rafael dos Santos - 1.0.1-6 - Use standard Fedora linker flags (bug #1548714) * Fri Feb 01 2019 Fedora Release Engineering - 1.0.1-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Fri Jul 13 2018 Fedora Release Engineering - 1.0.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Thu Feb 08 2018 Fedora Release Engineering - 1.0.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Thu Aug 03 2017 Fedora Release Engineering - 1.0.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild * Wed Jul 26 2017 Fedora Release Engineering - 1.0.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Fri Feb 10 2017 Fedora Release Engineering - 1.0.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Sun Jan 15 2017 Michel Alexandre Salim - 1.0.1-1 - Update to 1.0.1 * Thu Feb 04 2016 Fedora Release Engineering - 0.12.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Sun Jul 26 2015 Michel Alexandre Salim - 0.12.2-1 - Update to 0.12.2 * Wed Jun 17 2015 Fedora Release Engineering - 0.12.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Fri Jan 16 2015 Tom Callaway - 0.12.1-1 - update to 0.12.1 - rebuild for lua 5.3 * Sun Aug 17 2014 Fedora Release Engineering - 0.12-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild * Sat Jun 07 2014 Fedora Release Engineering - 0.12-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Sat Aug 03 2013 Fedora Release Engineering - 0.12-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Fri May 10 2013 Tom Callaway - 0.12-1 - update to 0.12, lua 5.2 * Wed Apr 3 2013 Michel Alexandre Salim - 0.11-1 - Update to 0.11 * Thu Feb 14 2013 Fedora Release Engineering - 0.10.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild * Thu Jul 19 2012 Fedora Release Engineering - 0.10.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Fri Jan 13 2012 Fedora Release Engineering - 0.10.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Tue Aug 16 2011 Michel Salim - 0.10.2-1 - Update to 0.10.2 * Tue Feb 08 2011 Fedora Release Engineering - 0.9-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Sat Jul 25 2009 Fedora Release Engineering - 0.9-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Wed Feb 25 2009 Fedora Release Engineering - 0.9-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Mon Dec 22 2008 Tim Niemueller - 0.9-1 - Update to 0.9 * Fri Jun 13 2008 Tim Niemueller - 0.8.1-2 - Consistent macro usage, moved sed/chmod to prep * Thu Jun 12 2008 Tim Niemueller - 0.8.1-1 - Initial package