50 lines
1.4 KiB
RPMSpec
50 lines
1.4 KiB
RPMSpec
|
|
%{?nodejs_find_provides_and_requires}
|
||
|
|
%global enable_tests 1
|
||
|
|
Name: nodejs-ms
|
||
|
|
Version: 2.0.0
|
||
|
|
Release: 1
|
||
|
|
Summary: Tiny milliseconds conversion utility for Node.js
|
||
|
|
License: MIT
|
||
|
|
URL: https://www.npmjs.com/package/ms
|
||
|
|
Source0: https://github.com/zeit/ms/archive/%{version}/nodejs-ms-%{version}.tar.gz
|
||
|
|
BuildArch: noarch
|
||
|
|
ExclusiveArch: %{nodejs_arches} noarch
|
||
|
|
BuildRequires: nodejs-packaging
|
||
|
|
%if 0%{?enable_tests}
|
||
|
|
BuildRequires: npm(expect.js) npm(mocha)
|
||
|
|
%endif
|
||
|
|
%description
|
||
|
|
This module is a tiny milliseconds conversion utility for Node.js.
|
||
|
|
It does the following:
|
||
|
|
- If a number is supplied to ms, a string with a unit is returned.
|
||
|
|
- If a string that contains the number is supplied, it returns it as a
|
||
|
|
number (e.g: it returns 100 for '100').
|
||
|
|
- If you pass a string with a number and a valid unit, the number of
|
||
|
|
equivalent milliseconds is returned.
|
||
|
|
|
||
|
|
%prep
|
||
|
|
%autosetup -n ms-%{version}
|
||
|
|
|
||
|
|
%build
|
||
|
|
|
||
|
|
%install
|
||
|
|
mkdir -p %{buildroot}%{nodejs_sitelib}/ms
|
||
|
|
cp -pr package.json index.js \
|
||
|
|
%{buildroot}%{nodejs_sitelib}/ms
|
||
|
|
%nodejs_symlink_deps
|
||
|
|
%if 0%{?enable_tests}
|
||
|
|
|
||
|
|
%check
|
||
|
|
%nodejs_symlink_deps --check
|
||
|
|
%{nodejs_sitelib}/mocha/bin/mocha tests.js
|
||
|
|
%endif
|
||
|
|
|
||
|
|
%files
|
||
|
|
%doc readme.md
|
||
|
|
%license license.md
|
||
|
|
%{nodejs_sitelib}/ms
|
||
|
|
|
||
|
|
%changelog
|
||
|
|
* Thu Aug 20 2020 wangchong <wangchong56@huawei.com> - 2.0.0-1
|
||
|
|
- package init
|