Blob Blame History Raw
%global enable_tests 1
%global srcname async-cache

Name:           nodejs-%{srcname}
Version:        1.1.0
Release:        2%{?dist}
Summary:        Cache your async lookups and don't fetch the same thing more than necessary
License:        ISC
URL:            https://github.com/isaacs/async-cache
Source0:        https://registry.npmjs.org/%{srcname}/-/%{srcname}-%{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
ExclusiveArch:  %{nodejs_arches} noarch

BuildRequires:  nodejs-packaging

%if 0%{?enable_tests}
BuildRequires:  npm(tap)
BuildRequires:  npm(lru-cache)
%endif

%description
%{summary}.

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

rm -rf node_modules

%nodejs_fixdep lru-cache

%build
#nothing to do

%install
mkdir -p %{buildroot}%{nodejs_sitelib}/%{srcname}
cp -pr package.json ac.js %{buildroot}%{nodejs_sitelib}/%{srcname}

%nodejs_symlink_deps

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

%files
%doc README.md
%license LICENSE
%{nodejs_sitelib}/%{srcname}

%changelog
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Sat Nov 25 2017 Jared Smith <jsmith@fedoraproject.org> - 1.1.0-1
- Update to upstream 1.1.0 release
- Add files so that tests run correctly

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Sat Feb 13 2016 Jared Smith <jsmith@fedoraproject.org> - 1.0.0-4
- Relax version of npm(lru-cache)

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

* Sat Aug 29 2015 Piotr Popieluch <piotr1212@gmail.com> - 1.0.0-1
- Initial package