From 900e833515adbee0e7bbfa2623845adc46190190d0d3abb1d14329c12eb75fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= Date: Thu, 26 Feb 2026 02:19:29 +0100 Subject: [PATCH] Initial import of lua rock datafile version 0.11 --- .gitignore | 1 + _multibuild | 6 ++++ datafile-0.11.tar.gz | 3 ++ lua-datafile.changes | 4 +++ lua-datafile.spec | 75 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 89 insertions(+) create mode 100644 _multibuild create mode 100644 datafile-0.11.tar.gz create mode 100644 lua-datafile.changes create mode 100644 lua-datafile.spec diff --git a/.gitignore b/.gitignore index 5203d8c..0cdaef8 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ _build.* _service:* .pbuild +lua*-datafile-*-build/ diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..a18054e --- /dev/null +++ b/_multibuild @@ -0,0 +1,6 @@ + +luajit +lua53 +lua54 +lua55 + diff --git a/datafile-0.11.tar.gz b/datafile-0.11.tar.gz new file mode 100644 index 0000000..89f9d22 --- /dev/null +++ b/datafile-0.11.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9e7ffff06b88ea1dc5b3ef9b08b3c3e78a3b6d6a6da3c2042cf3b65375134de +size 7867 diff --git a/lua-datafile.changes b/lua-datafile.changes new file mode 100644 index 0000000..6367e22 --- /dev/null +++ b/lua-datafile.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Thu Feb 26 01:02:12 UTC 2026 - Matej Cepl + +- Initial import of lua rock datafile version 0.11 diff --git a/lua-datafile.spec b/lua-datafile.spec new file mode 100644 index 0000000..2dbbe3e --- /dev/null +++ b/lua-datafile.spec @@ -0,0 +1,75 @@ +# +# spec file for package lua-datafile +# +# Copyright (c) 2022 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define flavor @BUILD_FLAVOR@ +%define mod_name datafile +Version: 0.11 +Release: 0 +Summary: library for handling paths when loading data files +License: MIT +URL: https://github.com/hishamhm/datafile +Source: https://github.com/hishamhm/datafile/archive/refs/tags/v%{version}.tar.gz#/%{mod_name}-%{version}.tar.gz +BuildRequires: %{flavor}-devel +BuildRequires: lua-macros +Requires: %{flavor} +BuildArch: noarch +%lua_provides +%if "%{flavor}" == "" +Name: lua-%{mod_name} +ExclusiveArch: do_not_build +%else +Name: %{flavor}-%{mod_name} +%endif + +%description +A Lua library for handling paths when loading data files + +Example usage: + + local datafile = require("datafile") + + local my_template = datafile.open("myapp/my_template.txt", "r") + +This will try to find and open myapp/my_template.txt in a series of +locations, based on the "opener" plugins found at the datafile.openers +sequence, which contain opener functions loaded from the +datafile.openers.* modules (you may modify the datafile.openers sequence +in an analog fashion to the package.loaders/package.searchers sequence +from Lua). + +%prep +%autosetup -p1 -n %{mod_name}-%{version} + +%build +: + +%install +install -v -D -m 0644 -p -t %{buildroot}%{lua_noarchdir} datafile.lua +cp -r -p datafile/ %{buildroot}%{lua_noarchdir} + +%check +export LUA_PATH="%{buildroot}%{lua_noarchdir}/?.lua;test/?.lua;;" +lua%{lua_version} test/test_script.lua + +%files +%license LICENSE +%doc README.md +%{lua_noarchdir}/datafile.lua +%{lua_noarchdir}/datafile + +%changelog