# This macro is needed at the start for building on EL6 %{?nodejs_find_provides_and_requires} %global enable_tests 0 %global barename degenerator Name: nodejs-degenerator Version: 0.0.3 Release: 1%{?dist} Summary: Turns sync functions into async generator functions Group: Development/Libraries License: MIT URL: https://www.npmjs.org/package/degenerator Source0: http://registry.npmjs.org/%{barename}/-/%{barename}-%{version}.tgz BuildArch: noarch %if 0%{?fedora} >= 19 ExclusiveArch: %{nodejs_arches} noarch %else ExclusiveArch: %{ix86} x86_64 %{arm} noarch %endif BuildRequires: nodejs-packaging >= 6 BuildRequires: npm(ast-types) BuildRequires: npm(esprima) BuildRequires: npm(escodegen) Requires: npm(ast-types) Requires: npm(esprima) Requires: npm(escodegen) %if 0%{?enable_tests} BuildRequires: npm(mocha) %endif %description Sometimes you need to write sync looking code that's really async under the hood. This module takes a String to one or more synchronous JavaScript functions, and returns a new String that with those JS functions transpiled into ES6 Generator Functions. %prep %setup -q -n package # Remove bundled node_modules if there are any.. rm -rf node_modules/ %nodejs_fixdep esprima ~1.x %nodejs_fixdep ast-types ~0.x %nodejs_fixdep --caret %build %nodejs_symlink_deps --build %install mkdir -p %{buildroot}%{nodejs_sitelib}/degenerator cp -pr package.json index.js \ %{buildroot}%{nodejs_sitelib}/degenerator %nodejs_symlink_deps %check %if 0%{?enable_tests} %nodejs_symlink_deps --check mocha --reporter spec test/test.js %endif %files %doc README.md %{nodejs_sitelib}/degenerator/ %changelog * Tue Jul 22 2014 Ralph Bean - 0.0.3-1 - Initial packaging for Fedora.