%global enable_tests 1 %global srcname compress-commons Name: nodejs-%{srcname} Version: 0.2.0 Release: 1%{?dist} Summary: A library that defines a common interface for working with archive formats License: MIT URL: https://github.com/ctalkington/node-compress-commons 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: nodejs-node-%{srcname}-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(chai) BuildRequires: npm(mocha) BuildRequires: npm(rimraf) BuildRequires: npm(mkdirp) BuildRequires: npm(buffer-crc32) BuildRequires: npm(crc32-stream) BuildRequires: npm(node-int64) %endif %description Compress Commons is a library that defines a common interface for working with archive formats within node. %prep %setup -q -n package %setup -q -T -D -a 1 -n package rm -rf node_modules/ dos2unix 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.2.0-1 - Initial package