# use the bundled dependencies to allow TAP to test itself %global bootstrap 1 Name: tap Version: 0.3.3 Release: 1%{?dist} Summary: A Test Anything Protocol library BuildArch: noarch Group: Development/Tools License: MIT URL: https://github.com/isaacs/node-tap Source0: http://registry.npmjs.org/tap/-/tap-%{version}.tgz Source1: macros.tap BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: nodejs-devel %if !0%{?bootstrap} BuildRequires: npm(inherits) BuildRequires: npm(yamlish) %endif %description This is a mix-and-match set of utilities that you can use to write test harnesses and frameworks that communicate with one another using the Test Anything Protocol. %prep %setup -q -n package # don't kill the bundled dependencies in bootstrap mode so they can be used # to run %%check (they still aren't actually installed) %if !0%{?bootstrap} rm -rf node_modules %endif %build #nothing to do %install rm -rf %buildroot mkdir -p %{buildroot}%{nodejs_sitelib}/tap cp -pr bin lib package.json %{buildroot}%{nodejs_sitelib}/tap mkdir -p %{buildroot}%{_bindir} ln -sf ../lib/node_modules/tap/bin/tap.js %{buildroot}%{_bindir}/tap #install some macros for use in RPM %%check sections install -Dpm0644 %{SOURCE1} %{_sysconfdir}/rpm/macros.tap %nodejs_symlink_deps %check %if 0%{?bootstrap} #use the source version since the bundled node_modules will exist there %global __tap bin/tap.js %else #use the buildroot version since the necessary node_modules will be symlinked %global __tap %{buildroot}/bin/tap.js %endif %tap test/*.js %if !0%{bootstrap} rm -rf node_modules %endif %clean rm -rf %buildroot %files %defattr(-,root,root,-) %{nodejs_sitelib}/tap %{_bindir}/tap %{_sysconfdir}/rpm/macros.tap %doc coverage-example example README.md AUTHORS LICENSE %changelog * Tue Jan 08 2013 T.C. Hollingsworth - 0.3.3-1 - initial package generated by npm2rpm