[nodejs-zipfile] Initial import of nodejs-zipfile

Tom Hughes tomh at fedoraproject.org
Mon Mar 4 14:02:29 UTC 2013


commit 7b95dd426e22839802bf500a04a54c253bc4d74f
Author: Tom Hughes <tom at compton.nu>
Date:   Mon Mar 4 14:02:15 2013 +0000

    Initial import of nodejs-zipfile

 .gitignore                     |    1 +
 nodejs-zipfile-libraries.patch |   15 ++++++++
 nodejs-zipfile-uv.patch        |   32 +++++++++++++++++
 nodejs-zipfile.spec            |   74 ++++++++++++++++++++++++++++++++++++++++
 sources                        |    1 +
 5 files changed, 123 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..bbd23d1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/zipfile-0.3.4.tgz
diff --git a/nodejs-zipfile-libraries.patch b/nodejs-zipfile-libraries.patch
new file mode 100644
index 0000000..dc5dba0
--- /dev/null
+++ b/nodejs-zipfile-libraries.patch
@@ -0,0 +1,15 @@
+--- binding.gyp.libraries	2012-06-28 18:04:46.000000000 +0100
++++ binding.gyp	2013-02-10 15:41:28.136701943 +0000
+@@ -24,6 +24,12 @@
+         '_LARGEFILE_SOURCE',
+         '_FILE_OFFSET_BITS=64',
+       ],
++      'libraries': [
++        '-lzip',
++      ],
++      'include_dirs': [
++        'include',
++      ],
+       'conditions': [
+         [ 'OS=="mac"', {
+           'libraries': [
diff --git a/nodejs-zipfile-uv.patch b/nodejs-zipfile-uv.patch
new file mode 100644
index 0000000..16baa06
--- /dev/null
+++ b/nodejs-zipfile-uv.patch
@@ -0,0 +1,32 @@
+commit 844605be02184d78716cf03722808c9448bee355
+Author: Tom Hughes <tom at compton.nu>
+Date:   Mon Feb 11 18:49:06 2013 +0000
+
+    Updated for libuv changes in node 0.10
+
+diff --git a/package.json b/package.json
+index 447d9b5..b0feace 100644
+--- a/package.json
++++ b/package.json
+@@ -27,7 +27,7 @@
+        "examples" : "examples",
+        "src": "src"
+    },
+-  "engines"       : { "node": ">= 0.6.13 && < 0.9.0" },
++  "engines"       : { "node": ">= 0.6.13 && < 0.11.0" },
+   "scripts"       : {
+       "install" : "node-waf configure build",
+       "test"    : "make test"
+diff --git a/src/node_zipfile.cpp b/src/node_zipfile.cpp
+index 5321b9f..3a281da 100644
+--- a/src/node_zipfile.cpp
++++ b/src/node_zipfile.cpp
+@@ -293,7 +293,7 @@ Handle<Value> ZipFile::readFile(const Arguments& args) {
+     closure->error = false;
+     closure->name = name;
+     closure->cb = Persistent<Function>::New(Handle<Function>::Cast(args[args.Length()-1]));
+-    uv_queue_work(uv_default_loop(), &closure->request, Work_ReadFile, Work_AfterReadFile);
++    uv_queue_work(uv_default_loop(), &closure->request, Work_ReadFile, (uv_after_work_cb)Work_AfterReadFile);
+     zf->Ref();
+     return Undefined();
+ }
diff --git a/nodejs-zipfile.spec b/nodejs-zipfile.spec
new file mode 100644
index 0000000..5b73d8e
--- /dev/null
+++ b/nodejs-zipfile.spec
@@ -0,0 +1,74 @@
+%global enable_tests 0
+
+Name:           nodejs-zipfile
+Version:        0.3.4
+Release:        2%{?dist}
+Summary:        C++ library for handling zipfiles in Node.js
+
+License:        BSD
+URL:            https://github.com/springmeyer/node-zipfile
+Source0:        http://registry.npmjs.org/zipfile/-/zipfile-%{version}.tgz
+# Link against system libraries
+Patch0:         nodejs-zipfile-libraries.patch
+# Will offer upstream when node 0.10 is released
+Patch1:         nodejs-zipfile-uv.patch
+
+BuildRequires:  nodejs-devel
+BuildRequires:  node-gyp
+BuildRequires:  libzip-devel
+BuildRequires:  zlib-devel
+
+%if 0%{?enable_tests}
+BuildRequires:  npm(mocha)
+BuildRequires:  npm(mkdirp)
+%endif
+
+%description
+Bindings to libzip for handling zipfile archives in Node.js.
+
+
+%prep
+%setup -q -n package
+%patch0 -p0 -b .libraries
+%patch1 -p1 -b .uv
+rm -rf deps node_modules
+# Fix file names corrupted in NPM registry tar ball, see:
+# https://github.com/springmeyer/node-zipfile/issues/29
+mv test/data/Clément test/data/Clément
+mv test/data/Clément/Olá.zip test/data/Clément/Olá.zip
+
+
+%build
+export CXXFLAGS="%{optflags}"
+node-gyp rebuild
+install -p -D -m0755 build/Release/_zipfile.node lib
+
+
+%if 0%{?enable_tests}
+%check
+ln -s %{nodejs_sitelib} .
+NODE_PATH=lib %{nodejs_sitelib}/mocha/bin/mocha -R spec
+%endif
+
+
+%install
+mkdir -p %{buildroot}/%{nodejs_sitearch}/zipfile
+cp -pr package.json lib %{buildroot}/%{nodejs_sitearch}/zipfile
+%nodejs_symlink_deps
+
+
+%files
+%doc LICENSE.txt README.md
+%{nodejs_sitearch}/zipfile
+
+
+%changelog
+* Sat Mar  2 2013 Tom Hughes <tom at compton.nu> - 0.3.4-2
+- Fix permissions on _zipfile.node
+- BuildRequire zlib-devel
+- BuildRequire mkdirp for tests
+- Link node_modules for tests
+- Set NODE_PATH when running tests
+
+* Sun Feb 10 2013 Tom Hughes <tom at compton.nu> - 0.3.4-1
+- Initial build of 0.3.4
diff --git a/sources b/sources
index e69de29..0e0702d 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+4cca70944dac645bcc8cbf85f45ba1fd  zipfile-0.3.4.tgz


More information about the scm-commits mailing list