Add rpm-macros file, providing packaging macros for lua add-ons (#1447324)

This commit is contained in:
Björn Esser 2017-05-24 15:53:59 +02:00
parent b7447739b8
commit 9774218a76
2 changed files with 28 additions and 1 deletions

View File

@ -6,10 +6,13 @@
%global bootstrap_major_version 5.2
%global bootstrap_version %{bootstrap_major_version}.3
# Place rpm-macros into proper location.
%global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
Name: lua
Version: %{major_version}.4
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Powerful light-weight programming language
Group: Development/Languages
License: MIT
@ -23,6 +26,8 @@ Source2: http://www.lua.org/ftp/lua-%{bootstrap_version}.tar.gz
Source3: http://www.lua.org/tests/lua-%{version}-tests.tar.gz
# multilib
Source4: luaconf.h
# rpm-macro
Source1000: macros.lua.in
Patch0: %{name}-5.3.0-autotoolize.patch
Patch1: %{name}-5.3.0-idsize.patch
#Patch2: %%{name}-5.3.0-luac-shared-link-fix.patch
@ -168,6 +173,10 @@ rm -rf $RPM_BUILD_ROOT/installdir
popd
%endif
# Install rpm-macro
mkdir -p $RPM_BUILD_ROOT/%{macrosdir}
sed -e 's!@major_version@!%{major_version}!g' < %{SOURCE1000} > $RPM_BUILD_ROOT/%{macrosdir}/macros.lua
%files
%{!?_licensedir:%global license %%doc}
%license mit.txt
@ -196,12 +205,16 @@ popd
%{_includedir}/l*.hpp
%{_libdir}/liblua.so
%{_libdir}/pkgconfig/*.pc
%{macrosdir}/macros.lua
%files static
%{_libdir}/*.a
%changelog
* Wed May 24 2017 Björn Esser <besser82@fedoraproject.org> - 5.3.4-2
- Add rpm-macros file, providing packaging macros for lua add-ons (#1447324)
* Thu Feb 9 2017 Tom Callaway <spot@fedoraproject.org> 5.3.4-1
- update to 5.3.4

14
macros.lua.in Normal file
View File

@ -0,0 +1,14 @@
%luaver @major_version@
%luanext %(echo '%{luaver}' | %{__awk} '{ sum = $1 + 0.1; print sum }')
%lualibdir %{_libdir}/lua/%{luaver}
%luapkgdir %{_datadir}/lua/%{luaver}
%lua_requires \
%if 0%{?fedora} || 0%{?rhel} >= 7 \
Requires: lua(abi) = %{luaver} \
%else \
Requires: lua >= %{luaver} \
Requires: lua < %{luanext} \
%endif \
%{nil}