%{?nodejs_find_provides_and_requires}
%global enable_tests 1
Name: nodejs-q
Version: 1.4.1
Release: 1%{?dist}
Summary: A tool for making and composing asynchronous promises in JavaScript
# q.js appears to contain both MIT and ASL 2.0 licensed code
License: MIT and ASL 2.0
Group: System Environment/Libraries
URL: https://github.com/kriskowal/q
Source0: http://registry.npmjs.org/q/-/q-%{version}.tgz
# Sources 1-2 are generated by running Source10, which pulls from the upstream
# revision control repository.
Source1: tests-%{version}.tar.bz2
Source2: examples-%{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: npm(jasmine-node)
BuildRequires: npm(promises-aplus-tests)
%endif
%description
Q is a tool for making and composing asynchronous promises in JavaScript.
If a function cannot return a value or throw an exception without blocking,
it can return a promise instead. A promise is an object that represents the
return value or the thrown exception that the function may eventually provide.
A promise can also be used as a proxy for a remote object to overcome latency.
Q can exchange promises with jQuery, Dojo, When.js, WinJS, and more.
Additionally, there are many libraries that produce and consume Q promises for
everything from file system/database access or RPC to templating.
%prep
%setup -q -n package
%setup -q -D -T -a 1 -n package
%setup -q -D -T -a 2 -n package
%build
#nothing to do
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/q
cp -pr package.json *.js \
%{buildroot}%{nodejs_sitelib}/q
%nodejs_symlink_deps
%check
%nodejs_symlink_deps --check
%{__nodejs} -e 'require("./")'
%if 0%{?enable_tests}
%{_bindir}/jasmine-node spec
#%{_bindir}/promises-aplus-tests spec/aplus-adapter
%else
%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
%endif
%files
%{!?_licensedir:%global license %doc}
%doc *.md examples/
%license LICENSE
%{nodejs_sitelib}/q
%changelog
* Sun Jul 24 2016 Jared Smith <jsmith@fedoraproject.org> - 1.4.1-1
- Update to upstream 1.4.1 release
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Mon Nov 03 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 1.0.1-1
- update to upstream release 1.0.1
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Sun Jul 28 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.9.6-2
- restrict to compatible arches
* Fri Jun 21 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.9.6-1
- update to upstream release 0.9.6
- add %%check and related BR
* Sun May 26 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.9.4-1
- update to upstream release 0.9.4
- upstream have now included a copy of the MIT license
* Fri Feb 22 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.8.12-2
- add a copy of the MIT license from upstream while waiting for the next release
* Wed Feb 13 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.8.12-1
- initial package