%global enable_tests 1 %global srcname crc32-stream Name: nodejs-%{srcname} Version: 0.3.1 Release: 1%{?dist} Summary: A streaming CRC32 checksumer License: MIT URL: https://github.com/ctalkington/node-crc32-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(mocha) BuildRequires: npm(chai) BuildRequires: npm(readable-stream) BuildRequires: npm(buffer-crc32) %endif %description crc32-stream is a streaming CRC32 checksumer. It uses buffer-crc32 behind the scenes to reliably handle binary data and fancy character sets. Data is passed through untouched. %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.3.1-1 - Initial package