# This macro is needed at the start for building on EL6 %{?nodejs_find_provides_and_requires} %global enable_tests 0 %global barename es5-shim Name: nodejs-es5-shim Version: 4.0.3 Release: 1%{?dist} Summary: ECMAScript 5 compatibility shims for legacy JavaScript engines Group: Development/Libraries License: MIT URL: https://www.npmjs.org/package/es5-shim 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 %if 0%{?enable_tests} BuildRequires: npm(jscs) BuildRequires: npm(jasmine-node) BuildRequires: npm(uglify-js) %endif %description es5-shim.js and es5-shim.min.js monkey-patch a JavaScript context to contain all EcmaScript 5 methods that can be faithfully emulated with a legacy JavaScript engine. es5-sham.js and es5-sham.min.js monkey-patch other ES5 methods as closely as possible. For these methods, as closely as possible to ES5 is not very close. Many of these shams are intended only to allow code to be written to ES5 without causing run-time errors in older engines. In many cases, this means that these shams cause many ES5 methods to silently fail. Decide carefully whether this is what you want. Note: es5-sham.js requires es5-shim.js to be able to work properly. %prep %setup -q -n package # Remove bundled node_modules if there are any.. rm -rf node_modules/ %nodejs_fixdep --caret %build %nodejs_symlink_deps --build %install mkdir -p %{buildroot}%{nodejs_sitelib}/es5-shim cp -pr package.json es5-shim.js es5-sham.min.js es5-sham.js es5-shim.min.js \ %{buildroot}%{nodejs_sitelib}/es5-shim %nodejs_symlink_deps %check %if 0%{?enable_tests} %nodejs_symlink_deps --check npm run lint && jasmine-node --matchall ./ tests/spec/ %endif %files %doc LICENSE README.md %{nodejs_sitelib}/es5-shim/ %changelog * Mon Sep 15 2014 Ralph Bean - 4.0.3-1 - Initial packaging for Fedora.