%{?nodejs_find_provides_and_requires}
%global packagename sprintf-js
%global enable_tests 1
Name: nodejs-sprintf-js
Version: 1.0.3
Release: 4%{?dist}
Summary: JavaScript sprintf implementation
License: BSD
URL: https://github.com/alexei/sprintf.js.git
Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
ExclusiveArch: %{nodejs_arches} noarch
BuildArch: noarch
BuildRequires: nodejs-packaging
%if 0%{?enable_tests}
BuildRequires: mocha
%endif
Requires: nodejs
%description
JavaScript sprintf implementation
%prep
%setup -q -n package
# clean out pre-minified versions
rm -rf dist/
%build
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
cp -pr *.json src/ \
%{buildroot}%{nodejs_sitelib}/%{packagename}
%nodejs_symlink_deps
%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
/usr/bin/mocha -R spec
%endif
%files
%{!?_licensedir:%global license %doc}
%doc *.md demo/
%license LICENSE
%{nodejs_sitelib}/%{packagename}
%changelog
* Sat Dec 05 2015 Jared Smith <jsmith@fedoraproject.org> - 1.0.3-4
- Do not ship the dist/ directory, it can be moved to a js-sprintf-js package in
the future if needed
* Sat Dec 05 2015 Jared Smith <jsmith@fedoraproject.org> - 1.0.3-3
- Fix inclusion of src/ directory
- Minify the builds during build
* Mon Oct 19 2015 Jared Smith <jsmith@fedoraproject.org> - 1.0.3-2
- rebuilt for missing files in package
* Mon Oct 19 2015 Jared Smith <jsmith@fedoraproject.org> - 1.0.3-1
- Initial packaging