Blob Blame History Raw
# This macro is needed at the start for building on EL6
%{?nodejs_find_provides_and_requires}

%global enable_tests 0
%global prerelease dev
%global dangler -harmony

Name:               nodejs-esprima-harmony-jscs
Version:            1.1.0
Release:            0.5.%{prerelease}%{?dist}
Summary:            ECMAScript parsing infrastructure for multipurpose analysis

Group:              Development/Libraries
License:            BSD
URL:                https://www.npmjs.org/package/esprima-harmony-jscs
Source0:            http://registry.npmjs.org/esprima-harmony-jscs/-/esprima-harmony-jscs-%{version}-%{prerelease}%{dangler}.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(jslint)
BuildRequires:      npm(unicode-6.3.0)
BuildRequires:      npm(istanbul)
BuildRequires:      npm(regenerate)
BuildRequires:      npm(complexity-report)
BuildRequires:      npm(json-diff)
BuildRequires:      npm(eslint)
%endif


%description
Esprima is a high performance, standard-compliant ECMAScript parser written in
ECMAScript (also popularly known as JavaScript). Esprima is created and
maintained by Ariya Hidayat with the help of many contributors.

%prep
%setup -q -n package

# Remove bundled node_modules if there are any..
rm -rf node_modules/

%nodejs_fixdep --caret

%build
# This gives warnings when running the tests.
#%nodejs_symlink_deps --build

%install
mkdir -p %{buildroot}%{nodejs_sitelib}/esprima-harmony-jscs/
cp -pr package.json esprima.js bin/ \
    %{buildroot}%{nodejs_sitelib}/esprima-harmony-jscs/

mkdir -p %{buildroot}/%{_bindir}/
ln -s %{nodejs_sitelib}/esprima-harmony-jscs/bin/esparse.js %{buildroot}/%{_bindir}/esparse
ln -s %{nodejs_sitelib}/esprima-harmony-jscs/bin/esvalidate.js %{buildroot}/%{_bindir}/esvalidate

%nodejs_symlink_deps

%check
%if 0%{?enable_tests}
%nodejs_symlink_deps --check
node test/run.js
%endif


%files
%doc README.md
%{nodejs_sitelib}/esprima-harmony-jscs/
%{_bindir}/esparse
%{_bindir}/esvalidate

%changelog
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-0.5.dev
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-0.4.dev
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.0-0.3.dev
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Wed Feb 11 2015 Ralph Bean <rbean@redhat.com> - 1.1.0-0.2.dev
- Symlink binaries in from nodejs_sitelib.
- Commented out the --build statement as it gives warnings during the tests.
- Removed unused barename global.

* Tue Dec 02 2014 Ralph Bean <rbean@redhat.com> - 1.1.0-0.1.dev
- Initial packaging for Fedora.