2020-08-24 10:33:01 +08:00
|
|
|
%{?nodejs_find_provides_and_requires}
|
|
|
|
|
%global packagename levn
|
|
|
|
|
%global bootstrap 1
|
|
|
|
|
%global enable_tests 0
|
|
|
|
|
Name: nodejs-levn
|
2023-11-09 06:56:18 +00:00
|
|
|
Version: 0.3.0
|
|
|
|
|
Release: 2
|
2020-08-24 10:33:01 +08:00
|
|
|
Summary: Light ECMAScript Value Notation - human written, concise, typed
|
|
|
|
|
License: MIT
|
|
|
|
|
URL: https://github.com/gkz/levn
|
2020-09-08 16:23:02 +08:00
|
|
|
Source0: https://github.com/gkz/levn/archive/%{version}.tar.gz
|
2023-11-09 06:56:18 +00:00
|
|
|
Source1: https://raw.githubusercontent.com/gkz/levn/%{version}/package.json.ls
|
2020-08-24 10:33:01 +08:00
|
|
|
BuildArch: noarch
|
|
|
|
|
ExclusiveArch: %{nodejs_arches} noarch
|
|
|
|
|
BuildRequires: nodejs-packaging npm(prelude-ls) npm(type-check)
|
|
|
|
|
%if 0%{?enable_tests}
|
|
|
|
|
BuildRequires: mocha
|
|
|
|
|
%endif
|
|
|
|
|
%if !0%{?bootstrap}
|
|
|
|
|
BuildRequires: npm(LiveScript)
|
|
|
|
|
%endif
|
|
|
|
|
%description
|
|
|
|
|
Light ECMAScript (JavaScript) Value Notation - human written, concise, typed,
|
|
|
|
|
flexible
|
|
|
|
|
|
|
|
|
|
%prep
|
2023-11-09 06:56:18 +00:00
|
|
|
%autosetup -n levn-%{version}
|
|
|
|
|
cp -p %{SOURCE1} .
|
2022-07-05 19:41:30 +08:00
|
|
|
%nodejs_fixdep prelude-ls '~1.2.0'
|
2020-08-24 10:33:01 +08:00
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
%if !0%{?bootstrap}
|
|
|
|
|
%{_bindir}/echo -e "\e[102m -=#=- Building from source -=#=- \e[0m"
|
|
|
|
|
rm -rf ./lib/
|
|
|
|
|
mkdir ./lib/
|
|
|
|
|
%{_bindir}/lsc --compile package.json.ls
|
|
|
|
|
%{_bindir}/lsc --output lib --bare --compile src/*.ls
|
|
|
|
|
rm -rf ./node_modules/
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
mkdir -p %{buildroot}%{nodejs_sitelib}/levn
|
|
|
|
|
cp -pr package.json lib/ \
|
|
|
|
|
%{buildroot}%{nodejs_sitelib}/levn
|
|
|
|
|
%nodejs_symlink_deps
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
%nodejs_symlink_deps --check
|
|
|
|
|
%{__nodejs} -e 'require("./")'
|
|
|
|
|
%if 0%{?enable_tests}
|
|
|
|
|
%{_bindir}/mocha -R dot --ui tdd --compilers ls:livescript
|
|
|
|
|
%else
|
|
|
|
|
%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
%{!?_licensedir:%global license %doc}
|
|
|
|
|
%doc *.md
|
|
|
|
|
%license LICENSE
|
|
|
|
|
%{nodejs_sitelib}/levn
|
|
|
|
|
|
|
|
|
|
%changelog
|
2022-07-05 19:41:30 +08:00
|
|
|
* Tue Jul 05 2022 xu_ping <xuping33@h-partners.com> - 0.3.0-2
|
|
|
|
|
- Modify prelude-ls version to 1.2.0 to compat latest nodejs-prelude-ls
|
|
|
|
|
|
2020-08-24 10:33:01 +08:00
|
|
|
* Thu Aug 20 2020 yaokai <yaokai13@huawei.com> - 0.3.0-1
|
|
|
|
|
- Package init
|