e8458ea
%global enable_tests 1
e8458ea
%global srcname isstream
e8458ea
e8458ea
Name:           nodejs-%{srcname}
e8458ea
Version:        0.1.2
3c7cb2b
Release:        3%{?dist}
e8458ea
Summary:        Determine if an object is a Stream
e8458ea
License:        MIT
e8458ea
URL:            https://github.com/rvagg/isstream
e8458ea
Source0:        https://registry.npmjs.org/%{srcname}/-/%{srcname}-%{version}.tgz
e8458ea
e8458ea
BuildArch:      noarch
e8458ea
ExclusiveArch:  %{nodejs_arches} noarch
e8458ea
e8458ea
BuildRequires:  nodejs-packaging
e8458ea
e8458ea
%if 0%{?enable_tests}
e8458ea
BuildRequires:  npm(tape)
e8458ea
BuildRequires:  npm(core-util-is)
e8458ea
BuildRequires:  npm(isarray)
e8458ea
BuildRequires:  npm(string_decoder)
e8458ea
BuildRequires:  npm(inherits)
e8458ea
# Package ships with two bundled versions of readable-stream for tests.
e8458ea
# We are only interested in testing against the version which is actually in
e8458ea
# Fedora.
e8458ea
BuildRequires:  npm(readable-stream)
e8458ea
%endif
e8458ea
e8458ea
%description
e8458ea
%{summary}.
e8458ea
e8458ea
%prep
e8458ea
%setup -q -n package
e8458ea
rm -rf node_modules
e8458ea
# symlink Fedora packaged readable-stream for testing
e8458ea
%nodejs_fixdep --dev readable-stream
e8458ea
e8458ea
%build
e8458ea
#nothing to do
e8458ea
e8458ea
%install
e8458ea
mkdir -p %{buildroot}%{nodejs_sitelib}/%{srcname}
e8458ea
cp -pr package.json isstream.js \
e8458ea
     %{buildroot}%{nodejs_sitelib}/%{srcname}
e8458ea
e8458ea
%nodejs_symlink_deps
e8458ea
e8458ea
%if 0%{?enable_tests}
e8458ea
%check
e8458ea
%nodejs_symlink_deps --check
e8458ea
# extra symlinks so we use Fedora shipped readable-stream
e8458ea
ln -s ./node_modules/readable-stream readable-stream-1.0
e8458ea
ln -s ./node_modules/readable-stream readable-stream-1.1
e8458ea
node test.js
e8458ea
%endif
e8458ea
e8458ea
e8458ea
%files
e8458ea
%doc README.md
e8458ea
%license LICENSE.md
e8458ea
%{nodejs_sitelib}/%{srcname}
e8458ea
e8458ea
%changelog
3c7cb2b
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.2-3
3c7cb2b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
3c7cb2b
e8458ea
* Fri Nov 06 2015 Piotr Popieluch <piotr1212@gmail.com> - 0.1.2-2
e8458ea
- Add readable-stream to BR and symlinks and enable tests
e8458ea
e8458ea
* Sat Oct 24 2015 Piotr Popieluch <piotr1212@gmail.com> - 0.1.2-1
e8458ea
- Initial package