From fb81562fcdd9fdc22aa21d0675fd889b87cb263027fa078d36a1dd245585f8e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= Date: Tue, 1 Jul 2025 09:15:47 +0200 Subject: [PATCH] Initial packaging effort for jsregexp 0.1.0. --- _multibuild | 5 +++ lua-jsregexp.changes | 4 +++ lua-jsregexp.spec | 85 ++++++++++++++++++++++++++++++++++++++++++++ v0.1.0.tar.gz | 3 ++ 4 files changed, 97 insertions(+) create mode 100644 _multibuild create mode 100644 lua-jsregexp.changes create mode 100644 lua-jsregexp.spec create mode 100644 v0.1.0.tar.gz diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..72d2b45 --- /dev/null +++ b/_multibuild @@ -0,0 +1,5 @@ + +lua51 +lua53 +lua54 + diff --git a/lua-jsregexp.changes b/lua-jsregexp.changes new file mode 100644 index 0000000..08bfc3b --- /dev/null +++ b/lua-jsregexp.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Mon Jun 30 14:42:51 UTC 2025 - Matej Cepl + +- Initial packaging effort for jsregexp 0.1.0. diff --git a/lua-jsregexp.spec b/lua-jsregexp.spec new file mode 100644 index 0000000..3f26c14 --- /dev/null +++ b/lua-jsregexp.spec @@ -0,0 +1,85 @@ +# +# spec file +# +# Copyright (c) 2023 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 jsregexp +Version: 0.1.0 +Release: 0 +Summary: JavaScript regular expressions for Lua +License: MIT +URL: https://github.com/kmarius/jsregexp +Source: https://github.com/kmarius/jsregexp/archive/refs/tags/v%{version}.tar.gz +BuildRequires: %{flavor}-devel +BuildRequires: lua-macros +Requires: %{flavor} +%lua_provides +%if "%{flavor}" == "" +Name: lua-%{mod_name} +ExclusiveArch: do_not_build +%else +Name: %{flavor}-%{mod_name} +Provides: %{flavor}-jsregexp = %{version} +Obsoletes: %{flavor}-jsregexp < %{version} +%endif + +%description +Provides ECMAScript regular expressions for Lua 5.1, 5.2, 5.3, 5.4 and LuaJit. Uses libregexp from Fabrice Bellard's QuickJS. + +%package doc +Summary: Lua Documentation for %{mod_name} +Requires: %{name} = %{version} +BuildArch: noarch + +%description doc +Documentation and examples included with the library, sometimes +generated by luadoc or ldoc. + +%prep +%setup -q -n jsregexp-%{version} + +# Set our cflags +sed -i \ + -e '/^INCLUDE_DIR =/s:-I.*$:-I %{lua_incdir}:' \ + -e 's: -O2: %{optflags}:g' \ + Makefile + +%build +make %{?_make_output_sync} + +%install + +mkdir -p %{buildroot}%{_docdir}/%{name} +mkdir -p %{buildroot}%{lua_archdir} +mkdir -p %{buildroot}%{lua_noarchdir} + +install jsregexp.so %{buildroot}%{lua_archdir} + +%check +LUA_PATH='%{_datadir}/lua/%{lua_version}/?.lua' +LUA_PATH="%{buildroot}%{lua_noarchdir}/?/init.lua;${LUA_PATH}" +export LUA_PATH="%{buildroot}%{lua_noarchdir}/?.lua;${LUA_PATH}" +%{_bindir}/lua%{lua_version} test.lua + +%files +%{lua_archdir} +%{lua_noarchdir} + +%files doc +%doc re.html jsregexp.html HISTORY + +%changelog diff --git a/v0.1.0.tar.gz b/v0.1.0.tar.gz new file mode 100644 index 0000000..1ff48e6 --- /dev/null +++ b/v0.1.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4fa5c2c96ab2945bd85dfa550905c7b7748bee5a73facdf16056167a813ee30b +size 102354