nodejs-ms/nodejs-ms.spec
2023-10-31 16:36:38 +08:00

53 lines
1.5 KiB
RPMSpec

%{?nodejs_find_provides_and_requires}
%global enable_tests 1
Name: nodejs-ms
Version: 2.1.3
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} -p1
%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
* Tue Oct 31 2023 yaoxin <yao_xin001@hoperun.com> - 2.1.3-1
- Upgrade to 2.1.3
* Thu Aug 20 2020 wangchong <wangchong56@huawei.com> - 2.0.0-1
- package init