diff --git a/concat-stream-1.6.0.tar.gz b/concat-stream-1.6.0.tar.gz new file mode 100644 index 0000000..b0ff7af Binary files /dev/null and b/concat-stream-1.6.0.tar.gz differ diff --git a/nodejs-concat-stream-typedarray.patch b/nodejs-concat-stream-typedarray.patch new file mode 100644 index 0000000..5f01e0d --- /dev/null +++ b/nodejs-concat-stream-typedarray.patch @@ -0,0 +1,60 @@ +commit 845a8c5172bbab80b2af72e3a73d1ccf14477a2e +Author: Tom Hughes +Date: Sun Jan 17 16:37:10 2016 +0000 + + Only require typedarray if necessary + +diff --git a/test/buffer.js b/test/buffer.js +index d28f5f9..fa7127f 100644 +--- a/test/buffer.js ++++ b/test/buffer.js +@@ -1,7 +1,11 @@ + var concat = require('../') + var test = require('tape') +-var TA = require('typedarray') +-var U8 = typeof Uint8Array !== 'undefined' ? Uint8Array : TA.Uint8Array ++ ++if (typeof Uint8Array === 'undefined') { ++ var U8 = require('typedarray').Uint8Array ++} else { ++ var U8 = Uint8Array ++} + + test('buffer stream', function (t) { + t.plan(2) +diff --git a/test/string.js b/test/string.js +index 218c522..29001f4 100644 +--- a/test/string.js ++++ b/test/string.js +@@ -1,7 +1,11 @@ + var concat = require('../') + var test = require('tape') +-var TA = require('typedarray') +-var U8 = typeof Uint8Array !== 'undefined' ? Uint8Array : TA.Uint8Array ++ ++if (typeof Uint8Array === 'undefined') { ++ var U8 = require('typedarray').Uint8Array ++} else { ++ var U8 = Uint8Array ++} + + test('string -> buffer stream', function (t) { + t.plan(2) +diff --git a/test/typedarray.js b/test/typedarray.js +index ee07110..fffda88 100644 +--- a/test/typedarray.js ++++ b/test/typedarray.js +@@ -1,7 +1,11 @@ + var concat = require('../') + var test = require('tape') +-var TA = require('typedarray') +-var U8 = typeof Uint8Array !== 'undefined' ? Uint8Array : TA.Uint8Array ++ ++if (typeof Uint8Array === 'undefined') { ++ var U8 = require('typedarray').Uint8Array ++} else { ++ var U8 = Uint8Array ++} + + test('typed array stream', function (t) { + t.plan(2) diff --git a/nodejs-concat-stream.spec b/nodejs-concat-stream.spec new file mode 100644 index 0000000..db44697 --- /dev/null +++ b/nodejs-concat-stream.spec @@ -0,0 +1,48 @@ +%{?nodejs_find_provides_and_requires} +%global enable_tests 1 +Name: nodejs-concat-stream +Version: 1.6.0 +Release: 1 +Summary: Writable stream that concatenates data and calls a callback with the result +License: MIT +URL: https://github.com/maxogden/concat-stream +Source0: https://github.com/maxogden/concat-stream/archive/v%{version}/concat-stream-%{version}.tar.gz +Patch0: nodejs-concat-stream-typedarray.patch +BuildArch: noarch +ExclusiveArch: %{nodejs_arches} noarch +ExclusiveArch: %{ix86} x86_64 %{arm} noarch +BuildRequires: nodejs-packaging +%if 0%{?enable_tests} +BuildRequires: npm(tape) npm(inherits) npm(readable-stream) +%endif +%description +%{summary}. + +%prep +%autosetup -p 1 -n concat-stream-%{version} +%nodejs_fixdep readable-stream '^2.0.5' +%nodejs_fixdep -r typedarray + +%build + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/concat-stream +cp -pr package.json index.js \ + %{buildroot}%{nodejs_sitelib}/concat-stream +%nodejs_symlink_deps + +%check +%nodejs_symlink_deps --check +%{__nodejs} -e 'require("./")' +%if 0%{?enable_tests} +/usr/bin/tape test/*.js test/server/*.js +%endif + +%files +%doc readme.md +%license LICENSE +%{nodejs_sitelib}/concat-stream + +%changelog +* Mon Aug 17 2020 Anan Fu - 1.6.0-1 +- package init diff --git a/nodejs-concat-stream.yaml b/nodejs-concat-stream.yaml new file mode 100644 index 0000000..0806a0c --- /dev/null +++ b/nodejs-concat-stream.yaml @@ -0,0 +1,4 @@ +version_control: github +src_repo: maxogden/concat-stream +tag_prefix: "^" +seperator: "."