Add lua(abi) requirements generator (requires RPM 4.16+)
Any package that installs to /usr/lib(64)/lua/X.Y/ or /usr/share/lua/X.Y/ will require lua(abi) = X.Y. Co-own the RPM directories to avoid a dependency on RPM (or not owned directory).
This commit is contained in:
parent
18ba6592c3
commit
ab3d82cbb9
19
lua.attr
Normal file
19
lua.attr
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
%__lua_requires() %{lua:
|
||||||
|
-- Match buildroot paths of the form
|
||||||
|
-- /PATH/OF/BUILDROOT/usr/lib(64)/lua/MAJOR.MINOR/ and
|
||||||
|
-- /PATH/OF/BUILDROOT/usr/share/pythonMAJOR.MINOR/
|
||||||
|
-- generating a line of the form:
|
||||||
|
-- lua(abi) = MAJOR.MINOR
|
||||||
|
local path = rpm.expand('%1')
|
||||||
|
local datadir = rpm.expand('%_datadir')
|
||||||
|
local libdir = rpm.expand('%_libdir')
|
||||||
|
for i, dir in ipairs({datadir, libdir}) do
|
||||||
|
if path:match(dir .. '/lua/%d+%.%d+/.*') then
|
||||||
|
local requires = path:gsub('.*' .. dir .. '/lua/(%d+%.%d+)/.*', 'lua(abi) = %1')
|
||||||
|
print(requires)
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
%__lua_path ^(%{_datadir}|%{_libdir})/lua/[[:digit:]]+\\.[[:digit:]]+/.+
|
13
lua.spec
13
lua.spec
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
Name: lua
|
Name: lua
|
||||||
Version: %{major_version}.0
|
Version: %{major_version}.0
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
Summary: Powerful light-weight programming language
|
Summary: Powerful light-weight programming language
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: http://www.lua.org/
|
URL: http://www.lua.org/
|
||||||
@ -30,6 +30,8 @@ Source3: http://www.lua.org/tests/lua-%{test_version}-tests.tar.gz
|
|||||||
Source4: luaconf.h
|
Source4: luaconf.h
|
||||||
# rpm-macro
|
# rpm-macro
|
||||||
Source1000: macros.lua
|
Source1000: macros.lua
|
||||||
|
# rpm-generator
|
||||||
|
Source1001: lua.attr
|
||||||
Patch0: %{name}-5.4.0-beta-autotoolize.patch
|
Patch0: %{name}-5.4.0-beta-autotoolize.patch
|
||||||
Patch1: %{name}-5.3.0-idsize.patch
|
Patch1: %{name}-5.3.0-idsize.patch
|
||||||
#Patch2: %%{name}-5.3.0-luac-shared-link-fix.patch
|
#Patch2: %%{name}-5.3.0-luac-shared-link-fix.patch
|
||||||
@ -173,8 +175,9 @@ rm -rf $RPM_BUILD_ROOT/installdir
|
|||||||
popd
|
popd
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Install rpm-macro
|
# Install rpm-macro and requires generator
|
||||||
install -Dpm 0644 %{SOURCE1000} $RPM_BUILD_ROOT/%{macrosdir}/macros.lua
|
install -Dpm 0644 %{SOURCE1000} $RPM_BUILD_ROOT/%{macrosdir}/macros.lua
|
||||||
|
install -Dpm 0644 %{SOURCE1001} $RPM_BUILD_ROOT/%{_fileattrsdir}/lua.attr
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%{!?_licensedir:%global license %%doc}
|
%{!?_licensedir:%global license %%doc}
|
||||||
@ -203,13 +206,19 @@ install -Dpm 0644 %{SOURCE1000} $RPM_BUILD_ROOT/%{macrosdir}/macros.lua
|
|||||||
%{_includedir}/l*.hpp
|
%{_includedir}/l*.hpp
|
||||||
%{_libdir}/liblua.so
|
%{_libdir}/liblua.so
|
||||||
%{_libdir}/pkgconfig/*.pc
|
%{_libdir}/pkgconfig/*.pc
|
||||||
|
%dir %{macrosdir}
|
||||||
%{macrosdir}/macros.lua
|
%{macrosdir}/macros.lua
|
||||||
|
%dir %{_fileattrsdir}
|
||||||
|
%{_fileattrsdir}/lua.attr
|
||||||
|
|
||||||
%files static
|
%files static
|
||||||
%{_libdir}/*.a
|
%{_libdir}/*.a
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Jun 30 2020 Miro Hrončok <mhroncok@redhat.com> - 5.4.0-2
|
||||||
|
- Add lua(abi) requirements generator (requires RPM 4.16+)
|
||||||
|
|
||||||
* Mon Jun 29 2020 Tom Callaway <spot@fedoraproject.org> - 5.4.0-1
|
* Mon Jun 29 2020 Tom Callaway <spot@fedoraproject.org> - 5.4.0-1
|
||||||
- update to 5.4.0
|
- update to 5.4.0
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user