%global enable_tests 1 %global srcname zip-stream Name: nodejs-%{srcname} Version: 0.5.0 Release: 1%{?dist} Summary: A streaming zip archive generator License: MIT URL: https://github.com/ctalkington/node-zip-stream Source0: https://registry.npmjs.org/%{srcname}/-/%{srcname}-%{version}.tgz # The test files are missing from the NPM tarball. # Source1 is generated by running Source10, which pulls from the upstream # version control repository. Source1: %{name}-tests-%{version}.tar.bz2 Source10: %{name}-dl-tests.sh BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch BuildRequires: nodejs-packaging BuildRequires: dos2unix %if 0%{?enable_tests} BuildRequires: npm(readable-stream) BuildRequires: npm(chai) BuildRequires: npm(mocha) BuildRequires: npm(rimraf) BuildRequires: npm(mkdirp) BuildRequires: npm(compress-commons) BuildRequires: npm(lodash) %endif %description zip-stream is a streaming zip archive generator based on the ZipArchiveOutputStream prototype found in the compress-commons project. %prep %setup -q -n package %setup -q -T -D -a 1 -n package rm -rf node_modules/ dos2unix README.md LICENSE-MIT %nodejs_fixdep readable-stream ^1.1 %build #nothing to do %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{srcname} cp -pr package.json lib/ %{buildroot}%{nodejs_sitelib}/%{srcname} %nodejs_symlink_deps %if 0%{?enable_tests} %check %nodejs_symlink_deps --check mocha --reporter dot %endif %files %doc README.md LICENSE-MIT %{nodejs_sitelib}/%{srcname} %changelog * Mon Dec 22 2014 Piotr Popieluch - 0.5.0-1 - Initial package