Blob Blame History Raw
%{?nodejs_find_provides_and_requires}

%global enable_tests 1

Name:           nodejs-tap
Version:        0.4.4
Release:        1%{?dist}
Summary:        A Test Anything Protocol library

Group:          Development/Tools
License:        MIT
URL:            https://github.com/isaacs/node-tap
Source0:        http://registry.npmjs.org/tap/-/tap-%{version}.tgz
Source1:        macros.nodejs-tap
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

# the segv test results in SIGSEGV as you would expect, not SIGBUS as is written
# in the test:  https://github.com/isaacs/node-tap/pull/75
# However, in koji it actually results in SIGTERM instead, so we're just going
# to skip the segv test altogether.
Patch1:         nodejs-tap-segv-actually-segfaults.patch

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}
# we need to replicate the dependencies of this package for it to be able to
# test itself
BuildRequires:  npm(inherits) = 1.0.0
BuildRequires:  npm(yamlish)
BuildRequires:  npm(slide)
BuildRequires:  npm(runforcover)
BuildRequires:  npm(nopt)
BuildRequires:  npm(mkdirp)
BuildRequires:  npm(difflet)
BuildRequires:  npm(deep-equal)
BuildRequires:  npm(buffer-equal)
BuildRequires:  npm(glob)
%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
#%%patch1 -p1

%nodejs_fixdep glob 3.2
%nodejs_fixdep inherits 1

#remove bundled modules
rm -rf node_modules

%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} %{buildroot}%{_sysconfdir}/rpm/macros.tap

#make secondary scripts executable
chmod 0755 %{buildroot}%{nodejs_sitelib}/tap/bin/*

%nodejs_symlink_deps

%if 0%{?enable_tests}
%check
# Temporarily disable test/segv.js
rm -f test/segv.js

%nodejs_symlink_deps --check
%__nodejs %{buildroot}%{nodejs_sitelib}/tap/bin/tap.js test/*.js
%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 Sep 03 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.4.4-1
- update to upstream release 0.4.4

* Sat Aug 03 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.4.1-7
- BuildRequire the correct version of inherits

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Jul 11 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.4.1-6
- temporarily disable test/segv.js, as in local mock the test receives SIGSEGV
  but in koji it receives SIGTERM instead

* Wed Jul 10 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.4.1-5
- enable tests
- force the use inherits@1 since this module is incompatible with inherits@2

* Mon Jun 24 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.4.1-4
- fix glob dep

* Sat Jun 22 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.4.1-3
- add macro for EPEL6 dependency generation

* Fri Jun 14 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.4.1-2.1
- rebuild for missing npm(tap) provides
- temporarily disable tests to more easily fix above breakage

* Tue Apr 23 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.4.1-2
- fix rpmlint warnings

* Tue Apr 23 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.4.1-1
- new upstream release 0.4.1
- fix tests

* Tue Jan 15 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.3.3-2
- rename from tap to nodejs-tap
- remove bootstrap logic that didn't work
- instead we use ourself and BuildRequire everything we need

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