2020-08-20 17:42:13 +08:00
|
|
|
%{?nodejs_find_provides_and_requires}
|
|
|
|
|
%global packagename optionator
|
|
|
|
|
%global bootstrap 1
|
|
|
|
|
%global enable_tests 0
|
|
|
|
|
Name: nodejs-optionator
|
|
|
|
|
Version: 0.8.1
|
2022-07-05 19:45:28 +08:00
|
|
|
Release: 2
|
2020-08-20 17:42:13 +08:00
|
|
|
Summary: Option parsing and help generation
|
|
|
|
|
License: MIT
|
|
|
|
|
URL: https://github.com/gkz/optionator.git
|
|
|
|
|
Source0: https://registry.npmjs.org/optionator/-/optionator-%{version}.tgz
|
|
|
|
|
Source1: tests-%{version}.tar.bz2
|
|
|
|
|
Source2: src-%{version}.tar.bz2
|
|
|
|
|
Source10: dl-tests.sh
|
|
|
|
|
Source11: https://raw.githubusercontent.com/gkz/optionator/%{version}/package.json.ls
|
|
|
|
|
BuildArch: noarch
|
2020-08-21 17:36:42 +08:00
|
|
|
ExclusiveArch: %{nodejs_arches} noarch
|
|
|
|
|
BuildRequires: nodejs-packaging npm(deep-is) npm(fast-levenshtein) npm(levn)
|
|
|
|
|
BuildRequires: npm(prelude-ls) npm(type-check) npm(wordwrap)
|
2020-08-20 17:42:13 +08:00
|
|
|
%if 0%{?enable_tests}
|
2020-08-21 17:36:42 +08:00
|
|
|
BuildRequires: mocha
|
2020-08-20 17:42:13 +08:00
|
|
|
%endif
|
|
|
|
|
%if !0%{?bootstrap}
|
2020-08-21 17:36:42 +08:00
|
|
|
BuildRequires: npm(LiveScript)
|
2020-08-20 17:42:13 +08:00
|
|
|
%endif
|
|
|
|
|
%description
|
|
|
|
|
Option parsing and help generation
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%setup -q -n package
|
|
|
|
|
%setup -q -T -D -a 1 -n package
|
|
|
|
|
%setup -q -T -D -a 2 -n package
|
|
|
|
|
cp -p %{SOURCE11} .
|
2022-07-05 19:45:28 +08:00
|
|
|
%nodejs_fixdep prelude-ls '~1.2'
|
2020-08-20 17:42:13 +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}/%{packagename}
|
|
|
|
|
cp -pr package.json lib/ \
|
|
|
|
|
%{buildroot}%{nodejs_sitelib}/%{packagename}
|
|
|
|
|
%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}/%{packagename}
|
|
|
|
|
|
|
|
|
|
%changelog
|
2022-07-05 19:45:28 +08:00
|
|
|
* Tue July 05 2022 xu_ping <xuping33@h-partners.com> - 0.8.1-2
|
|
|
|
|
- Modify prelude-ls version to 1.2 to compat latest nodejs-prelude-ls
|
|
|
|
|
|
2020-08-20 17:42:13 +08:00
|
|
|
* Thu Aug 20 2020 wangchong <wangchong56@huawei.com> - 0.8.1-1
|
|
|
|
|
- package init
|