%{?nodejs_find_provides_and_requires}
%global enable_tests 1
Name: nodejs-dateformat
Version: 1.0.12
Release: 3%{?dist}
Summary: Steven Levithan's excellent dateFormat() function for Node.js
License: MIT
Group: System Environment/Libraries
URL: https://github.com/felixge/node-dateformat
Source0: http://registry.npmjs.org/dateformat/-/dateformat-%{version}.tgz
# Upstream have been informed about missing LICENSE file.
# Pull request sent: https://github.com/felixge/node-dateformat/pull/14
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(mocha)
BuildRequires: npm(underscore)
%endif
%description
This is a JavaScript port of Steven Levithan's excellent dateFormat()
function, which provides a simple way to format dates and times
according to a user-specified mask.
%prep
%setup -q -n package
cp -a %{SOURCE20} .
%nodejs_fixdep get-stdin
%build
#nothing to do
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/dateformat
cp -pr package.json lib/ \
%{buildroot}%{nodejs_sitelib}/dateformat
%nodejs_symlink_deps
%check
%nodejs_symlink_deps --check
%{__nodejs} -e 'require("./")'
%if 0%{?enable_tests}
TZ=UTC %{_bindir}/mocha -R spec
%endif
%files
%doc LICENSE Readme.md
%{nodejs_sitelib}/dateformat
%changelog
* Fri Jul 15 2016 Jared Smith <jsmith@fedoraproject.org> - 1.0.12-3
- Add missing BuildRequires for tests
* Fri Jul 15 2016 Jared Smith <jsmith@fedoraproject.org> - 1.0.12-2
- Fix dependency on nodejs-get-stdin
* Fri Apr 22 2016 Jared Smith <jsmith@fedoraproject.org> - 1.0.12-1
- Update to upstream 1.0.12 release
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Fri Jun 21 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 1.0.6-1
- initial package