[nodejs-callsite] initial import

T.C. Hollingsworth patches at fedoraproject.org
Sun Jun 23 02:42:01 UTC 2013


commit 731405a65539b7a31a77ffe616e8b19723706c2a
Author: T.C. Hollingsworth <tchollingsworth at gmail.com>
Date:   Sat Jun 22 19:10:50 2013 -0700

    initial import

 .gitignore                     |    1 +
 LICENSE                        |   22 ++++++++++++
 nodejs-callsite-fix-test.patch |   45 ++++++++++++++++++++++++
 nodejs-callsite.spec           |   75 ++++++++++++++++++++++++++++++++++++++++
 sources                        |    1 +
 5 files changed, 144 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..3e03a61 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/nodejs-callsite-1.0.0-8d39279.tar.gz
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..8d7b585
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2011, 2013 TJ Holowaychuk <tj at vision-media.ca>
+
+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/nodejs-callsite-fix-test.patch b/nodejs-callsite-fix-test.patch
new file mode 100644
index 0000000..72289e3
--- /dev/null
+++ b/nodejs-callsite-fix-test.patch
@@ -0,0 +1,45 @@
+From 380e629a8c3a647fb59e17b4c6fa3e489075a605 Mon Sep 17 00:00:00 2001
+From: "T.C. Hollingsworth" <tchollingsworth at gmail.com>
+Date: Sun, 2 Jun 2013 22:40:27 -0700
+Subject: [PATCH] fix test
+
+---
+ test/__stack.js | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/test/__stack.js b/test/__stack.js
+index fb3fa5d..94caa47 100644
+--- a/test/__stack.js
++++ b/test/__stack.js
+@@ -3,7 +3,7 @@
+  * Module dependencies.
+  */
+ 
+-require('../');
++var stack = require('..');
+ 
+ describe('__stack', function(){
+   it('should return an array of CallSites', function(){
+@@ -18,14 +18,14 @@ describe('__stack', function(){
+     }
+ 
+     function baz() {
+-      __stack[0].fun.should.equal(baz);
+-      __stack[1].fun.should.equal(bar);
+-      __stack[2].fun.should.equal(foo);
++      stack()[0].fun.should.equal(baz);
++      stack()[1].fun.should.equal(bar);
++      stack()[2].fun.should.equal(foo);
+     }
+   })
+ 
+   it('should restore stack preparation', function(){
+-    __stack;
++    stack();
+     new Error().stack.should.be.a('string');
+   })
+ })
+\ No newline at end of file
+-- 
+1.8.2.1
+
diff --git a/nodejs-callsite.spec b/nodejs-callsite.spec
new file mode 100644
index 0000000..112bc79
--- /dev/null
+++ b/nodejs-callsite.spec
@@ -0,0 +1,75 @@
+%{?nodejs_find_provides_and_requires}
+
+#use a github tarball so we get the tests
+%global commit 8d3927995821596148e77f4af049ab38b03d1b99
+%global shortcommit %(c=%{commit}; echo ${c:0:7})
+
+Name:           nodejs-callsite
+Version:        1.0.0
+Release:        1%{?dist}
+Summary:        Provides access to V8's "raw" CallSites from Node.js
+
+BuildArch:      noarch
+
+Group:          Development/Libraries
+#No license file included, "MIT" indicated in README and package.json
+#A copy of the MIT license based on the version included with express, another
+#node module by the same author, is included in Source1, and has been sent
+#upstream: https://github.com/visionmedia/callsite/pull/2
+License:        MIT
+URL:            https://github.com/visionmedia/callsite
+Source0:        https://github.com/visionmedia/callsite/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
+Source1:        https://raw.github.com/tchollingsworth/callsite/8d7615a28a6507c3ef0731f072d3f1a100b3fe27/LICENSE
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+#One of the tests doesn't work and the other needed some prodding to work
+#properly.  I'll look into this more later and file a bug/pull request once I've
+#figured out exactly what's going on.
+Patch1:         %{name}-fix-test.patch
+
+BuildRequires:  nodejs-devel
+
+#for tests
+BuildRequires:  npm(mocha)
+BuildRequires:  npm(should)
+
+%description
+%{summary}.
+
+This is useful for custom traces, C-style assertions, getting the line number in
+execution, and more.
+
+%prep
+%setup -q -n callsite-%{commit}
+
+#fix one test and don't run a non-working one
+%patch1 -p1
+rm -f test/__line.js
+
+#copy LICENSE file into %%_builddir so it works with %%doc
+cp %{SOURCE1} LICENSE
+
+%build
+#nothing to do
+
+%install
+rm -rf %buildroot
+
+mkdir -p %{buildroot}%{nodejs_sitelib}/callsite
+cp -pr index.js package.json %{buildroot}%{nodejs_sitelib}/callsite
+
+%nodejs_symlink_deps
+
+%check
+mocha --require should
+
+%clean
+rm -rf %buildroot
+
+%files
+%defattr(-,root,root,-)
+%{nodejs_sitelib}/callsite
+%doc Readme.md LICENSE examples History.md  
+%changelog
+* Sun Jun 02 2013 T.C. Hollingsworth <tchollingsworth at gmail.com> - 1.0.0-1
+- initial package
diff --git a/sources b/sources
index e69de29..1406ed7 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+7ab42b941c07be3833a50535ca852558  nodejs-callsite-1.0.0-8d39279.tar.gz


More information about the scm-commits mailing list