| |
@@ -1,45 +1,76 @@
|
| |
+ %global lua_version 5.3
|
| |
+ %global lua_libdir %{_libdir}/lua/%{lua_version}
|
| |
+ %global lua_pkgdir %{_datadir}/lua/%{lua_version}
|
| |
|
| |
- %{!?luaver: %global luaver %(test -x /usr/bin/lua && lua -e "print(string.sub(_VERSION, 5))" || echo 5.3)}
|
| |
- %global lualibdir %{_libdir}/lua/%{luaver}
|
| |
- %global luapkgdir %{_datadir}/lua/%{luaver}
|
| |
+ %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: 8%{?dist}
|
| |
+ Release: 9%{?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
|
| |
- %if 0%{?el5}
|
| |
- %endif
|
| |
Patch0: lpeg-1.0.1-inject-ldflags.patch
|
| |
|
| |
BuildRequires: gcc
|
| |
- BuildRequires: lua-devel
|
| |
+ BuildRequires: lua-devel >= %{lua_version}
|
| |
%if 0%{?fedora} || 0%{?rhel} >= 7
|
| |
- Requires: lua(abi) = %{luaver}
|
| |
+ Requires: lua(abi) = %{lua_version}
|
| |
%else
|
| |
- Requires: lua >= %{luaver}
|
| |
+ Requires: lua >= %{lua_version}
|
| |
%endif
|
| |
|
| |
%description
|
| |
LPeg is a new pattern-matching library for Lua, based on Parsing Expression
|
| |
Grammars (PEGs).
|
| |
|
| |
+ %package -n compat-%{name}
|
| |
+ 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 -n compat-%{name}
|
| |
+ 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}%{lualibdir}
|
| |
- %{__mkdir_p} %{buildroot}%{luapkgdir}
|
| |
- %{__install} -p lpeg.so %{buildroot}%{lualibdir}/lpeg.so.%{version}
|
| |
- %{__ln_s} lpeg.so.%{version} %{buildroot}%{lualibdir}/lpeg.so
|
| |
- %{__install} -p -m 0644 re.lua %{buildroot}%{luapkgdir}
|
| |
+
|
| |
+ %{__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
|
| |
@@ -47,11 +78,18 @@
|
| |
|
| |
%files
|
| |
%doc HISTORY lpeg.html re.html lpeg-128.gif test.lua
|
| |
- %{lualibdir}/*
|
| |
- %{luapkgdir}/*
|
| |
+ %{lua_libdir}/*
|
| |
+ %{lua_pkgdir}/*
|
| |
+
|
| |
+ %files -n compat-%{name}
|
| |
+ %{lua_compat_libdir}/*
|
| |
+ %{lua_compat_pkgdir}/*
|
| |
|
| |
|
| |
%changelog
|
| |
+ * Mon Mar 11 2019 Aron Griffis <aron@scampersand.com> - 1.0.1-9
|
| |
+ - Add compat 5.1 build for neovim, rhbz #1685783
|
| |
+
|
| |
* Mon Mar 11 2019 Rafael dos Santos <rdossant@redhat.com> - 1.0.1-6
|
| |
- Use standard Fedora linker flags (bug #1548714)
|
| |
|
| |
This adds the 5.1 compat package for neovim with luajit. See conversation at https://bugzilla.redhat.com/show_bug.cgi?id=1685781