Refactor macros into lua-rpm-macros
Signed-off-by: Michel Alexandre Salim <salimma@fedoraproject.org>
This commit is contained in:
parent
c4db958ec0
commit
a043d07614
19
lua.attr
19
lua.attr
|
@ -1,19 +0,0 @@
|
||||||
%__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:]]+/.+
|
|
20
lua.spec
20
lua.spec
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
Name: lua
|
Name: lua
|
||||||
Version: %{major_version}.0
|
Version: %{major_version}.0
|
||||||
Release: 6%{?dist}
|
Release: 7%{?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/
|
||||||
|
@ -28,10 +28,6 @@ Source2: http://www.lua.org/ftp/lua-%{bootstrap_version}.tar.gz
|
||||||
Source3: http://www.lua.org/tests/lua-%{test_version}-tests.tar.gz
|
Source3: http://www.lua.org/tests/lua-%{test_version}-tests.tar.gz
|
||||||
# multilib
|
# multilib
|
||||||
Source4: luaconf.h
|
Source4: luaconf.h
|
||||||
# rpm-macro
|
|
||||||
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
|
||||||
|
@ -76,6 +72,9 @@ configuration, scripting, and rapid prototyping.
|
||||||
%package devel
|
%package devel
|
||||||
Summary: Development files for %{name}
|
Summary: Development files for %{name}
|
||||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||||
|
# The RPM related dependencies bring nothing to a non-RPM Lua developer
|
||||||
|
# But we want them when packages BuildRequire lua-devel
|
||||||
|
Requires: (lua-rpm-macros if rpm-build)
|
||||||
Requires: pkgconfig
|
Requires: pkgconfig
|
||||||
|
|
||||||
%description devel
|
%description devel
|
||||||
|
@ -206,10 +205,6 @@ rm -rf $RPM_BUILD_ROOT/installdir
|
||||||
popd
|
popd
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Install rpm-macro and requires generator
|
|
||||||
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}
|
||||||
%license mit.txt
|
%license mit.txt
|
||||||
|
@ -237,15 +232,14 @@ install -Dpm 0644 %{SOURCE1001} $RPM_BUILD_ROOT/%{_fileattrsdir}/lua.attr
|
||||||
%{_includedir}/l*.hpp
|
%{_includedir}/l*.hpp
|
||||||
%{_libdir}/liblua.so
|
%{_libdir}/liblua.so
|
||||||
%{_libdir}/pkgconfig/*.pc
|
%{_libdir}/pkgconfig/*.pc
|
||||||
%dir %{macrosdir}
|
|
||||||
%{macrosdir}/macros.lua
|
|
||||||
%dir %{_fileattrsdir}
|
|
||||||
%{_fileattrsdir}/lua.attr
|
|
||||||
|
|
||||||
%files static
|
%files static
|
||||||
%{_libdir}/*.a
|
%{_libdir}/*.a
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Aug 31 2020 Michel Alexandre Salim <salimma@fedoraproject.org> - 5.4.0-7
|
||||||
|
- Refactor macros into lua-rpm-macros
|
||||||
|
|
||||||
* Wed Aug 19 2020 Tom Callaway <spot@fedoraproject.org> - 5.4.0-6
|
* Wed Aug 19 2020 Tom Callaway <spot@fedoraproject.org> - 5.4.0-6
|
||||||
- apply upstream fix for CVE-2020-24370, CVE-2020-24371
|
- apply upstream fix for CVE-2020-24370, CVE-2020-24371
|
||||||
|
|
||||||
|
|
13
macros.lua
13
macros.lua
|
@ -1,13 +0,0 @@
|
||||||
%lua_version %{lua: print(string.sub(_VERSION, 5))}
|
|
||||||
|
|
||||||
%lua_libdir %{_libdir}/lua/%{lua_version}
|
|
||||||
%lua_pkgdir %{_datadir}/lua/%{lua_version}
|
|
||||||
|
|
||||||
%lua_requires \
|
|
||||||
%if 0%{?fedora} >= 16 || 0%{?rhel} >= 7 \
|
|
||||||
Requires: lua(abi) = %{lua_version} \
|
|
||||||
%else \
|
|
||||||
Requires: lua >= %{lua_version} \
|
|
||||||
Requires: lua < %{lua: os.setlocale('C'); print(string.sub(_VERSION, 5) + 0.1)} \
|
|
||||||
%endif \
|
|
||||||
%{nil}
|
|
Loading…
Reference in New Issue