[Pkg-javascript-commits] [node-yauzl] 02/04: add debian packaging

Andrew Kelley andrewrk-guest at moszumanska.debian.org
Mon Sep 29 18:43:29 UTC 2014


This is an automated email from the git hooks/post-receive script.

andrewrk-guest pushed a commit to branch master
in repository node-yauzl.

commit 6ee62441f666da16758592dc54a7e64441f0ce4f
Author: Andrew Kelley <superjoe30 at gmail.com>
Date:   Mon Sep 29 18:06:48 2014 +0000

    add debian packaging
---
 debian/changelog                      |   6 +
 debian/compat                         |   1 +
 debian/control                        |  33 +++++
 debian/copyright                      |  38 ++++++
 debian/docs                           |   1 +
 debian/install                        |   3 +
 debian/patches/bundle-fd-slicer.patch | 233 ++++++++++++++++++++++++++++++++++
 debian/patches/series                 |   1 +
 debian/rules                          |  11 ++
 debian/source/format                  |   1 +
 debian/tests/control                  |   2 +
 debian/watch                          |   5 +
 12 files changed, 335 insertions(+)

diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..a6d32fe
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,6 @@
+node-yauzl (2.0.1-1) UNRELEASED; urgency=low
+
+  * Initial release (Closes: #763364)
+
+ -- Andrew Kelley <superjoe30 at gmail.com>  Mon, 29 Sep 2014 17:35:56 +0000
+
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+8
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..3cd6428
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,33 @@
+Source: node-yauzl
+Section: web
+Priority: extra
+Maintainer: Debian Javascript Maintainers <pkg-javascript-devel at lists.alioth.debian.org>
+Uploaders: Andrew Kelley <superjoe30 at gmail.com>
+Build-Depends:
+ debhelper (>= 8)
+ , dh-buildinfo
+ , nodejs
+ , node-iconv
+ , node-pend
+Standards-Version: 3.9.5
+Homepage: https://github.com/thejoshwolfe/yauzl
+Vcs-Git: git://anonscm.debian.org/pkg-javascript/node-yauzl.git
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-javascript/node-yauzl.git
+XS-Testsuite: autopkgtest
+
+Package: node-yauzl
+Architecture: all
+Depends:
+ ${misc:Depends}
+ , nodejs
+ , node-iconv (>= 2.1.4)
+ , node-pend (>= 1.1.3)
+Description: yet another unzip library - Node.js module
+ yauzl is a Node.js module which provides the ability to read from zip files.
+ It follows the spec by reading the central directory for file metadata instead
+ of scanning for local file headers which might be deleted. yauzl also keeps
+ memory usage low by not attempting to buffer entire files in RAM at once.
+ yauzl is designed to generate an error instead of crashing when encountering
+ corrupted or malicious zip files and has a robust test suite to ensure this.
+ .
+ Node.js is an event-based server-side JavaScript engine.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..c9b7c3d
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,38 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: yauzl
+Upstream-Contact: https://github.com/thejoshwolfe/yauzl/issues
+Source: https://github.com/thejoshwolfe/yauzl
+
+Files: *
+Copyright: 2014 Josh Wolfe <thejoshwolfe at gmail.com>
+License: Expat
+
+Files: node_modules/fd-slicer/*
+Copyright: 2014 Andrew Kelley <superjoe30 at gmail.com>
+License: Expat
+
+Files: debian/*
+Copyright: 2014 Andrew Kelley <superjoe30 at gmail.com>
+License: Expat
+
+License: Expat
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..b43bf86
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1 @@
+README.md
diff --git a/debian/install b/debian/install
new file mode 100644
index 0000000..b385a68
--- /dev/null
+++ b/debian/install
@@ -0,0 +1,3 @@
+package.json usr/lib/nodejs/yauzl/
+index.js usr/lib/nodejs/yauzl/
+node_modules usr/lib/nodejs/yauzl/
diff --git a/debian/patches/bundle-fd-slicer.patch b/debian/patches/bundle-fd-slicer.patch
new file mode 100644
index 0000000..19f6036
--- /dev/null
+++ b/debian/patches/bundle-fd-slicer.patch
@@ -0,0 +1,233 @@
+Description: bundle fd-slicer module
+ fd-slicer is too small for the FTP masters to accept, so we bundle it in a
+ patch.
+Author: Andrew Kelley <superjoe30 at gmail.com>
+Forwarded: not-needed
+
+--- /dev/null
++++ node-yauzl-2.0.0/node_modules/fd-slicer/index.js
+@@ -0,0 +1,166 @@
++var fs = require('fs');
++var util = require('util');
++var stream = require('stream');
++var Readable = stream.Readable;
++var Writable = stream.Writable;
++var Pend = require('pend');
++var EventEmitter = require('events').EventEmitter;
++
++module.exports = FdSlicer;
++
++util.inherits(FdSlicer, EventEmitter);
++function FdSlicer(fd, options) {
++  options = options || {};
++  EventEmitter.call(this);
++
++  this.fd = fd;
++  this.pend = new Pend();
++  this.pend.max = 1;
++  this.refCount = 0;
++  this.autoClose = !!options.autoClose;
++}
++
++FdSlicer.prototype.read = function(buffer, offset, length, position, callback) {
++  var self = this;
++  self.pend.go(function(cb) {
++    fs.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer) {
++      cb();
++      callback(err, bytesRead, buffer);
++    });
++  });
++};
++
++FdSlicer.prototype.write = function(buffer, offset, length, position, callback) {
++  var self = this;
++  self.pend.go(function(cb) {
++    fs.write(self.fd, buffer, offset, length, position, function(err, written, buffer) {
++      cb();
++      callback(err, written, buffer);
++    });
++  });
++};
++
++FdSlicer.prototype.createReadStream = function(options) {
++  return new ReadStream(this, options);
++};
++
++FdSlicer.prototype.createWriteStream = function(options) {
++  return new WriteStream(this, options);
++};
++
++FdSlicer.prototype.ref = function() {
++  this.refCount += 1;
++};
++
++FdSlicer.prototype.unref = function() {
++  var self = this;
++  self.refCount -= 1;
++
++  if (self.refCount > 0) return;
++  if (self.refCount < 0) throw new Error("invalid unref");
++
++  if (self.autoClose) {
++    fs.close(self.fd, onCloseDone);
++  }
++
++  function onCloseDone(err) {
++    if (err) {
++      self.emit('error', err);
++    } else {
++      self.emit('close');
++    }
++  }
++};
++
++util.inherits(ReadStream, Readable);
++function ReadStream(context, options) {
++  options = options || {};
++  Readable.call(this, options);
++
++  this.context = context;
++  this.context.ref();
++
++  this.start = options.start || 0;
++  this.end = options.end;
++  this.pos = this.start;
++  this.destroyed = false;
++}
++
++ReadStream.prototype._read = function(n) {
++  var self = this;
++  if (self.destroyed) return;
++
++  var toRead = Math.min(self._readableState.highWaterMark, n);
++  if (self.end != null) {
++    toRead = Math.min(toRead, self.end - self.pos);
++  }
++  if (toRead <= 0) {
++    self.push(null);
++    self.context.unref();
++    return;
++  }
++  self.context.pend.go(function(cb) {
++    if (self.destroyed) return cb();
++    var buffer = new Buffer(toRead);
++    fs.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) {
++      if (err) {
++        self.destroy();
++        self.emit('error', err);
++      } else if (bytesRead === 0) {
++        self.push(null);
++        self.context.unref();
++      } else {
++        self.pos += bytesRead;
++        self.push(buffer.slice(0, bytesRead));
++      }
++      cb();
++    });
++  });
++};
++
++ReadStream.prototype.destroy = function() {
++  this.destroyed = true;
++};
++
++util.inherits(WriteStream, Writable);
++function WriteStream(context, options) {
++  options = options || {};
++  Writable.call(this, options);
++
++  this.context = context;
++  this.context.ref();
++
++  this.start = options.start || 0;
++  this.bytesWritten = 0;
++  this.pos = this.start;
++  this.destroyed = false;
++
++  this.on('finish', function() {
++    context.unref();
++  });
++}
++
++WriteStream.prototype._write = function(buffer, encoding, callback) {
++  var self = this;
++  if (self.destroyed) return;
++
++  self.context.pend.go(function(cb) {
++    if (self.destroyed) return cb();
++    fs.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err, bytes) {
++      if (err) {
++        self.destroy();
++        cb();
++        callback(err);
++      } else {
++        self.bytesWritten += bytes;
++        self.pos += bytes;
++        cb();
++        callback();
++      }
++    });
++  });
++};
++
++WriteStream.prototype.destroy = function() {
++  this.destroyed = true;
++};
+--- /dev/null
++++ node-yauzl-2.0.0/node_modules/fd-slicer/package.json
+@@ -0,0 +1,55 @@
++{
++  "name": "fd-slicer",
++  "version": "0.2.1",
++  "description": "safely create multiple ReadStream or WriteStream objects from the same file descriptor",
++  "main": "index.js",
++  "scripts": {
++    "test": "mocha --reporter spec"
++  },
++  "author": {
++    "name": "Andrew Kelley",
++    "email": "superjoe30 at gmail.com"
++  },
++  "license": "MIT",
++  "devDependencies": {
++    "mocha": "~1.21.3",
++    "stream-equal": "~0.1.5"
++  },
++  "dependencies": {
++    "pend": "~1.1.3"
++  },
++  "directories": {
++    "test": "test"
++  },
++  "repository": {
++    "type": "git",
++    "url": "git://github.com/andrewrk/node-fd-slicer.git"
++  },
++  "bugs": {
++    "url": "https://github.com/andrewrk/node-fd-slicer/issues"
++  },
++  "_id": "fd-slicer at 0.2.1",
++  "dist": {
++    "shasum": "4824cbd31ee247e3a2e41f76808196f2d3322018",
++    "tarball": "http://registry.npmjs.org/fd-slicer/-/fd-slicer-0.2.1.tgz"
++  },
++  "_from": "fd-slicer@~0.2.1",
++  "_npmVersion": "1.3.10",
++  "_npmUser": {
++    "name": "superjoe",
++    "email": "superjoe30 at gmail.com"
++  },
++  "maintainers": [
++    {
++      "name": "superjoe",
++      "email": "superjoe30 at gmail.com"
++    },
++    {
++      "name": "thejoshwolfe",
++      "email": "thejoshwolfe at gmail.com"
++    }
++  ],
++  "_shasum": "4824cbd31ee247e3a2e41f76808196f2d3322018",
++  "_resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-0.2.1.tgz",
++  "readme": "ERROR: No README data found!"
++}
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..e6206e1
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+bundle-fd-slicer.patch
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..5707324
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,11 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+%:
+	dh $@
+
+override_dh_auto_test:
+	nodejs test/test.js
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..67fd37e
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,2 @@
+Test-Command: nodejs -e "require('"'"'yauzl'"'"');"
+Depends: @
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..067566a
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,5 @@
+version=3
+opts=\
+dversionmangle=s/\+(debian|dfsg|ds|deb)(\.\d+)?$//,\
+filenamemangle=s/.*\/v?([\d\.-]+)\.tar\.gz/node-yauzl-$1.tar.gz/ \
+ https://github.com/thejoshwolfe/yauzl/tags .*/archive/v?([\d\.]+).tar.gz

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-yauzl.git



More information about the Pkg-javascript-commits mailing list