%{?nodejs_find_provides_and_requires}
%global enable_tests 1
Name: nodejs-ms
Version: 0.6.2
Release: 3%{?dist}
Summary: Tiny milliseconds conversion utility for Node.js
License: MIT
Group: System Environment/Libraries
URL: https://github.com/guille/ms.js/
Source0: http://registry.npmjs.org/ms/-/ms-%{version}.tgz
# The tests are not included in the npm tarball.
# Source1 is generated by running Source10, which pulls from the upstream
# version control repository.
Source1: tests-%{version}.tar.bz2
Source10: dl-tests.sh
# Upstream have been informed about missing LICENSE file:
# https://github.com/guille/ms.js/issues/21
Source20: LICENSE
BuildArch: noarch
%if 0%{?fedora} >= 19
ExclusiveArch: %{nodejs_arches} noarch
%else
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
%endif
BuildRequires: nodejs-packaging
%if 0%{?enable_tests}
BuildRequires: npm(expect.js)
BuildRequires: 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
%setup -q -n package
%setup -q -T -D -a 1 -n package
cp -p %{SOURCE20} .
%build
#nothing to do
%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 test/test.js
%endif
%files
%doc LICENSE README.md
%{nodejs_sitelib}/ms
%changelog
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Fri Apr 18 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.6.2-1
- update to upstream release 0.6.2
* Sun Jul 28 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.6.1-2
- restrict to compatible arches
* Sat May 25 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.6.1-1
- update to upstream release 0.6.1
* Sat Mar 16 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.6.0-1
- update to upstream release 0.6.0
- History.md is now not included in the npm tarball
- tests are now not included in the npm tarball, so download separately
* Fri Mar 15 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.5.1-1
- update to upstream release 0.5.1
* Fri Feb 22 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.5.0-2
- add a copy of the MIT license to comply with license requirements
* Thu Feb 14 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.5.0-1
- initial package