71 lines
1.9 KiB
RPMSpec
71 lines
1.9 KiB
RPMSpec
|
|
%{?nodejs_find_provides_and_requires}
|
||
|
|
%global packagename prelude-ls
|
||
|
|
%global bootstrap 1
|
||
|
|
%global enable_tests 0
|
||
|
|
Name: nodejs-prelude-ls
|
||
|
|
Version: 1.1.2
|
||
|
|
Release: 1
|
||
|
|
Summary: The prelude.ls library is a functionally oriented utility
|
||
|
|
License: MIT
|
||
|
|
URL: https://github.com/gkz/prelude-ls.git
|
||
|
|
Source0: https://registry.npmjs.org/prelude-ls/-/prelude-ls-%{version}.tgz
|
||
|
|
Source1: tests-%{version}.tar.bz2
|
||
|
|
Source2: src-%{version}.tar.bz2
|
||
|
|
Source10: dl-tests.sh
|
||
|
|
Source11: https://raw.githubusercontent.com/gkz/prelude-ls/%{version}/package.json.ls
|
||
|
|
BuildArch: noarch
|
||
|
|
ExclusiveArch: %{nodejs_arches} noarch
|
||
|
|
BuildRequires: nodejs-packaging
|
||
|
|
%if 0%{?enable_tests}
|
||
|
|
BuildRequires: mocha npm(sinon)
|
||
|
|
%endif
|
||
|
|
%if !0%{?bootstrap}
|
||
|
|
BuildRequires: npm(LiveScript)
|
||
|
|
%endif
|
||
|
|
%description
|
||
|
|
prelude.ls is a functionally oriented utility library. It is powerful and
|
||
|
|
flexible. Almost all of its functions are curried. It is written in, and is
|
||
|
|
the recommended base library for, LiveScript.
|
||
|
|
|
||
|
|
%prep
|
||
|
|
%setup -q -n package
|
||
|
|
%setup -q -T -D -a 1 -n package
|
||
|
|
%setup -q -T -D -a 2 -n package
|
||
|
|
cp -p %{SOURCE11} .
|
||
|
|
|
||
|
|
%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}/lsc -o test/ test/*.ls
|
||
|
|
%{_bindir}/mocha -R spec --ui tdd
|
||
|
|
%else
|
||
|
|
%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
|
||
|
|
%endif
|
||
|
|
|
||
|
|
%files
|
||
|
|
%{!?_licensedir:%global license %doc}
|
||
|
|
%doc *.md
|
||
|
|
%license LICENSE
|
||
|
|
%{nodejs_sitelib}/%{packagename}
|
||
|
|
|
||
|
|
%changelog
|
||
|
|
* Thu Aug 20 2020 wangchong <wangchong56@huawei.com> - 1.1.2-1
|
||
|
|
- package init
|