diff --git a/.gitignore b/.gitignore index e69de29..fabc082 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,2 @@ +/promise-4.0.0.tgz +/tests-4.0.0.tar.bz2 diff --git a/dl-tests.sh b/dl-tests.sh new file mode 100644 index 0000000..9239f59 --- /dev/null +++ b/dl-tests.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +tag=4.0.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/then/promise.git +cd promise +git archive --prefix="test/" --format=tar tags/${tag}:test/ \ + | bzip2 > "$pwd"/tests-${tag}.tar.bz2 +popd diff --git a/nodejs-promise.spec b/nodejs-promise.spec new file mode 100644 index 0000000..b8dba96 --- /dev/null +++ b/nodejs-promise.spec @@ -0,0 +1,72 @@ +%{?nodejs_find_provides_and_requires} + +%global enable_tests 0 + +Name: nodejs-promise +Version: 4.0.0 +Release: 1%{?dist} +Summary: Bare bones Promises/A+ implementation for Node.js +License: MIT +Group: System Environment/Libraries +URL: https://github.com/then/promise +Source0: http://registry.npmjs.org/promise/-/promise-%{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 +%if 0%{?fedora} >= 19 +ExclusiveArch: %{nodejs_arches} noarch +%else +ExclusiveArch: %{ix86} x86_64 %{arm} noarch +%endif + +BuildRequires: nodejs-packaging + +%if 0%{?enable_tests} +BuildRequires: mocha +BuildRequires: npm(asap) +BuildRequires: npm(better-assert) +BuildRequires: npm(promises-aplus-tests) +%endif + +%description +This is a bare bones Promises/A+ implementation for Node.js. It is designed +to get the basics spot on correct, so that you can build extended promise +implementations on top of it. + + +%prep +%setup -q -n package +%setup -q -T -D -a 1 -n package + + +%build +#nothing to do + + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/promise +cp -pr package.json core.js index.js \ + %{buildroot}%{nodejs_sitelib}/promise + +%nodejs_symlink_deps + + +%if 0%{?enable_tests} +%check +%nodejs_symlink_deps --check +/usr/bin/mocha -R spec --timeout 200 --slow 99999 +%endif + + +%files +%doc LICENSE Readme.md +%{nodejs_sitelib}/promise + + +%changelog +* Sun Mar 02 2014 Jamie Nguyen - 4.0.0-1 +- initial package diff --git a/sources b/sources index e69de29..b4f977d 100644 --- a/sources +++ b/sources @@ -0,0 +1,2 @@ +02180812890e39233f5028accf018b1f promise-4.0.0.tgz +fc713cdb0cb14d239b08d40f4c73b4bd tests-4.0.0.tar.bz2