Blob Blame History Raw
# This macro is needed at the start for building on EL6
%{?nodejs_find_provides_and_requires}
%global enable_tests 1

%global barename regenerator

%global commit0 f87d654f85c9925c4db3f74806f7615a71297f40
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})

Name:               nodejs-regenerator
Version:            0.8.42
Release:            2%{?dist}
Summary:            Source transformer enabling ECMAScript 6 generators

License:            BSD
URL:                https://www.npmjs.org/package/regenerator
Source0:            https://github.com/facebook/%{barename}/archive/%{commit0}.tar.gz#/%{barename}-%{shortcommit0}.tar.gz
BuildArch:          noarch
%if 0%{?fedora} >= 19
ExclusiveArch:      %{nodejs_arches} noarch
%else
ExclusiveArch:      %{ix86} x86_64 %{arm} noarch
%endif

BuildRequires:      nodejs-packaging >= 6

%if 0%{?enable_tests}
BuildRequires:      npm(commoner)
BuildRequires:      npm(defs)
BuildRequires:      npm(esprima-fb)
BuildRequires:      npm(mocha)
BuildRequires:      npm(recast)
BuildRequires:      npm(semver)
BuildRequires:      npm(through)
%endif


%description
This package implements a fully-functional source transformation that takes the
proposed syntax for generators/yield from future versions of JS (ECMAScript6 or
ES6, experimentally implemented in Node.js v0.11) and spits out efficient
JS-of-today (ES5) that behaves the same way.

%prep
%setup -qn %{barename}-%{commit0}

# Remove bundled node_modules if there are any..
rm -rf node_modules/

%nodejs_fixdep esprima-fb
%nodejs_fixdep recast
%nodejs_fixdep through '2.3.x'

%build

%install
mkdir -p %{buildroot}%{nodejs_sitelib}/regenerator
cp -pr package.json main.js runtime.js lib/ bin/ \
    %{buildroot}%{nodejs_sitelib}/regenerator

mkdir -p %{buildroot}%{_bindir}
ln -s %{nodejs_sitelib}/%{barename}/bin/regenerator %{buildroot}%{_bindir}/

%nodejs_symlink_deps

%check
%if 0%{?enable_tests}
%nodejs_symlink_deps --check
node test/run.js
%endif


%files
%doc README.md
%license LICENSE
%{_bindir}/regenerator
%{nodejs_sitelib}/regenerator/

%changelog
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.42-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Mon Feb 01 2016 Piotr Popieluch <piotr1212@gmail.com> - 0.8.42-1
- Update to 0.8.42

* Sat Oct 17 2015 Piotr Popieluch <piotr1212@gmail.com> - 0.8.41-1
- Update to 0.8.41

* Tue Sep 22 2015 Piotr Popieluch <piotr1212@gmail.com> - 0.8.39-1
- Update to 0.8.39

* Thu Sep 10 2015 Piotr Popieluch <piotr1212@gmail.com> - 0.8.36-2
- add missing runtime.js

* Tue Sep  8 2015 Piotr Popieluch <piotr1212@gmail.com> - 0.8.36-1
- Update to new version
- Enable tests
- Change source to github

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.9-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Wed Dec 24 2014 Parag Nemade <pnemade AT redhat.com> - 0.4.9-3
- Add missing regenerator binary

* Tue Jul 22 2014 Ralph Bean <rbean@redhat.com> - 0.4.9-2
- Initial packaging for Fedora.