Blob Blame History Raw
%{?nodejs_find_provides_and_requires}

%global packagename escope

# Tests disabled due to missing npm(gulp-babel), among other things
%global enable_tests 0

Name:		nodejs-escope
Version:	3.6.0
Release:	1%{?dist}
Summary:	ECMAScript scope analyzer

License:	BSD
URL:		https://github.com/estools/escope.git
Source0:	https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
# The test files are not included in the npm tarball.
# Source1 is generated by running Source10, which pulls from the upstream
# version control repository.
Source1:	tests-%{version}.tar.bz2
Source10:	dl-tests.sh


BuildArch:	noarch
%if 0%{?fedora} >= 19
ExclusiveArch: %{nodejs_arches} noarch
%else
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
%endif

BuildRequires:	nodejs-packaging
BuildRequires:	npm(es6-map)
BuildRequires:	npm(es6-weak-map)
BuildRequires:	npm(esrecurse)
%if 0%{?enable_tests}
BuildRequires:	mocha
BuildRequires:	npm(chai)
%endif

%description
ECMAScript scope analyzer


%prep
%setup -q -n package
# setup the tests
%setup -q -T -D -a 1 -n package



%build
# nothing to do (there would be if npm(babel) were in Fedora)

%install
mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
cp -pr package.json lib/ \
	%{buildroot}%{nodejs_sitelib}/%{packagename}

%nodejs_symlink_deps

%check
%nodejs_symlink_deps --check
%{__nodejs} -e 'require("./")'
%if 0%{?enable_tests}
%{_bindir}/gulp test
%else
%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"

%endif


%files
%{!?_licensedir:%global license %doc}
%doc *.md
%license LICENSE.BSD
%{nodejs_sitelib}/%{packagename}


%changelog
* Thu Jul 14 2016 Jared Smith <jsmith@fedoraproject.org> - 3.6.0-1
- Update to upstream 3.6.0 release

* Wed Feb 17 2016 Jared Smith <jsmith@fedoraproject.org> - 3.4.0-1
- Initial packaging