Jared K. Smith 2c454d3
%{?nodejs_find_provides_and_requires}
Jared K. Smith 2c454d3
Jared K. Smith 2c454d3
%global packagename esrecurse
Jared K. Smith 2c454d3
%global enable_tests 1
Jared K. Smith 2c454d3
Jared K. Smith 2c454d3
Name:		nodejs-esrecurse
Jared K. Smith 2c454d3
Version:	4.1.0
f9ef687
Release:	3%{?dist}
Jared K. Smith 2c454d3
Summary:	ECMAScript AST recursive visitor
Jared K. Smith 2c454d3
Jared K. Smith 2c454d3
License:	BSD
Jared K. Smith 2c454d3
URL:		https://github.com/estools/esrecurse.git
Jared K. Smith 2c454d3
Source0:	https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
Jared K. Smith 2c454d3
# The test files are not included in the npm tarball.
Jared K. Smith 2c454d3
# Source1 is generated by running Source10, which pulls from the upstream
Jared K. Smith 2c454d3
# version control repository.
Jared K. Smith 2c454d3
Source1:	tests-%{version}.tar.bz2
Jared K. Smith 2c454d3
Source10:	dl-tests.sh
Jared K. Smith 2c454d3
# Grab the README.md file, as it contains the license as well
Jared K. Smith 2c454d3
Source11:	https://raw.githubusercontent.com/estools/esrecurse/%{version}/README.md
Jared K. Smith 2c454d3
Jared K. Smith 2c454d3
Jared K. Smith 2c454d3
BuildArch:	noarch
Jared K. Smith 2c454d3
%if 0%{?fedora} >= 19
Jared K. Smith 2c454d3
ExclusiveArch: %{nodejs_arches} noarch
Jared K. Smith 2c454d3
%else
Jared K. Smith 2c454d3
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
Jared K. Smith 2c454d3
%endif
Jared K. Smith 2c454d3
Jared K. Smith 2c454d3
BuildRequires:	nodejs-packaging
Jared K. Smith 2c454d3
BuildRequires:	npm(estraverse)
Jared K. Smith 2c454d3
BuildRequires:	npm(object-assign)
Jared K. Smith 2c454d3
%if 0%{?enable_tests}
Jared K. Smith 2c454d3
BuildRequires:	coffee-script
Jared K. Smith 2c454d3
BuildRequires:	mocha
Jared K. Smith 2c454d3
BuildRequires:	npm(chai)
Jared K. Smith 2c454d3
%endif
Jared K. Smith 2c454d3
Jared K. Smith 2c454d3
%description
Jared K. Smith 2c454d3
ECMAScript AST recursive visitor
Jared K. Smith 2c454d3
Jared K. Smith 2c454d3
Jared K. Smith 2c454d3
%prep
Jared K. Smith 2c454d3
%setup -q -n package
Jared K. Smith 2c454d3
# setup the tests
Jared K. Smith 2c454d3
%setup -q -T -D -a 1 -n package
Jared K. Smith 2c454d3
# copy the README.md file
Jared K. Smith 2c454d3
cp -p %{SOURCE11} .
Jared K. Smith 2c454d3
# Extract the license from the README.md file
Jared K. Smith 2c454d3
sed '0,/### License/d' README.md > LICENSE.md
Jared K. Smith 2c454d3
Jared K. Smith 2c454d3
%nodejs_fixdep estraverse
Jared K. Smith 2c454d3
Jared K. Smith 2c454d3
%build
Jared K. Smith 2c454d3
# nothing to do!
Jared K. Smith 2c454d3
Jared K. Smith 2c454d3
%install
Jared K. Smith 2c454d3
mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
Jared K. Smith 2c454d3
cp -pr package.json esrecurse.js \
Jared K. Smith 2c454d3
	%{buildroot}%{nodejs_sitelib}/%{packagename}
Jared K. Smith 2c454d3
Jared K. Smith 2c454d3
%nodejs_symlink_deps
Jared K. Smith 2c454d3
Jared K. Smith 2c454d3
%check
Jared K. Smith 2c454d3
%nodejs_symlink_deps --check
Jared K. Smith 2c454d3
%{__nodejs} -e 'require("./")'
Jared K. Smith 2c454d3
%if 0%{?enable_tests}
Jared K. Smith 2c454d3
%{_bindir}/mocha -R spec --compilers coffee:coffee-script/register
Jared K. Smith 2c454d3
%else
Jared K. Smith 2c454d3
%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
Jared K. Smith 2c454d3
%endif
Jared K. Smith 2c454d3
Jared K. Smith 2c454d3
Jared K. Smith 2c454d3
%files
Jared K. Smith 2c454d3
%{!?_licensedir:%global license %doc}
Jared K. Smith 2c454d3
%doc README.md
Jared K. Smith 2c454d3
%license LICENSE.md
Jared K. Smith 2c454d3
%{nodejs_sitelib}/%{packagename}
Jared K. Smith 2c454d3
Jared K. Smith 2c454d3
Jared K. Smith 2c454d3
%changelog
f9ef687
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.0-3
f9ef687
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
f9ef687
Jared K. Smith 2c454d3
* Fri Aug 05 2016 Jared Smith <jsmith@fedoraproject.org> - 4.1.0-2
Jared K. Smith 2c454d3
- Make building the license file more robust
Jared K. Smith 2c454d3
Jared K. Smith 2c454d3
* Thu Jul 14 2016 Jared Smith <jsmith@fedoraproject.org> - 4.1.0-1
Jared K. Smith 2c454d3
- Update to upstream 4.1.0 release
Jared K. Smith 2c454d3
Jared K. Smith 2c454d3
* Wed Feb 17 2016 Jared Smith <jsmith@fedoraproject.org> - 4.0.0-1
Jared K. Smith 2c454d3
- Initial packaging