SHA256
10
0
forked from pool/lua-luacheck

Accepting request 1037259 from Kernel:tools

luacheck update

OBS-URL: https://build.opensuse.org/request/show/1037259
OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/lua-luacheck?expand=0&rev=1
This commit is contained in:
2022-11-22 16:31:27 +00:00
committed by Git OBS Bridge
commit bb961e1c50
7 changed files with 187 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>

18
env.patch Normal file
View File

@@ -0,0 +1,18 @@
From db33c87a60013eea90226b71bc1454e3a63b6841 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?=
<Mailaender@users.noreply.github.com>
Date: Fri, 30 Oct 2020 18:10:51 +0100
Subject: [PATCH] Allow rpm to easily identify the interpreter.
---
bin/luacheck.lua | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/luacheck.lua b/bin/luacheck.lua
index cd52fdc..222ab1d 100755
--- a/bin/luacheck.lua
+++ b/bin/luacheck.lua
@@ -1,2 +1,2 @@
-#!/usr/bin/env lua
+#!/usr/bin/lua
require "luacheck.main"

34
lua-luacheck.changes Normal file
View File

@@ -0,0 +1,34 @@
-------------------------------------------------------------------
Mon Nov 21 20:16:55 UTC 2022 - Michal Suchanek <msuchanek@suse.com>
- Update to 1.0.0
New URL
- USe flavors to build for mutiple lua versions
- Ship documenation
-------------------------------------------------------------------
Sun Jul 11 01:53:19 UTC 2021 - Andy Shevchenko <ur4ltz@gmail.com>
- update to version 0.24.0
New URL. mpeterv RIP. :(
-------------------------------------------------------------------
Thu Feb 18 16:06:40 UTC 2021 - Callum Farmer <gmbr3@opensuse.org>
- Force lua53 instead of lua54
-------------------------------------------------------------------
Thu Nov 5 13:47:31 UTC 2020 - Matej Cepl <mcepl@suse.com>
- Add %check running luacheck against itself to have at least minimal
testing.
-------------------------------------------------------------------
Fri Oct 30 16:58:56 UTC 2020 - Matthias Mailänder <mailaender@opensuse.org>
- update to version 0.23
-------------------------------------------------------------------
Tue Jul 18 12:14:00 UTC 2017 - John Vandenberg <jayvdb@gmail.com>
- initial packaging of version 0.20.0

103
lua-luacheck.spec Normal file
View File

@@ -0,0 +1,103 @@
#
# spec file for package lua-luacheck
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2012 Togan Muftuoglu toganm@opensuse.org
#
# 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@%{nil}
%define mod_name luacheck
%define lua_value %(echo "%{flavor}" |sed -e 's:lua::')
Version: 1.0.0
Release: 0
Summary: Command-line tool for linting and static analysis of Lua code
License: MIT
Group: Development/Languages/Other
URL: https://github.com/lunarmodules/luacheck
Source: https://github.com/lunarmodules/luacheck/archive/%{version}.tar.gz#/%{mod_name}-%{version}.tar.gz
# PATCH-FIX-OPENSUSE - silence rpmlint
Patch0: env.patch
BuildRequires: %{flavor}
BuildRequires: %{flavor}-argparse
BuildRequires: %{flavor}-luafilesystem
BuildRequires: lua-macros
Requires: %{flavor}
Requires: %{flavor}-argparse
Requires: %{flavor}-luafilesystem
Requires(post): update-alternatives
Requires(postun): update-alternatives
Provides: luacheck
Obsoletes: luacheck < 1.0.0
BuildArch: noarch
%lua_provides
%if "%{flavor}" == ""
Name: lua-%{mod_name}
ExclusiveArch: do_not_build
%else
Name: %{flavor}-%{mod_name}
%endif
%description
Luacheck is a static analyzer and a linter for Lua. Luacheck detects
various issues such as usage of undefined global variables, unused variables
and values, accessing uninitialized variables, unreachable code and more.
Most aspects of checking are configurable: there are options for defining
custom project-related globals, for selecting set of standard globals
(version of Lua standard library), for filtering warnings by type and name of
related variable, etc.
The options can be used on the command line, put into a config or directly into
checked files as Lua comments.
%prep
%autosetup -n %{mod_name}-%{version} -p1
%build
%install
mkdir -p %{buildroot}%{lua_noarchdir}
mkdir -p %{buildroot}%{_bindir}
cp bin/luacheck.lua %{buildroot}%{_bindir}/luacheck-%{lua_version}
cp -r src/luacheck %{buildroot}%{lua_noarchdir}
chmod +x %{buildroot}%{_bindir}/luacheck-%{lua_version}
sed -i -e 's,%{_bindir}/lua,%{_bindir}/lua%{lua_version},' %{buildroot}%{_bindir}/luacheck-%{lua_version}
# update-alternatives
mkdir -p %{buildroot}%{_sysconfdir}/alternatives/
touch %{buildroot}%{_sysconfdir}/alternatives/luacheck
ln -sf %{_sysconfdir}/alternatives/luacheck %{buildroot}%{_bindir}/luacheck
%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} %{buildroot}%{_bindir}/luacheck-%{lua_version} src/
%post
%{_sbindir}/update-alternatives --install %{_bindir}/luacheck luacheck %{_bindir}/luacheck-%{lua_version} %{lua_value}
%postun
if [ "$1" = 0 ] ; then
%{_sbindir}/update-alternatives --remove luacheck %{_bindir}/luacheck-%{lua_version}
fi
%files
%doc README.md CHANGELOG.md docsrc/*.rst
%license LICENSE
%ghost %{_sysconfdir}/alternatives/luacheck
%{_bindir}/luacheck
%{_bindir}/luacheck-%{lua_version}
%{lua_noarchdir}/luacheck/
%changelog

BIN
luacheck-1.0.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.