From 1edb29fe3c721234ac99b24356b940e61dbde0ba Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Jul 17 2014 16:15:12 +0000 Subject: Initial import of ndoejs-set-immediate --- diff --git a/.gitignore b/.gitignore index e69de29..5b1829c 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/set-immediate-0.1.1.tgz diff --git a/nodejs-set-immediate-license.txt b/nodejs-set-immediate-license.txt new file mode 100644 index 0000000..ec60a64 --- /dev/null +++ b/nodejs-set-immediate-license.txt @@ -0,0 +1,20 @@ +Copyright 2012 Jussi Kalliokoski + +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-set-immediate-test.patch b/nodejs-set-immediate-test.patch new file mode 100644 index 0000000..99d0dd2 --- /dev/null +++ b/nodejs-set-immediate-test.patch @@ -0,0 +1,19 @@ +commit 82b6b7024a1842fc4e6b6f96d1d6ad00a4c8a35a +Author: Tom Hughes +Date: Wed Jul 16 19:12:18 2014 +0100 + + We want to set the global s to true, not a local one + +diff --git a/tests/test.js b/tests/test.js +index 3bd88d4..3ab9bf7 100644 +--- a/tests/test.js ++++ b/tests/test.js +@@ -10,7 +10,7 @@ function printResult () { + + var start = +new Date; + +-setImmediate(function (s) { ++setImmediate(function () { + printResult('It worked and took', +new Date - s, 'milliseconds.'); + s = true; + }, [start]); diff --git a/nodejs-set-immediate.spec b/nodejs-set-immediate.spec new file mode 100644 index 0000000..6aef98a --- /dev/null +++ b/nodejs-set-immediate.spec @@ -0,0 +1,51 @@ +Name: nodejs-set-immediate +Version: 0.1.1 +Release: 1%{?dist} +Summary: A shim for the setImmediate API + +License: MIT +URL: https://github.com/jussi-kalliokoski/setImmediate.js +Source0: http://registry.npmjs.org/set-immediate/-/set-immediate-%{version}.tgz +# https://github.com/jussi-kalliokoski/setImmediate.js/pull/5 +Source1: nodejs-set-immediate-license.txt +# https://github.com/jussi-kalliokoski/setImmediate.js/pull/4 +Patch0: nodejs-set-immediate-test.patch +BuildArch: noarch +ExclusiveArch: %{nodejs_arches} noarch + +BuildRequires: nodejs-packaging + +%description +A simple and lightweight shim for the setImmediate W3C Draft API, for +use in any browsers and NodeJS. + + +%prep +%setup -q -n package +%patch0 -p1 +cp %{SOURCE1} LICENSE +rm -rf node_modules + + +%build + + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/set-immediate +cp -pr package.json setImmediate.js %{buildroot}%{nodejs_sitelib}/set-immediate +%nodejs_symlink_deps + + +%check +%nodejs_symlink_deps --check +%__nodejs tests/test.js + + +%files +%doc README.md LICENSE +%{nodejs_sitelib}/set-immediate + + +%changelog +* Wed Jul 16 2014 Tom Hughes - 0.1.1-1 +- Initial build of 0.1.1 diff --git a/sources b/sources index e69de29..0dd84fd 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +8eeab748ccf0522af258a74731a4aa4a set-immediate-0.1.1.tgz