%{?nodejs_find_provides_and_requires}
%global enable_tests 0
Name: nodejs-underscore-dot-string
Version: 2.3.1
Release: 1%{?dist}
Summary: String manipulation extensions for the Underscore.js JavaScript library
# License text is contained within README.markdown.
License: MIT
Group: System Environment/Libraries
URL: https://github.com/epeli/underscore.string
Source0: http://registry.npmjs.org/underscore.string/-/underscore.string-%{version}.tgz
BuildArch: noarch
# Building fails due to incorrectly determined file encoding.
# Pull request sent: https://github.com/epeli/underscore.string/pull/210
Patch0: %{name}-2.3.1-Ensure-correct-encoding.patch
BuildRequires: nodejs-devel
BuildRequires: rubygem-rake
BuildRequires: rubygem-uglifier
%if 0%{?enable_tests}
BuildRequires: npm(qunit)
BuildRequires: phantomjs
%endif
%description
%{summary}.
%prep
%setup -q -n package
%patch0 -p1
# Pre-minified files must be removed and minified manually.
rm -f dist/*
%build
/usr/bin/rake build
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/underscore.string
cp -pr package.json dist/ lib/ \
%{buildroot}%{nodejs_sitelib}/underscore.string
%nodejs_symlink_deps
%if 0%{?enable_tests}
%check
ln -sf %{nodejs_sitelib} .
%endif
%files
%doc README.markdown
%{nodejs_sitelib}/underscore.string
%changelog
* Fri Jun 21 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 2.3.1-1
- initial package