# This macro is needed at the start for building on EL6 %{?nodejs_find_provides_and_requires} %global enable_tests 0 %global barename defs Name: nodejs-defs Version: 1.0.0 Release: 1%{?dist} Summary: Static scope analysis and transpilation Group: Development/Libraries License: MIT URL: https://www.npmjs.org/package/defs 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(breakable) BuildRequires: npm(simple-fmt) BuildRequires: npm(simple-is) BuildRequires: npm(tryor) BuildRequires: npm(ast-traverse) BuildRequires: npm(esprima) BuildRequires: npm(stringset) BuildRequires: npm(alter) BuildRequires: npm(stringmap) BuildRequires: npm(yargs) Requires: npm(breakable) Requires: npm(simple-fmt) Requires: npm(simple-is) Requires: npm(tryor) Requires: npm(ast-traverse) Requires: npm(esprima) Requires: npm(stringset) Requires: npm(alter) Requires: npm(stringmap) Requires: npm(yargs) %if 0%{?enable_tests} BuildRequires: npm(diff) %endif %description Static scope analysis and transpilation of ES6 block scoped const and let variables, to ES3 Node already supports `const` and `let` so you can use that today (run `node --harmony` and `"use strict"`). `defs.js` enables you to do the same for browser code. While developing you can rely on the experimental support in Chrome (chrome://flags, check Enable experimental JavaScript). `defs.js` is also a pretty decent static scope analyzer/linter. %prep %setup -q -n package # Remove bundled node_modules if there are any.. rm -rf node_modules/ %nodejs_fixdep esprima ~1.x %nodejs_fixdep --caret %build %nodejs_symlink_deps --build %install mkdir -p %{buildroot}%{nodejs_sitelib}/defs cp -pr package.json defs-cmd.js options.js defs-main.js run-tests.js scope.js stats.js error.js \ %{buildroot}%{nodejs_sitelib}/defs %nodejs_symlink_deps %check %if 0%{?enable_tests} %nodejs_symlink_deps --check node --harmony run-tests %endif %files %doc README.md LICENSE %{nodejs_sitelib}/defs/ %changelog * Tue Jul 22 2014 Ralph Bean - 1.0.0-1 - Initial packaging for Fedora.