%{?nodejs_find_provides_and_requires}
%global enable_tests 0
Name: nodejs-raw-body
Version: 1.1.4
Release: 3%{?dist}
Summary: Get and validate the raw body of a readable stream
License: MIT
Group: System Environment/Libraries
URL: https://github.com/stream-utils/raw-body
Source0: http://registry.npmjs.org/raw-body/-/raw-body-%{version}.tgz
# The test files are not included in the npm tarball.
# Source1 is generated by running Source10, which pulls from the upstream
# version control repository.
Source1: tests-%{version}.tar.bz2
Source10: dl-tests.sh
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}
BuildRequires: npm(bytes)
BuildRequires: npm(mocha)
BuildRequires: npm(request)
# Not yet packaged for Fedora.
# BuildRequires: npm(assert-tap)
# BuildRequires: npm(co)
# BuildRequires: npm(gnode)
# BuildRequires: npm(readable-stream)
# BuildRequires: npm(through2)
%endif
%description
This module gets the entire buffer of a stream either as a buffer or a string.
It validates the stream's length against an expected length and maximum limit.
It is ideal for parsing request bodies.
%prep
%setup -q -n package
%setup -q -T -D -a 1 -n package
%build
#nothing to do
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/raw-body
cp -pr package.json index.js \
%{buildroot}%{nodejs_sitelib}/raw-body
%nodejs_symlink_deps
%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
# /usr/bin/npm install
# gnode required to access generators on Node < 0.11
NODE=node_modules/gnode/bin/gnode \
/usr/bin/mocha --reporter spec --bail test/index.js
%endif
%files
%doc README.md
%{nodejs_sitelib}/raw-body
%changelog
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Sun Apr 20 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 1.1.4-1
- update to upstream release 1.1.4
* Mon Mar 10 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 1.1.3-1
- initial package