[nodejs-node-xmpp] Initial import

Jamie Nguyen jamielinux at fedoraproject.org
Sat Mar 23 16:14:30 UTC 2013


commit 828102635bbe7e51cfa514b9a64dec30eb63d81c
Author: Jamie Nguyen <j at jamielinux.com>
Date:   Sat Mar 23 16:14:15 2013 +0000

    Initial import

 .gitignore                                       |    1 +
 nodejs-node-xmpp-0.3.2-check-socket-exists.patch |   36 +++++++++
 nodejs-node-xmpp.spec                            |   85 ++++++++++++++++++++++
 sources                                          |    1 +
 4 files changed, 123 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..957de9a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/node-xmpp-0.3.2.tgz
diff --git a/nodejs-node-xmpp-0.3.2-check-socket-exists.patch b/nodejs-node-xmpp-0.3.2-check-socket-exists.patch
new file mode 100644
index 0000000..e0dacb1
--- /dev/null
+++ b/nodejs-node-xmpp-0.3.2-check-socket-exists.patch
@@ -0,0 +1,36 @@
+From 5c5c75646835b46f9bca6b273465189325afa3f7 Mon Sep 17 00:00:00 2001
+From: julien <julien.genestoux at gmail.com>
+Date: Sun, 18 Mar 2012 20:19:55 +0100
+Subject: [PATCH] checking that the socket exists before checking that it's
+ writeable
+
+---
+ lib/xmpp/connection.js | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/lib/xmpp/connection.js b/lib/xmpp/connection.js
+index d0505e0..1969980 100644
+--- a/lib/xmpp/connection.js
++++ b/lib/xmpp/connection.js
+@@ -97,6 +97,9 @@ Connection.prototype.setupStream = function() {
+ Connection.prototype.send = function(stanza) {
+     var self = this;
+     var flushed = true;
++    if (!this.socket) {
++        return; // Doh!
++    }
+     if (!this.socket.writable) {
+         this.socket.end();
+         return;
+@@ -322,7 +325,7 @@ Connection.prototype.onClose = function() {
+ Connection.prototype.error = function(condition, message) {
+     this.emit('error', new Error(message));
+ 
+-    if (!this.socket.writable)
++    if (!this.socket || !this.socket.writable)
+         return;
+ 
+     if(!this.streamOpened)
+-- 
+1.8.1.2
+
diff --git a/nodejs-node-xmpp.spec b/nodejs-node-xmpp.spec
new file mode 100644
index 0000000..05ba996
--- /dev/null
+++ b/nodejs-node-xmpp.spec
@@ -0,0 +1,85 @@
+%global enable_tests 0
+
+Name:       nodejs-node-xmpp
+Version:    0.3.2
+Release:    5%{?dist}
+Summary:    Idiomatic XMPP client, component and server library for Node.js
+License:    MIT
+Group:      System Environment/Libraries
+URL:        https://github.com/astro/node-xmpp
+Source0:    http://registry.npmjs.org/node-xmpp/-/node-xmpp-%{version}.tgz
+BuildArch:  noarch
+
+# Small, isolated fix taken from upstream.
+Patch0:     %{name}-0.3.2-check-socket-exists.patch
+
+BuildRequires:  nodejs-devel
+
+%if 0%{?enable_tests}
+BuildRequires:  npm(ltx)
+BuildRequires:  npm(node-stringprep)
+BuildRequires:  npm(vows)
+%endif
+
+%description
+Idiomatic XMPP client, component and server library for Node.js.
+
+The objectives of node-xmpp:
+ - Use Node.js conventions, especially EventEmitter (ie, for write buffer
+   control)
+ - Fast parsing; node-expat was written for this library
+ - Client support for both XMPP clients and components
+ - Optional server infrastructure with Router
+ - After authentication, leave trivial protocol bits to the user, that is
+   XML handling according to any XEP
+
+
+%prep
+%setup -q -n package
+%patch0 -p1
+# Add npm(node-stringprep) to dependencies. Upstream it is an optional
+# component and is listed in devDependencies, but we'll include it anyway
+# for additional functionality.
+%nodejs_fixdep node-stringprep '0.1.x'
+
+
+%build
+#nothing to do
+
+
+%install
+mkdir -p %{buildroot}%{nodejs_sitelib}/node-xmpp
+cp -pr package.json lib/ \
+    %{buildroot}%{nodejs_sitelib}/node-xmpp
+
+%nodejs_symlink_deps
+
+
+%if 0%{?enable_tests}
+%check
+cp -pr %{nodejs_sitelib} .
+%__nodejs test/jid-test.js
+%endif
+
+
+%files
+%doc LICENSE README.markdown examples/
+%{nodejs_sitelib}/node-xmpp
+
+
+%changelog
+* Sat Mar 23 2013 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.3.2-5
+- add comment about upstream patch
+- fix %%description
+
+* Wed Feb 20 2013 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.3.2-4
+- apply check-socket-exists.patch
+
+* Thu Feb 14 2013 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.3.2-3
+- make use of %%nodejs_fixdep
+
+* Wed Feb 13 2013 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.3.2-2
+- be a bit more cautious with version requirements in the dependency patch
+
+* Mon Feb 11 2013 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.3.2-1
+- initial package
diff --git a/sources b/sources
index e69de29..c82a697 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+29a618a329eddb3c674a8a99a5d88844  node-xmpp-0.3.2.tgz


More information about the scm-commits mailing list