2020-04-01 20:59:26 +00:00
|
|
|
#
|
2022-11-23 13:15:15 +00:00
|
|
|
# spec file for package lua-penlight
|
2020-04-01 20:59:26 +00:00
|
|
|
#
|
2024-06-14 14:29:09 +00:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2020-04-01 20:59:26 +00:00
|
|
|
# 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/
|
|
|
|
#
|
|
|
|
|
2022-08-22 11:05:40 +00:00
|
|
|
|
2021-09-12 15:22:21 +00:00
|
|
|
%define flavor @BUILD_FLAVOR@%{nil}
|
2020-04-02 13:25:12 +00:00
|
|
|
%define mod_name penlight
|
2021-09-12 15:22:21 +00:00
|
|
|
%define rname Penlight
|
|
|
|
%ifluadefault
|
|
|
|
%define with_main 1
|
|
|
|
%endif
|
2024-06-14 14:29:09 +00:00
|
|
|
Version: 1.14.0
|
2020-04-01 20:59:26 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: Generally useful modules inspired by the Python standard libraries
|
|
|
|
License: MIT
|
|
|
|
Group: Development/Languages/Other
|
2021-09-12 15:22:21 +00:00
|
|
|
URL: https://lunarmodules.github.io/Penlight/
|
|
|
|
Source0: https://github.com/lunarmodules/Penlight/archive/%{version}/%{rname}-%{version}.tar.gz
|
2020-04-01 20:59:26 +00:00
|
|
|
BuildRequires: %{flavor}-devel
|
2020-07-06 19:07:53 +00:00
|
|
|
BuildRequires: %{flavor}-ldoc
|
2020-04-01 20:59:26 +00:00
|
|
|
BuildRequires: %{flavor}-luafilesystem
|
|
|
|
BuildRequires: %{flavor}-markdown
|
2022-11-23 13:15:15 +00:00
|
|
|
BuildRequires: lua-macros
|
2020-04-01 20:59:26 +00:00
|
|
|
Requires: %{flavor}
|
2020-04-01 21:11:16 +00:00
|
|
|
Requires: %{flavor}-luafilesystem
|
2021-09-12 15:22:21 +00:00
|
|
|
Recommends: lua-%{mod_name}-doc
|
2022-11-23 13:15:15 +00:00
|
|
|
BuildArch: noarch
|
2021-02-18 17:45:49 +00:00
|
|
|
%lua_provides
|
2022-11-23 13:15:15 +00:00
|
|
|
%if "%{flavor}" == ""
|
|
|
|
Name: lua-%{mod_name}
|
|
|
|
ExclusiveArch: do_not_build
|
|
|
|
%else
|
|
|
|
Name: %{flavor}-%{mod_name}
|
|
|
|
%endif
|
2020-04-01 20:59:26 +00:00
|
|
|
|
|
|
|
%description
|
|
|
|
A set of pure Lua libraries focusing on input data handling (such as
|
|
|
|
reading configuration files), functional programming (such as map,
|
|
|
|
reduce, placeholder expressions,etc), and OS path management. Much of
|
|
|
|
the functionality is inspired by the Python standard libraries.
|
|
|
|
|
2021-09-12 15:22:21 +00:00
|
|
|
%if 0%{?with_main}
|
|
|
|
%package -n lua-%{mod_name}-doc
|
|
|
|
Summary: Documentation for lua-%{mod_name}
|
2020-07-06 19:07:53 +00:00
|
|
|
Group: Development/Languages/Other
|
2020-04-01 20:59:26 +00:00
|
|
|
|
2021-09-12 15:22:21 +00:00
|
|
|
%description -n lua-%{mod_name}-doc
|
|
|
|
Documentation for the package lua-%{mod_name}
|
2020-04-01 20:59:26 +00:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%prep
|
2021-09-12 15:22:21 +00:00
|
|
|
%autosetup -n %{rname}-%{version} -p1
|
2020-04-01 20:59:26 +00:00
|
|
|
|
|
|
|
%build
|
|
|
|
|
|
|
|
%install
|
|
|
|
mkdir -p %{buildroot}%{lua_noarchdir}
|
|
|
|
cp -av lua/pl %{buildroot}%{lua_noarchdir}
|
|
|
|
|
|
|
|
# fix scripts
|
|
|
|
chmod -x %{buildroot}%{lua_noarchdir}/pl/dir.lua
|
|
|
|
|
|
|
|
# build and install README etc.
|
|
|
|
lua%{lua_version} %{lua_noarchdir}/markdown.lua *.md
|
|
|
|
|
|
|
|
%check
|
|
|
|
LUA_PATH="%{buildroot}%{lua_noarchdir}/?/init.lua;%{buildroot}%{lua_noarchdir}/?.lua;;" \
|
2020-04-01 21:04:24 +00:00
|
|
|
lua%{lua_version} run.lua tests
|
2020-04-01 20:59:26 +00:00
|
|
|
|
|
|
|
%files
|
|
|
|
%license LICENSE.md
|
|
|
|
%doc README.md *.html
|
|
|
|
%{lua_noarchdir}/pl
|
|
|
|
# Add bash/zsh-completion files
|
|
|
|
# from completions/bash/penlight.bash penlight
|
|
|
|
|
2021-09-12 15:22:21 +00:00
|
|
|
%if 0%{?with_main}
|
|
|
|
%files -n lua-%{mod_name}-doc
|
2020-04-01 20:59:26 +00:00
|
|
|
%doc docs
|
2021-09-12 15:22:21 +00:00
|
|
|
%endif
|
2020-04-01 20:59:26 +00:00
|
|
|
|
|
|
|
%changelog
|