Blob Blame History Raw
%{?nodejs_find_provides_and_requires}

%global enable_tests 1

Name:       nodejs-raw-body
Version:    2.2.0
Release:    5%{?dist}
Summary:    Get and validate the raw body of a readable stream
License:    MIT
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

ExclusiveArch:  %{nodejs_arches} noarch
BuildArch:      noarch
BuildRequires:  nodejs-packaging

BuildRequires:  npm(bytes)
BuildRequires:  npm(iconv-lite)
BuildRequires:  npm(unpipe)

%if 0%{?enable_tests}

BuildRequires:  npm(bluebird)
BuildRequires:  npm(istanbul)
Buildrequires:  npm(mocha)
BuildRequires:  npm(readable-stream)
BuildRequires:  npm(through2)
# not packaged
# BuildRequires:  npm(eslint)
# BuildRequires:  npm(eslint-config-standard)
# BuildRequires:  npm(eslint-plugin-markdown)
# BuildRequires:  npm(eslint-plugin-promise)
# BuildRequires:  npm(eslint-plugin-standard)
%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

%nodejs_fixdep bytes --caret
%nodejs_fixdep iconv-lite '<0.5.0'
%nodejs_fixdep unpipe --caret

%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


%check
%nodejs_symlink_deps --check
%{__nodejs} -e 'require("./")'

%if 0%{?enable_tests}
mocha --trace-deprecation --reporter spec --bail --check-leaks test/
istanbul-js cover mocha -- --trace-deprecation --reporter dot --check-leaks test/
istanbul-js cover mocha --report lcovonly -- --trace-deprecation --reporter spec --check-leaks test/
%endif


%files
%doc README.md
%license LICENSE
%{nodejs_sitelib}/raw-body

%changelog
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Thu Mar 30 2017 Piotr Popieluch <piotr1212@gmail.com> - 2.2.0-3
- Fix test logic to have successfull builds
- Add LICENSE file

* Fri Feb 24 2017 Zuzana Svetlikova <zsvetlik@redhat.com> - 2.2.0-2
- Update spec

* Mon Feb 13 2017 Zuzana Svetlikova <zsvetlik@redhat.com> - 2.2.0-1
- Update

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* 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