%{?nodejs_find_provides_and_requires} %global packagename body-parser %global enable_tests 0 # Tests disabled until we can rebuild newer version of supertest Name: nodejs-body-parser Version: 1.14.1 Release: 2%{?dist} Summary: Node.js body parsing middleware License: MIT URL: https://github.com/expressjs/body-parser Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{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 %if 0%{?fedora} >= 19 ExclusiveArch: %{nodejs_arches} noarch %else ExclusiveArch: %{ix86} x86_64 %{arm} noarch %endif BuildArch: noarch BuildRequires: nodejs-packaging %if 0%{?enable_tests} BuildRequires: npm(supertest) BuildRequires: npm(depd) BuildRequires: npm(http-errors) BuildRequires: npm(content-type) BuildRequires: npm(on-finished) BuildRequires: npm(type-is) %endif Requires: nodejs %description Node.js body parsing middleware This module provides the following parsers: * JSON body parser * Raw body parser * Text body parser * URL-encoded form body parser %prep %setup -q -n package # setup the tests as well %setup -q -T -D -a 1 -n package %nodejs_fixdep iconv-lite '~0.4.13' %nodejs_fixdep qs '~2.3.3' %build # nothing to do! %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json *.js lib/ \ %{buildroot}%{nodejs_sitelib}/%{packagename} %nodejs_symlink_deps %if 0%{?enable_tests} %check %nodejs_symlink_deps --check /usr/bin/mocha --require test/support/env --reporter spec --check-leaks --bail test/ %endif %files %doc %license %{nodejs_sitelib}/%{packagename} %changelog * Wed Oct 7 2015 Jared Smith - 1.14.1-2 - Initial packaging