diff --git a/.gitignore b/.gitignore index e69de29..f0c6ee6 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,2 @@ +/commander-1.1.1.tgz +/tests-1.1.1.tar.bz2 diff --git a/dl-tests.sh b/dl-tests.sh new file mode 100755 index 0000000..5cf1503 --- /dev/null +++ b/dl-tests.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +tag=1.1.1 + +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/visionmedia/commander.js.git +cd commander.js +git archive --prefix="test/" --format=tar tags/${tag}:test/ \ + | bzip2 > "$pwd"/tests-${tag}.tar.bz2 +popd diff --git a/nodejs-commander-1.1.1-deps.patch b/nodejs-commander-1.1.1-deps.patch new file mode 100644 index 0000000..921f99e --- /dev/null +++ b/nodejs-commander-1.1.1-deps.patch @@ -0,0 +1,10 @@ +diff -Naur a/package.json b/package.json +--- a/package.json ++++ b/package.json +@@ -9,5 +9,5 @@ + , "devDependencies": { "should": ">= 0.0.1" } + , "scripts": { "test": "make test" } + , "main": "index" +- , "engines": { "node": ">= 0.6.x" } ++ , "engines": { "node": ">= 0.6.0" } + } diff --git a/nodejs-commander.spec b/nodejs-commander.spec new file mode 100644 index 0000000..b2ff0d5 --- /dev/null +++ b/nodejs-commander.spec @@ -0,0 +1,70 @@ +%global enable_tests 0 + +Name: nodejs-commander +Version: 1.1.1 +Release: 1%{?dist} +Summary: Node.js command-line interfaces made easy +# License text is included in Readme.md +License: MIT +Group: System Environment/Libraries +URL: https://github.com/visionmedia/commander.js +Source0: http://registry.npmjs.org/commander/-/commander-%{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 + +# Dep generator bug which adds a trailing dot in the nodejs(engine) requires. +Patch0: nodejs-commander-1.1.1-deps.patch + +BuildRequires: nodejs-devel + +%if 0%{?enable_tests} +BuildRequires: npm(keypress) +BuildRequires: npm(should) +%endif + +%description +The complete solution for Node.js command-line interfaces, +inspired by Ruby's commander. + + +%prep +%setup -q -n package +%setup -T -D -a 1 -q -n package +%patch0 -p1 + + +%build +#nothing to do + + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/commander +cp -pr package.json index.js \ + %{buildroot}%{nodejs_sitelib}/commander + +%nodejs_symlink_deps + + +%if 0%{?enable_tests} +%check +cp -pr %{nodejs_sitelib} . +make test +%endif + + +%files +%doc History.md Readme.md +%{nodejs_sitelib}/commander + + +%changelog +* Tue Feb 12 2013 Jamie Nguyen - 1.1.1-1 +- update to upstream release 1.1.1 +- remove patch that disables a known broken test + +* Mon Feb 11 2013 Jamie Nguyen - 0.6.1-1 +- initial package diff --git a/sources b/sources index e69de29..e9c1e78 100644 --- a/sources +++ b/sources @@ -0,0 +1,2 @@ +ad686cd400b6b15474d5fde7b4f419f2 commander-1.1.1.tgz +9d0fc02c546a8d159f46709d2bda3ccc tests-1.1.1.tar.bz2