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

# babel-core not in Fedora
%global enable_tests 0

%global barename ast-types

%global commit0 c9d0ca55da8fadef0fefcce1dcdc0859e9e8bb94
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})

Name:               nodejs-ast-types
Version:            0.8.13
Release:            2%{?dist}
Summary:            Esprima-compatible implementation of the Mozilla JS Parser API

License:            MIT
URL:                https://www.npmjs.org/package/ast-types
Source0:            https://github.com/benjamn/%{barename}/archive/%{commit0}.tar.gz#/%{barename}-%{shortcommit0}.tar.gz
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(esprima)
BuildRequires:      npm(babel-core)
BuildRequires:      npm(esprima-fb)
BuildRequires:      npm(mocha)
%endif


%description
This module provides an efficient, modular, Esprima-compatible implementation
of the abstract syntax tree type hierarchy pioneered by the Mozilla Parser API.

%prep
%setup -qn %{barename}-%{commit0}

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

%nodejs_fixdep --caret

%build

%install
mkdir -p %{buildroot}%{nodejs_sitelib}/ast-types
cp -pr package.json main.js lib/ def/ \
    %{buildroot}%{nodejs_sitelib}/ast-types

%nodejs_symlink_deps


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


%files
%doc README.md
%license LICENSE
%{nodejs_sitelib}/ast-types/

%changelog
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.13-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Sat Oct 17 2015 Piotr Popieluch <piotr1212@gmail.com> - 0.8.13-1
- Update to 0.8.13

* Sat Sep  5 2015 Piotr Popieluch <piotr1212@gmail.com> - 0.7.6-3
- Add missing def dir (RHBZ#1260268)
- Change Source to github which includes tests
- Move licsense to license tag

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

* Thu May 14 2015 Ralph Bean <rbean@redhat.com> - 0.7.6-1
- new version

* Wed Feb 25 2015 Ralph Bean <rbean@redhat.com> - 0.6.15-1
- new version

* Fri Feb 20 2015 Ralph Bean <rbean@redhat.com> - 0.6.14-1
- new version

* Tue Jul 22 2014 Ralph Bean <rbean@redhat.com> - 0.4.5-1
- Initial packaging for Fedora.