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