SHA256
10
0
forked from pool/lua-luarepl

Accepting request 1001323 from home:Pi-Cla

I won't have as much time to monitor openSUSE OBS so I am sending out the last few new Lua packages in advance.

OBS-URL: https://build.opensuse.org/request/show/1001323
OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/lua-luarepl?expand=0&rev=1
This commit is contained in:
2022-09-11 11:19:00 +00:00
committed by Git OBS Bridge
commit bf8af5847b
7 changed files with 161 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

5
_multibuild Normal file
View File

@@ -0,0 +1,5 @@
<multibuild>
<package>lua51</package>
<package>lua53</package>
<package>lua54</package>
</multibuild>

17
_service Normal file
View File

@@ -0,0 +1,17 @@
<services>
<service mode="manual" name="obs_scm">
<param name="url">https://github.com/hoelzro/lua-repl</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="scm">git</param>
<param name="revision">d67da674dac07597eb914d471237414b1c662a65</param>
<param name="versionrewrite-pattern">(\d+.\d+)</param>
<param name="versionrewrite-replacement">\1</param>
</service>
<service mode="manual" name="tar" />
<service mode="manual" name="recompress">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service mode="manual" name="set_version"/>
</services>

4
lua-luarepl.changes Normal file
View File

@@ -0,0 +1,4 @@
-------------------------------------------------------------------
Thu Aug 25 04:26:47 UTC 2022 - Gordon Leung <pirateclip@protonmail.com>
- initial commit

108
lua-luarepl.spec Normal file
View File

@@ -0,0 +1,108 @@
#
# spec file
#
# 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/
#
%bcond_without test
%define flavor @BUILD_FLAVOR@
%define mod_name luarepl
%define lua_value %(echo "%{flavor}" |sed -e 's:lua::')
%define rock_version 0.10-1
Version: 0.10
Release: 0
Summary: A Lua REPL implemented in Lua for embedding in other programs
License: MIT
Group: Development/Languages/Other
URL: https://github.com/hoelzro/lua-repl
Source: lua-repl-%{version}.tar.xz
BuildRequires: %{flavor}-luarocks
BuildRequires: %{flavor}-devel
%if %{with test}
BuildRequires: perl
BuildRequires: %{flavor}-testmore
%endif
Requires: %{flavor}
Requires: bash-sh
# https://github.com/hoelzro/lua-repl#recommended-packages
Recommends: %{flavor}-linenoise
# Enable filename_completion plugin
Suggests: %{flavor}-filesystem
%lua_provides
%if "%{flavor}" == ""
Name: lua-%{mod_name}
ExclusiveArch: do_not_build
%else
Name: %{flavor}-%{mod_name}
%endif
BuildArch: noarch
Requires(post): update-alternatives
Requires(postun):update-alternatives
%description
This project has two uses:
- An alternative to the standalone interpreter included with Lua, one that
supports things like plugins, tab completion, and automatic insertion of
return in front of expressions.
- A REPL library you may embed in your application, to provide all of the
niceties of the standalone interpreter included with Lua and then some.
%prep
%autosetup -n lua-repl-%{version}
# Fix the Lua shebang of rep.lua script
sed -i -r '1s/env (lua)/\1%{lua_version}/' rep.lua
%build
%luarocks_build "%{mod_name}-%{rock_version}.rockspec"
%install
%luarocks_install *.rock
# Version the rep.lua file
sed -i -r -e "s#%{buildroot}##" -e "s#(/bin/rep.lua)#\1-%{lua_version}#" \
"%{buildroot}/usr/bin/rep.lua"
mv %{buildroot}%{_bindir}/rep.lua{,-%{lua_version}}
# update-alternatives
mkdir -p %{buildroot}%{_sysconfdir}/alternatives/
touch %{buildroot}%{_sysconfdir}/alternatives/rep.lua
ln -sf %{_sysconfdir}/alternatives/rep.lua %{buildroot}%{_bindir}/rep.lua
mkdir -p %{buildroot}%{luarocks_treedir}/%{mod_name}/%{rock_version}/bin
touch %{buildroot}%{luarocks_treedir}/%{mod_name}/%{rock_version}/bin/rep.lua-%{lua_version}
ln -sf %{luarocks_treedir}/%{mod_name}/%{rock_version}/bin/rep.lua \
%{buildroot}%{luarocks_treedir}/%{mod_name}/%{rock_version}/bin/rep.lua-%{lua_version}
%post
%{_sbindir}/update-alternatives --install %{_bindir}/rep.lua rep.lua %{_bindir}/rep.lua-%{lua_version} %{lua_value}
%postun
if [ "$1" = 0 ] ; then
%{_sbindir}/update-alternatives --remove rep.lua %{_bindir}/rep.lua-%{lua_version}
fi
%if %{with test}
%check
make test
%endif
%files
%license %{luarocks_treedir}/%{mod_name}/%{rock_version}/doc/COPYING
%docdir %{luarocks_treedir}/%{mod_name}/%{rock_version}/doc
%{lua_noarchdir}
%{luarocks_treedir}/%{mod_name}
%ghost %{_sysconfdir}/alternatives/rep.lua
%{_bindir}/rep.lua
%{_bindir}/rep.lua-%{lua_version}
%changelog

3
lua-repl-0.10.tar.xz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5a6814340fd7ad4b9310206ba2ab4ed1d668c8ca721f906ac707c77104a76ad6
size 20624