diff --git a/nodejs-tar-node5.patch b/nodejs-tar-node5.patch new file mode 100644 index 0000000..eae78ec --- /dev/null +++ b/nodejs-tar-node5.patch @@ -0,0 +1,39 @@ +commit 5e7484daa56a7932b6d1bf7c00474d55c20420da +Author: Tom Hughes +Date: Thu Mar 31 16:05:12 2016 +0100 + + Fix tests for Node.js 5 + + As it is the compressed stream that is truncated, it is the gunzip + stream that reports the end of file error now. + +diff --git a/.travis.yml b/.travis.yml +index fca8ef0..e2c1d11 100644 +--- a/.travis.yml ++++ b/.travis.yml +@@ -2,3 +2,5 @@ language: node_js + node_js: + - 0.10 + - 0.11 ++ - 4 ++ - 5 +diff --git a/test/error-on-broken.js b/test/error-on-broken.js +index e484920..7bc82c6 100644 +--- a/test/error-on-broken.js ++++ b/test/error-on-broken.js +@@ -18,8 +18,14 @@ tap.test('preclean', function (t) { + tap.test('extract test', function (t) { + var extract = tar.Extract(target) + var inp = fs.createReadStream(file) ++ var gunzip = inp.pipe(zlib.createGunzip()) + +- inp.pipe(zlib.createGunzip()).pipe(extract) ++ gunzip.pipe(extract) ++ ++ gunzip.on('error', function (er) { ++ t.equal(er.message, 'unexpected end of file') ++ t.end() ++ }) + + extract.on('error', function (er) { + t.equal(er.message, 'unexpected eof', 'error noticed') diff --git a/nodejs-tar.spec b/nodejs-tar.spec new file mode 100644 index 0000000..1675a9a --- /dev/null +++ b/nodejs-tar.spec @@ -0,0 +1,39 @@ +%{?nodejs_find_provides_and_requires} +Name: nodejs-tar +Version: 2.2.1 +Release: 1 +Summary: Tar for Node.js +License: BSD +URL: https://github.com/isaacs/node-tar +Source0: https://registry.npmjs.org/tar/-/tar-%{version}.tgz +Patch0: nodejs-tar-node5.patch +BuildArch: noarch +ExclusiveArch: %{nodejs_arches} noarch +BuildRequires: nodejs-packaging +BuildRequires: npm(tap) npm(block-stream) npm(fstream) npm(graceful-fs) npm(inherits) >= 2.0.0 +BuildRequires: npm(mkdirp) npm(rimraf) +%description +A Node.js module that supports reading and writing POSIX "tar" archives. + +%prep +%autosetup -p 1 -n package + +%build + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/tar +cp -pr package.json tar.js lib %{buildroot}%{nodejs_sitelib}/tar +%nodejs_symlink_deps + +%check +%nodejs_symlink_deps --check +%__tap test/*.js + +%files +%doc README.md examples +%license LICENSE +%{nodejs_sitelib}/tar + +%changelog +* Wed Aug 12 2020 wangyue - 2.2.1-1 +- package init diff --git a/nodejs-tar.yaml b/nodejs-tar.yaml new file mode 100644 index 0000000..6749b55 --- /dev/null +++ b/nodejs-tar.yaml @@ -0,0 +1,5 @@ +git_url: https://github.com/isaacs/node-tar +version_control: github +src_repo: isaacs/node-tar +tag_prefix: "^v" +seperator: "." diff --git a/tar-2.2.1.tgz b/tar-2.2.1.tgz new file mode 100644 index 0000000..cd46c7d Binary files /dev/null and b/tar-2.2.1.tgz differ