66 lines
1.4 KiB
RPMSpec
66 lines
1.4 KiB
RPMSpec
|
|
%{?nodejs_find_provides_and_requires}
|
||
|
|
|
||
|
|
%global packagename has-ansi
|
||
|
|
%global enable_tests 0
|
||
|
|
# Tests disabled due to missing nodejs-ava package dependency
|
||
|
|
|
||
|
|
Name: nodejs-has-ansi
|
||
|
|
Version: 2.0.0
|
||
|
|
Release: 1
|
||
|
|
Summary: Check if a string has ANSI escape codes
|
||
|
|
|
||
|
|
License: MIT
|
||
|
|
URL: https://github.com/sindresorhus/has-ansi
|
||
|
|
Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
|
||
|
|
# The test files are not included in the npm tarball.
|
||
|
|
Source1: https://raw.githubusercontent.com/chalk/has-ansi/0722275e1bef139fcd09137da6e5550c3cd368b9/test.js
|
||
|
|
|
||
|
|
ExclusiveArch: %{nodejs_arches} noarch
|
||
|
|
BuildArch: noarch
|
||
|
|
|
||
|
|
BuildRequires: nodejs-packaging
|
||
|
|
%if 0%{?enable_tests}
|
||
|
|
BuildRequires: npm(ava)
|
||
|
|
%endif
|
||
|
|
|
||
|
|
%description
|
||
|
|
Check if a string has ANSI escape codes
|
||
|
|
|
||
|
|
|
||
|
|
%prep
|
||
|
|
%setup -q -n package
|
||
|
|
# setup the tests
|
||
|
|
cp -p %{SOURCE1} .
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
%build
|
||
|
|
# nothing to do!
|
||
|
|
|
||
|
|
%install
|
||
|
|
mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
|
||
|
|
cp -pr package.json *.js \
|
||
|
|
%{buildroot}%{nodejs_sitelib}/%{packagename}
|
||
|
|
|
||
|
|
%nodejs_symlink_deps
|
||
|
|
|
||
|
|
%if 0%{?enable_tests}
|
||
|
|
%check
|
||
|
|
%nodejs_symlink_deps --check
|
||
|
|
%{__nodejs} -e 'require("./")'
|
||
|
|
%{__nodejs} test.js
|
||
|
|
%endif
|
||
|
|
|
||
|
|
|
||
|
|
%files
|
||
|
|
%{!?_licensedir:%global license %doc}
|
||
|
|
%doc *.md
|
||
|
|
%license license
|
||
|
|
%{nodejs_sitelib}/%{packagename}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
%changelog
|
||
|
|
* Thu Aug 20 2020 wangxiao <wangxiao65@huawei.com> - 2.0.0-1
|
||
|
|
- package init
|