%global enable_tests 1
%global module_name from2
%global commit0 32b7efb53c92c8abde09291b06e1f8a009c60b63
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
Name: nodejs-%{module_name}
Version: 2.1.0
Release: 1%{?dist}
Summary: Wrapper for ReadableStream, with an API lifted from "from" and "through2"
License: MIT
URL: https://github.com/hughsk/from2
Source0: https://github.com/hughsk/%{module_name}/archive/%{commit0}.tar.gz#/%{module_name}-%{shortcommit0}.tar.gz
BuildArch: noarch
ExclusiveArch: %{nodejs_arches} noarch
BuildRequires: nodejs-packaging
%if 0%{?enable_tests}
BuildRequires: npm(tape)
BuildRequires: npm(inherits)
BuildRequires: npm(readable-stream)
%endif
%description
from2 is a high-level module for creating readable streams that properly
handle backpressure.
%prep
%setup -q -n %{module_name}-%{commit0}
rm -rf node_modules
%nodejs_fixdep --dev inherits
%build
# nothing to build
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/%{module_name}
cp -p package.json index.js %{buildroot}%{nodejs_sitelib}/%{module_name}
%nodejs_symlink_deps
%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
node test.js
%endif
%files
%doc README.md
%license LICENSE.md
%{nodejs_sitelib}/%{module_name}
%changelog
* Fri Aug 07 2015 Parag Nemade <pnemade AT redhat DOT com> - 2.1.0-1
- Initial packaging