From 0ebf3c06c47c1ccaf64979e99ddd9628a23026a1 Mon Sep 17 00:00:00 2001 From: Jamie Nguyen Date: Thu, 21 Feb 2013 07:42:50 +0000 Subject: [PATCH] Initial commit --- .gitignore | 2 ++ dl-tests.sh | 23 +++++++++++++++ nodejs-underscore.spec | 63 ++++++++++++++++++++++++++++++++++++++++++ sources | 2 ++ 4 files changed, 90 insertions(+) create mode 100755 dl-tests.sh create mode 100644 nodejs-underscore.spec diff --git a/.gitignore b/.gitignore index e69de29..76f333f 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,2 @@ +/tests-1.4.4.tar.bz2 +/underscore-1.4.4.tgz diff --git a/dl-tests.sh b/dl-tests.sh new file mode 100755 index 0000000..beb0026 --- /dev/null +++ b/dl-tests.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +tag=1.4.4 + +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/documentcloud/underscore.git +cd underscore +git archive --prefix="test/" --format=tar tags/${tag}:test/ \ + | bzip2 > "$pwd"/tests-${tag}.tar.bz2 +popd diff --git a/nodejs-underscore.spec b/nodejs-underscore.spec new file mode 100644 index 0000000..e5b335c --- /dev/null +++ b/nodejs-underscore.spec @@ -0,0 +1,63 @@ +%global enable_tests 0 + +Name: nodejs-underscore +Version: 1.4.4 +Release: 1%{?dist} +Summary: JavaScript's functional programming helper library +License: MIT +Group: System Environment/Libraries +URL: https://github.com/documentcloud/underscore +Source0: http://registry.npmjs.org/underscore/-/underscore-%{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-%{version}.tar.bz2 +Source10: dl-tests.sh +BuildArch: noarch + +BuildRequires: nodejs-devel + +%if 0%{?enable_tests} +BuildRequires: npm(phantomjs) +%endif + +%description +Underscore.js is a utility-belt library for JavaScript that provides support +for the usual functional suspects (each, map, reduce, filter...) without +extending any core JavaScript objects. + + +%prep +%setup -q -n package +%setup -T -D -a 1 -q -n package + + +%build +#nothing to do + + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/underscore +cp -pr package.json index.js underscore.js underscore-min.js \ + %{buildroot}%{nodejs_sitelib}/underscore + +# No dependencies. +# %%nodejs_symlink_deps + + +%if 0%{?enable_tests} +%check +cp -pr %{nodejs_sitelib} . +%{nodejs_sitelib}/phantomjs/bin/phantomjs \ + test/vendor/runner.js test/index.html?noglobals=true +%endif + + +%files +%doc CONTRIBUTING.md LICENSE README.md favicon.ico index.html +%{nodejs_sitelib}/underscore + + +%changelog +* Wed Feb 13 2013 Jamie Nguyen - 1.4.4-1 +- initial package diff --git a/sources b/sources index e69de29..0d52a2c 100644 --- a/sources +++ b/sources @@ -0,0 +1,2 @@ +f3d6a69153074b3205df96960f43ca66 tests-1.4.4.tar.bz2 +b3f32b8c28916abc21eed67d0d7f91c8 underscore-1.4.4.tgz