a54476b
# This macro is needed at the start for building on EL6
a54476b
%{?nodejs_find_provides_and_requires}
a54476b
a54476b
%global enable_tests 0
a54476b
a54476b
%global barename es5-shim
a54476b
a54476b
Name:               nodejs-es5-shim
1145954
Version:            4.1.0
ef1899f
Release:            4%{?dist}
a54476b
Summary:            ECMAScript 5 compatibility shims for legacy JavaScript engines
a54476b
a54476b
Group:              Development/Libraries
a54476b
License:            MIT
a54476b
URL:                https://www.npmjs.org/package/es5-shim
a54476b
Source0:            http://registry.npmjs.org/%{barename}/-/%{barename}-%{version}.tgz
a54476b
BuildArch:          noarch
a54476b
%if 0%{?fedora} >= 19
a54476b
ExclusiveArch:      %{nodejs_arches} noarch
a54476b
%else
a54476b
ExclusiveArch:      %{ix86} x86_64 %{arm} noarch
a54476b
%endif
a54476b
a54476b
BuildRequires:      nodejs-packaging >= 6
a54476b
BuildRequires:      npm
a54476b
BuildRequires:      npm(uglify-js)
a54476b
a54476b
%if 0%{?enable_tests}
a54476b
BuildRequires:      npm(jscs)
a54476b
BuildRequires:      npm(jasmine-node)
a54476b
%endif
a54476b
a54476b
%description
a54476b
es5-shim.js and es5-shim.min.js monkey-patch a JavaScript context to contain
a54476b
all EcmaScript 5 methods that can be faithfully emulated with a legacy
a54476b
JavaScript engine.
a54476b
a54476b
es5-sham.js and es5-sham.min.js monkey-patch other ES5 methods as closely as
a54476b
possible. For these methods, as closely as possible to ES5 is not very close.
a54476b
Many of these shams are intended only to allow code to be written to ES5
a54476b
without causing run-time errors in older engines. In many cases, this means
a54476b
that these shams cause many ES5 methods to silently fail. Decide carefully
a54476b
whether this is what you want. Note: es5-sham.js requires es5-shim.js to be
a54476b
able to work properly.
a54476b
a54476b
%prep
a54476b
%setup -q -n package
a54476b
a54476b
# Remove bundled node_modules if there are any..
a54476b
rm -rf node_modules/
a54476b
a54476b
%nodejs_fixdep --caret
a54476b
a54476b
%build
a54476b
%nodejs_symlink_deps --build
a54476b
a54476b
npm run minify
a54476b
a54476b
%install
a54476b
mkdir -p %{buildroot}%{nodejs_sitelib}/es5-shim
a54476b
cp -pr package.json es5-shim.js es5-sham.min.js es5-sham.js es5-shim.min.js \
a54476b
    %{buildroot}%{nodejs_sitelib}/es5-shim
a54476b
a54476b
%nodejs_symlink_deps
a54476b
a54476b
%check
a54476b
%if 0%{?enable_tests}
a54476b
%nodejs_symlink_deps --check
a54476b
npm run lint && jasmine-node --matchall ./ tests/spec/
a54476b
%endif
a54476b
a54476b
%files
a54476b
%doc LICENSE README.md
a54476b
%{nodejs_sitelib}/es5-shim/
a54476b
a54476b
%changelog
ef1899f
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.0-4
ef1899f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
ef1899f
1512f67
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.0-3
1512f67
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
1512f67
cee68a2
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1.0-2
cee68a2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
cee68a2
1145954
* Wed Feb 18 2015 Ralph Bean <rbean@redhat.com> - 4.1.0-1
1145954
- new version
1145954
a54476b
* Mon Sep 15 2014 Ralph Bean <rbean@redhat.com> - 4.0.3-2
a54476b
- Run minify/uglify step in the build section as per review request.
a54476b
- Added BR on uglify-js.
a54476b
a54476b
* Mon Sep 15 2014 Ralph Bean <rbean@redhat.com> - 4.0.3-1
a54476b
- Initial packaging for Fedora.