54 lines
1.4 KiB
RPMSpec
54 lines
1.4 KiB
RPMSpec
%{?nodejs_find_provides_and_requires}
|
|
%global enable_tests 0
|
|
Name: nodejs-pretty-bytes
|
|
Version: 4.0.2
|
|
Release: 1
|
|
Summary: Convert bytes to a human readable string
|
|
License: MIT
|
|
URL: https://github.com/sindresorhus/pretty-bytes
|
|
Source0: http://registry.npmjs.org/pretty-bytes/-/pretty-bytes-%{version}.tgz
|
|
Source1: https://raw.githubusercontent.com/sindresorhus/pretty-bytes/v%{version}/test.js
|
|
BuildArch: noarch
|
|
ExclusiveArch: %{nodejs_arches} noarch
|
|
BuildRequires: nodejs-packaging
|
|
%if 0%{?enable_tests}
|
|
BuildRequires: npm(ava)
|
|
%endif
|
|
%description
|
|
%{summary}.
|
|
|
|
%prep
|
|
%setup -q -n package
|
|
cp -p %{SOURCE1} .
|
|
|
|
%build
|
|
|
|
%install
|
|
mkdir -p %{buildroot}%{nodejs_sitelib}/pretty-bytes
|
|
cp -pr package.json *.js \
|
|
%{buildroot}%{nodejs_sitelib}/pretty-bytes
|
|
mkdir -p %{buildroot}%{_bindir}
|
|
ln -sf %{nodejs_sitelib}/pretty-bytes/cli.js \
|
|
%{buildroot}%{_bindir}/pretty-bytes
|
|
%nodejs_symlink_deps
|
|
|
|
%check
|
|
%nodejs_symlink_deps --check
|
|
%{__nodejs} -e 'require("./")'
|
|
%if 0%{?enable_tests}
|
|
%{_bindir}/ava
|
|
%else
|
|
%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
|
|
%endif
|
|
|
|
%files
|
|
%{!?_licensedir:%global license %doc}
|
|
%license license
|
|
%doc readme.md
|
|
%{nodejs_sitelib}/pretty-bytes
|
|
%{_bindir}/pretty-bytes
|
|
|
|
%changelog
|
|
* Thu Aug 20 2020 wangchong <wangchong56@huawei.com> - 4.0.2-1
|
|
- package init
|