From 9774218a7692134be173e2000dc9b013672747a5 Mon Sep 17 00:00:00 2001 From: Björn Esser Date: Wed, 24 May 2017 15:53:59 +0200 Subject: Add rpm-macros file, providing packaging macros for lua add-ons (#1447324) --- lua.spec | 15 ++++++++++++++- macros.lua.in | 14 ++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 macros.lua.in diff --git a/lua.spec b/lua.spec index 43b28e5..ecb294a 100644 --- a/lua.spec +++ b/lua.spec @@ -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 - 5.3.4-2 +- Add rpm-macros file, providing packaging macros for lua add-ons (#1447324) + * Thu Feb 9 2017 Tom Callaway 5.3.4-1 - update to 5.3.4 diff --git a/macros.lua.in b/macros.lua.in new file mode 100644 index 0000000..00efba2 --- /dev/null +++ b/macros.lua.in @@ -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} -- cgit