# json-diff is not yet in Fedora %global enable_tests 1 %global module_name esprima-fb Name: nodejs-%{module_name} Version: 15001.1.0 Release: 8%{?dist} Summary: Facebook-specific fork of the esprima project License: BSD URL: https://github.com/facebook/esprima Source0: http://registry.npmjs.org/%{module_name}/-/%{module_name}-%{version}-dev-harmony-fb.tgz Source1: http://github.com/facebook/esprima/raw/master/LICENSE.BSD Source2: https://raw.githubusercontent.com/facebookarchive/esprima/fb-harmony/test/harmonytest.js Source3: https://raw.githubusercontent.com/facebookarchive/esprima/fb-harmony/test/fbtest.rec.js Source4: https://raw.githubusercontent.com/facebookarchive/esprima/fb-harmony/test/harmonymodulestest.js BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch BuildRequires: nodejs-packaging %if 0%{?enable_tests} BuildRequires: npm(json-diff) %endif Provides: npm(esprima-fb) = %{version} %description Esprima (esprima.org, BSD license) is a high performance, standard-compliant ECMAScript parser written in ECMAScript (also popularly known as JavaScript). Esprima-FB is a fork of the Harmony branch of Esprima that implements JSX specification on top of ECMAScript syntax. %prep %setup -q -n package cp -p %{SOURCE1} . cp -p %{SOURCE2} test/ cp -p %{SOURCE3} test/ cp -p %{SOURCE4} test/ rm -rf node_modules %build # nothing to build %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{module_name} cp -pr package.json *.js bin %{buildroot}%{nodejs_sitelib}/%{module_name} mkdir -p %{buildroot}%{_bindir} # We need to rename binaries as they conflict with npm(esprima) binaries ln -s %{nodejs_sitelib}/%{module_name}/bin/esparse.js %{buildroot}%{_bindir}/esparse-fb.js ln -s %{nodejs_sitelib}/%{module_name}/bin/esvalidate.js %{buildroot}%{_bindir}/esvalidate-fb.js %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} node test/run.js %endif %files %doc README.md %license LICENSE.BSD %{_bindir}/esparse-fb.js %{_bindir}/esvalidate-fb.js %{nodejs_sitelib}/%{module_name} %changelog * Sun Aug 20 2017 Jared Smith - 15001.1.0-8 - Enable tests, now that npm(json-diff) is in Fedora - Manually add proper "Provides" * Wed Jul 26 2017 Fedora Release Engineering - 15001.1.0-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Fri Feb 10 2017 Fedora Release Engineering - 15001.1.0-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Thu Feb 04 2016 Fedora Release Engineering - 15001.1.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Tue Jul 21 2015 Parag Nemade - 15001.1.0-4 - Fix conflicts with npm(esprima) binaries * Sat Jul 18 2015 Parag Nemade - 15001.1.0-3 - Use npmjs source as it provides only required source files * Tue Jul 14 2015 Parag Nemade - 15001.1.0-2 - Follow Git hosting source URL guidelines * Thu Jul 09 2015 Parag Nemade - 15001.1.0-1 - Initial packaging