Blob Blame History Raw
%global enable_tests 1
%global module_name from2
%global gittag0 v2.1.0

Name:           nodejs-%{module_name}
Version:        2.1.0
Release:        4%{?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/%{gittag0}.tar.gz#/%{module_name}-%{version}.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}-%{version}
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
* Sun Jan 17 2016 Parag Nemade <pnemade AT redhat DOT com> - 2.1.0-4
- bump to rebuild against readable-stream > 2.x

* Sun Nov 22 2015 Tom Hughes <tom@compton.nu> - 2.1.0-3
- Remove fixdep that added duplicate inherits dependency

* Wed Aug 26 2015 Parag Nemade <pnemade AT redhat DOT com> - 2.1.0-2
- Use easier git tag source guidelines
- also fix dependency npm(readable-stream)

* Fri Aug 07 2015 Parag Nemade <pnemade AT redhat DOT com> - 2.1.0-1
- Initial packaging