summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Esser <besser82@fedoraproject.org>2017-05-28 10:42:58 +0200
committerBjörn Esser <besser82@fedoraproject.org>2017-05-28 10:48:02 +0200
commit62bbfe64a188137b313d3b840375a993c565d1eb (patch)
tree3588d8ae33bd992c43c27069920060d2e5c21549
parent9774218a7692134be173e2000dc9b013672747a5 (diff)
downloadlua-62bbfe64a188137b313d3b840375a993c565d1eb.tar.gz
lua-62bbfe64a188137b313d3b840375a993c565d1eb.tar.xz
lua-62bbfe64a188137b313d3b840375a993c565d1eb.zip
Refactor macros to a more common syntax
Use rpm's build-in lua for macros
-rw-r--r--lua.spec11
-rw-r--r--macros.lua13
-rw-r--r--macros.lua.in14
3 files changed, 20 insertions, 18 deletions
diff --git a/lua.spec b/lua.spec
index ecb294a..999e875 100644
--- a/lua.spec
+++ b/lua.spec
@@ -12,7 +12,7 @@
Name: lua
Version: %{major_version}.4
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Powerful light-weight programming language
Group: Development/Languages
License: MIT
@@ -27,7 +27,7 @@ Source3: http://www.lua.org/tests/lua-%{version}-tests.tar.gz
# multilib
Source4: luaconf.h
# rpm-macro
-Source1000: macros.lua.in
+Source1000: macros.lua
Patch0: %{name}-5.3.0-autotoolize.patch
Patch1: %{name}-5.3.0-idsize.patch
#Patch2: %%{name}-5.3.0-luac-shared-link-fix.patch
@@ -174,8 +174,7 @@ 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
+install -Dpm 0644 %{SOURCE1000} $RPM_BUILD_ROOT/%{macrosdir}/macros.lua
%files
%{!?_licensedir:%global license %%doc}
@@ -212,6 +211,10 @@ sed -e 's!@major_version@!%{major_version}!g' < %{SOURCE1000} > $RPM_BUILD_ROOT/
%changelog
+* Sun May 28 2017 Björn Esser <besser82@fedoraproject.org> - 5.3.4-3
+- Refactor macros to a more common syntax
+- Use rpm's build-in lua for macros
+
* 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)
diff --git a/macros.lua b/macros.lua
new file mode 100644
index 0000000..46656d6
--- /dev/null
+++ b/macros.lua
@@ -0,0 +1,13 @@
+%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}
diff --git a/macros.lua.in b/macros.lua.in
deleted file mode 100644
index 00efba2..0000000
--- a/macros.lua.in
+++ /dev/null
@@ -1,14 +0,0 @@
-%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}