[packages/lua-filesystem] up to 1.8.0; package module for lua 5.1/5.3/5.4
atler
atler at pld-linux.org
Wed May 11 13:22:53 CEST 2022
commit 22e7d374f3cacdcff87a47890987c523c1e9307d
Author: Jan Palus <atler at pld-linux.org>
Date: Wed May 11 13:21:44 2022 +0200
up to 1.8.0; package module for lua 5.1/5.3/5.4
lua-filesystem.spec | 142 +++++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 117 insertions(+), 25 deletions(-)
---
diff --git a/lua-filesystem.spec b/lua-filesystem.spec
index d008898..dca0dfb 100644
--- a/lua-filesystem.spec
+++ b/lua-filesystem.spec
@@ -1,28 +1,28 @@
+%bcond_without lua51 # lua51 package
+%bcond_without lua53 # lua53 package
-%define luaver 5.3
-%define real_name luafilesystem
-
-%define luasuffix %(echo %{luaver} | tr -d .)
-%if "%{luaver}" == "5.1"
-%define luaincludedir %{_includedir}/lua51
-%else
-%define luaincludedir %{_includedir}/lua%{luaver}
-%endif
-%define lualibdir %{_libdir}/lua/%{luaver}
-%define luapkgdir %{_datadir}/lua/%{luaver}
+%define real_name luafilesystem
+%define tag_ver %(echo %{version} | tr . _)
Summary: File System Library for Lua
Summary(hu.UTF-8): Fájlrendszer-könyvtár Lua-hoz.
-Name: lua%{luasuffix}-filesystem
-Version: 1.7.0.2
-Release: 3
+Name: lua54-filesystem
+Version: 1.8.0
+Release: 1
License: BSD-like
Group: Development/Languages
-Source0: https://github.com/keplerproject/luafilesystem/archive/v1_7_0_2/%{real_name}-%{version}.tar.gz
-# Source0-md5: 5166c00df1599a54dc97e84852be7f0c
+Source0: https://github.com/keplerproject/luafilesystem/archive/v%{tag_ver}/%{real_name}-%{version}.tar.gz
+# Source0-md5: b012ab5292237a8d69a193d5798b2157
URL: https://keplerproject.github.io/luafilesystem/
-BuildRequires: lua%{luasuffix}-devel
-BuildRequires: sed >= 4.0
+BuildRequires: lua54-devel
+BuildRequires: rpmbuild(macros) >= 1.605
+%if %{with lua51}
+BuildRequires: lua51-devel
+%endif
+%if %{with lua53}
+BuildRequires: lua53-devel
+%endif
+Requires: lua54-libs
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
@@ -30,24 +30,103 @@ LuaFileSystem is a Lua library developed to complement the set of
functions related to file systems offered by the standard Lua
distribution.
+%description -l hu.UTF-8
+LuaFileSystem egy Lua könyvtár, amely függvények halmazát nyújtja,
+hogy a fájlrendszeren műveleteket végezhess.
+
+%package -n lua51-filesystem
+Summary: File System Library for Lua
+Summary(hu.UTF-8): Fájlrendszer-könyvtár Lua-hoz.
+Requires: lua51-libs
+
+%description -n lua51-filesystem
+LuaFileSystem is a Lua library developed to complement the set of
+functions related to file systems offered by the standard Lua
+distribution.
+
+Package for Lua 5.1.
+
+%description -l hu.UTF-8
+LuaFileSystem egy Lua könyvtár, amely függvények halmazát nyújtja,
+hogy a fájlrendszeren műveleteket végezhess.
+
+Package for Lua 5.1.
+
+%package -n lua53-filesystem
+Summary: File System Library for Lua
+Summary(hu.UTF-8): Fájlrendszer-könyvtár Lua-hoz.
+Requires: lua53-libs
+
+%description -n lua53-filesystem
+LuaFileSystem is a Lua library developed to complement the set of
+functions related to file systems offered by the standard Lua
+distribution.
+
+Package for Lua 5.3.
%description -l hu.UTF-8
LuaFileSystem egy Lua könyvtár, amely függvények halmazát nyújtja,
hogy a fájlrendszeren műveleteket végezhess.
+Package for Lua 5.3.
+
%prep
-%setup -q -n %{real_name}-1_7_0_2
-%{__sed} -i -e 's|PREFIX=.*|PREFIX=%{_prefix}|' config
+%setup -q -n %{real_name}-%{tag_ver}
+
+%{__mkdir} build-5.4
+%{?with_lua51:%{__mkdir} build-5.1}
+%{?with_lua53:%{__mkdir} build-5.3}
%build
+%{__make} clean
+%{__make} \
+ CC="%{__cc}" \
+ WARN="%{rpmcflags} %{rpmcppflags} -fPIC" \
+ LUA_VERSION=5.4 \
+ PREFIX=%{_prefix} \
+ LUA_LIBDIR=%{_libdir}/lua/5.4
+
+%{__mv} src/lfs.so build-5.4
+
+%if %{with lua51}
+%{__make} clean
%{__make} \
CC="%{__cc}" \
- CFLAGS="%{rpmcppflags} %{rpmcflags} %{rpmldflags} -I%{luaincludedir} -fPIC"
+ WARN="%{rpmcflags} %{rpmcppflags} -fPIC" \
+ LUA_VERSION=5.1 \
+ PREFIX=%{_prefix} \
+ LUA_LIBDIR=%{_libdir}/lua/5.1
+
+%{__mv} src/lfs.so build-5.1
+%endif
+
+%if %{with lua53}
+%{__make} clean
+%{__make} \
+ CC="%{__cc}" \
+ WARN="%{rpmcflags} %{rpmcppflags} -fPIC" \
+ LUA_VERSION=5.3 \
+ PREFIX=%{_prefix} \
+ LUA_LIBDIR=%{_libdir}/lua/5.3
+
+%{__mv} src/lfs.so build-5.3
+%endif
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{lualibdir}
-cp -p src/lfs.so $RPM_BUILD_ROOT%{lualibdir}
+
+install -d $RPM_BUILD_ROOT%{_libdir}/lua/5.4
+install -p build-5.4/lfs.so $RPM_BUILD_ROOT%{_libdir}/lua/5.4/lfs.so
+
+%if %{with lua51}
+install -d $RPM_BUILD_ROOT%{_libdir}/lua/5.1
+install -p build-5.1/lfs.so $RPM_BUILD_ROOT%{_libdir}/lua/5.1/lfs.so
+%endif
+
+%if %{with lua53}
+install -d $RPM_BUILD_ROOT%{_libdir}/lua/5.3
+install -p build-5.3/lfs.so $RPM_BUILD_ROOT%{_libdir}/lua/5.3/lfs.so
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
@@ -55,5 +134,18 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
%doc README.md doc/us/*
-# XXX: parent dir runtime dep?
-%attr(755,root,root) %{lualibdir}/*.so
+%attr(755,root,root) %{_libdir}/lua/5.4/lfs.so
+
+%if %{with lua51}
+%files -n lua51-filesystem
+%defattr(644,root,root,755)
+%doc README.md doc/us/*
+%attr(755,root,root) %{_libdir}/lua/5.1/lfs.so
+%endif
+
+%if %{with lua53}
+%files -n lua53-filesystem
+%defattr(644,root,root,755)
+%doc README.md doc/us/*
+%attr(755,root,root) %{_libdir}/lua/5.3/lfs.so
+%endif
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/lua-filesystem.git/commitdiff/22e7d374f3cacdcff87a47890987c523c1e9307d
More information about the pld-cvs-commit
mailing list