[nodejs-shelljs] Initial import

Jamie Nguyen jamielinux at fedoraproject.org
Mon May 19 17:53:22 UTC 2014


commit d47b64ba97c0081c3a8e57d0dd4ccde53f4290a7
Author: Jamie Nguyen <j at jamielinux.com>
Date:   Mon May 19 18:53:17 2014 +0100

    Initial import

 .gitignore                                         |    2 +
 LICENSE.MIT                                        |   21 +++++
 dl-tests.sh                                        |   23 +++++
 nodejs-shelljs-0.3.0-Do-not-run-jshint-tests.patch |   43 ++++++++++
 nodejs-shelljs.spec                                |   86 ++++++++++++++++++++
 sources                                            |    2 +
 6 files changed, 177 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..d8aeb44 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/shelljs-0.3.0.tgz
+/tests-v0.3.0.tar.bz2
diff --git a/LICENSE.MIT b/LICENSE.MIT
new file mode 100644
index 0000000..32ae528
--- /dev/null
+++ b/LICENSE.MIT
@@ -0,0 +1,21 @@
+Copyright (c) 2010 Ryan McGrath
+Copyright (c) 2012 Artur Adib
+
+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/dl-tests.sh b/dl-tests.sh
new file mode 100644
index 0000000..8ad8c52
--- /dev/null
+++ b/dl-tests.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+tag=v0.3.0
+
+set -e
+
+tmp=$(mktemp -d)
+
+trap cleanup EXIT
+cleanup() {
+    set +e
+    [ -z "$tmp" -o ! -d "$tmp" ] || rm -rf "$tmp"
+}
+
+unset CDPATH
+pwd=$(pwd)
+
+pushd "$tmp"
+git clone git://github.com/arturadib/shelljs.git
+cd shelljs
+git archive --prefix="test/" --format=tar tags/${tag}:test/ \
+    | bzip2 > "$pwd"/tests-${tag}.tar.bz2
+popd
diff --git a/nodejs-shelljs-0.3.0-Do-not-run-jshint-tests.patch b/nodejs-shelljs-0.3.0-Do-not-run-jshint-tests.patch
new file mode 100644
index 0000000..0cf45bd
--- /dev/null
+++ b/nodejs-shelljs-0.3.0-Do-not-run-jshint-tests.patch
@@ -0,0 +1,43 @@
+From 4820ff8188a283ebbd08af127595f04341f43738 Mon Sep 17 00:00:00 2001
+From: Jamie Nguyen <j at jamielinux.com>
+Date: Thu, 15 May 2014 18:25:46 +0100
+Subject: [PATCH] Do not run jshint tests
+
+---
+ scripts/run-tests.js | 20 --------------------
+ 1 file changed, 20 deletions(-)
+
+diff --git a/scripts/run-tests.js b/scripts/run-tests.js
+index f9d31e0..67c6dd8 100755
+--- a/scripts/run-tests.js
++++ b/scripts/run-tests.js
+@@ -6,26 +6,6 @@ var path = require('path');
+ var failed = false;
+ 
+ //
+-// Lint
+-//
+-JSHINT_BIN = './node_modules/jshint/bin/jshint';
+-cd(__dirname + '/..');
+-
+-if (!test('-f', JSHINT_BIN)) {
+-  echo('JSHint not found. Run `npm install` in the root dir first.');
+-  exit(1);
+-}
+-
+-if (exec(JSHINT_BIN + ' *.js test/*.js').code !== 0) {
+-  failed = true;
+-  echo('*** JSHINT FAILED! (return code != 0)');
+-  echo();
+-} else {
+-  echo('All JSHint tests passed');
+-  echo();
+-}
+-
+-//
+ // Unit tests
+ //
+ cd(__dirname + '/../test');
+-- 
+1.9.0
+
diff --git a/nodejs-shelljs.spec b/nodejs-shelljs.spec
new file mode 100644
index 0000000..f820a15
--- /dev/null
+++ b/nodejs-shelljs.spec
@@ -0,0 +1,86 @@
+%{?nodejs_find_provides_and_requires}
+
+%global enable_tests 1
+
+Name:       nodejs-shelljs
+Version:    0.3.0
+Release:    1%{?dist}
+Summary:    Portable Unix shell commands for Node.js
+# The bulk of the project is licensed under BSD license.
+# src/cp.js and src/rm.js contain MIT licensed code.
+# https://fedorahosted.org/fpc/ticket/413
+License:    BSD and MIT
+Group:      System Environment/Libraries
+URL:        http://github.com/arturadib/shelljs
+Source0:    http://registry.npmjs.org/shelljs/-/shelljs-%{version}.tgz
+# The test files are not included in the npm tarball.
+# Source1 is generated by running Source10, which pulls from the upstream
+# version control repository.
+Source1:    tests-v%{version}.tar.bz2
+Source10:   dl-tests.sh
+# Include a copy of the MIT license to comply with license requirements.
+Source20:   LICENSE.MIT
+
+Patch0:     %{name}-0.3.0-Do-not-run-jshint-tests.patch
+
+BuildArch:  noarch
+%if 0%{?fedora} >= 19
+ExclusiveArch: %{nodejs_arches} noarch
+%else
+ExclusiveArch: %{ix86} x86_64 %{arm} noarch
+%endif
+
+BuildRequires:  nodejs-packaging
+
+%description
+%{summary}.
+
+
+%prep
+%setup -q -n package
+%setup -q -T -D -a 1 -n package
+%patch0 -p1
+cp -p %{SOURCE20} .
+
+
+%build
+#nothing to do
+
+
+%install
+mkdir -p %{buildroot}%{nodejs_sitelib}/shelljs
+cp -pr package.json global.js make.js shell.js src/ \
+    %{buildroot}%{nodejs_sitelib}/shelljs
+
+mkdir -p %{buildroot}%{nodejs_sitelib}/shelljs/bin
+install -p -m0755 bin/shjs \
+    %{buildroot}%{nodejs_sitelib}/shelljs/bin
+mkdir -p %{buildroot}%{_bindir}
+ln -sf %{nodejs_sitelib}/shelljs/bin/shjs \
+    %{buildroot}%{_bindir}/shjs
+
+%nodejs_symlink_deps
+
+
+%if 0%{?enable_tests}
+%check
+%nodejs_symlink_deps --check
+%__nodejs scripts/run-tests
+%endif
+
+
+%files
+%doc LICENSE README.md
+%{nodejs_sitelib}/shelljs
+%{_bindir}/shjs
+
+
+%changelog
+* Thu May 15 2014 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.3.0-1
+- update to upstream release 0.3.0
+- fix License tag
+- patch out jshint tests
+- include copy of the MIT license
+
+* Sat Mar 29 2014 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.2.6-1
+- initial package
diff --git a/sources b/sources
index e69de29..da3a195 100644
--- a/sources
+++ b/sources
@@ -0,0 +1,2 @@
+7a3a1d2773c57f577844b7885024ce55  shelljs-0.3.0.tgz
+f8db6d20cacc390f0cb354bc2146918f  tests-v0.3.0.tar.bz2


More information about the scm-commits mailing list