Blob Blame History Raw
%{?scl:%scl_package nodejs-%{npm_name}}
%{!?scl:%global pkg_name %{name}}

%{?nodejs_find_provides_and_requires}

%global npm_name es6-promise
# Tests disabled due to dependencies not in Fedora yet
# Tests also are not working even with dependencies
%global enable_tests 0


Summary:       Lightweight library that provides tools for organizing asynchronous code
Name:          %{?scl_prefix}nodejs-%{npm_name}
Version:       3.0.2
Release:       3%{?dist}
License:       MIT
URL:           https://github.com/jakearchibald/ES6-Promises
Source0:       http://registry.npmjs.org/%{npm_name}/-/%{npm_name}-%{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.%{npm_name}.sh
BuildRequires: nodejs010-runtime
%if 0%{?enable_tests}
BuildRequires: %{?scl_prefix}nodejs(ember)
BuildRequires: %{?scl_prefix}nodejs(ember-cli)
%endif

BuildArch:     noarch
ExclusiveArch: %{nodejs_arches} noarch

%description
A lightweight library that provides tools for organizing 
asynchronous code

This is a polyfill of the ES6 Promise. The implementation 
is a subset of rsvp.js.

%prep
%setup -q -n package
# setup the tests
%setup -q -T -D -a 1 -n package

%build
#nothing to do

%install
mkdir -p %{buildroot}%{nodejs_sitelib}/%{npm_name}
cp -pr dist lib package.json %{buildroot}%{nodejs_sitelib}/%{npm_name}

%nodejs_symlink_deps

%if 0%{?enable_tests}

%check
%nodejs_symlink_deps --check
ember test
%endif

%files
%{!?_licensedir:%global license %doc}
%doc CHANGELOG.md README.md
%license LICENSE
%{nodejs_sitelib}/%{npm_name}

%changelog
* Wed Jan 06 2016 Tomas Hrcka <thrcka@redhat.com> - 3.0.2-3
- Enable scl macros

* Tue Oct 20 2015 Troy Dawson <tdawson@redhat.com> - 3.0.2-2
- Add tests, fixup spec file

* Mon Sep 21 2015 Troy Dawson <tdawson@redhat.com> - 3.0.2-1
- Initial build