%global npmname body-parser Name: nodejs-%{npmname} Version: 1.17.1 Release: 1%{?dist} Summary: Node.js body parsing middleware License: MIT URL: https://www.npmjs.com/package/%{npmname} # Pull sources from github, with unit tests, not npm. # Source0: https://registry.npmjs.org/%{npmname}/-/%{npmname}-%{version}.tgz Source0: https://github.com/expressjs/body-parser/archive/%{version}/%{npmname}-%{version}.tar.gz # Patch required because a test requires a newer nodejs-supertest than Fedora ships. Patch1: nodejs-body-parser-disable-json-test.patch BuildRequires: nodejs-packaging BuildRequires: nodejs-debug, nodejs-bytes, nodejs-content-type, nodejs-depd, BuildRequires: nodejs-http-errors, nodejs-iconv-lite, nodejs-on-finished, nodejs-qs, BuildRequires: nodejs-raw-body, nodejs-type-is # Unit tests. BuildRequires: mocha, nodejs-methods, nodejs-supertest BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch %description Parse incoming request bodies in a middleware before your handlers, available under the req.body property. This does not handle multipart bodies, due to their complex and typically large nature. %prep %autosetup -n %{npmname}-%{version} -p1 # Remove forced versions from package.json %nodejs_fixdep content-type %nodejs_fixdep debug %nodejs_fixdep depd %nodejs_fixdep http-errors %nodejs_fixdep iconv-lite %nodejs_fixdep on-finished %nodejs_fixdep qs %nodejs_fixdep raw-body %nodejs_fixdep type-is %build # Nothing to build, this is a noarch package %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{npmname} cp -a lib/ %{buildroot}%{nodejs_sitelib}/%{npmname}/ cp -a index.js %{buildroot}%{nodejs_sitelib}/%{npmname}/ cp -a package.json %{buildroot}%{nodejs_sitelib}/%{npmname}/ %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' pwd # Run tests with mocha. mocha --require test/support/env --reporter spec --check-leaks --bail test/ %files %{nodejs_sitelib}/%{npmname}/ %license LICENSE %doc README.md HISTORY.md %changelog * Wed Mar 22 2017 Ben Rosser - 1.17.1-1 - Update to latest upstream release. - Fix a typo in the package description. * Sun Feb 26 2017 Ben Rosser - 1.16.1-1 - Update to latest upstream release. * Thu Feb 02 2017 Ben Rosser - 1.16.0-1 - Initial package.