Blob Blame History Raw
%{?nodejs_find_provides_and_requires}

%global enable_tests 1

Name:           nodejs-runforcover
Version:        0.0.2
Release:        4%{?dist}
Summary:        Require plugin for JS code coverage

BuildArch:      noarch
%if 0%{?fedora} >= 19
ExclusiveArch: %{nodejs_arches} noarch
%else
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
%endif

Group:          System Environment/Libraries
#no license file included; "new BSD" indicated in package.json
License:        BSD
URL:            https://github.com/chrisdickinson/node-runforcover
Source0:        http://registry.npmjs.org/runforcover/-/runforcover-%{version}.tgz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  nodejs-packaging

%if 0%{?enable_tests}
BuildRequires:  npm(bunker)
%endif

%description
Runforcover hooks into the `require()` function and uses nodejs-bunker to
provide code coverage data for your unit test library, whatever it might be.

%prep
%setup -q -n package

%build
#nothing to do

%install
rm -rf %buildroot

mkdir -p %{buildroot}%{nodejs_sitelib}/runforcover
cp -pr package.json index.js %{buildroot}%{nodejs_sitelib}/runforcover

%nodejs_symlink_deps

%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
%__nodejs test/index.js
%endif

%clean
rm -rf %buildroot

%files
%defattr(-,root,root,-)
%{nodejs_sitelib}/runforcover
%doc README.markdown

%changelog
* Sun Jul 28 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.0.2-4
- restrict to compatible arches
- enable tests

* Mon Apr 15 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.0.2-3
- add macro to enable dependency generation on EPEL6

* Wed Feb 13 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.0.2-2
- fix and conditionalize tests

* Tue Jan 08 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.0.2-1
- initial package generated by npm2rpm