%{?nodejs_find_provides_and_requires}
%global packagename boolbase
%global enable_tests 1
Name: nodejs-boolbase
Version: 1.0.0
Release: 3%{?dist}
Summary: Two functions: One that returns true, one that returns false
License: ISC
URL: https://github.com/fb55/boolbase
Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
# Tests from upstream github repo, using the master branch because nothing else
# has been tagged there yet
Source1: https://raw.githubusercontent.com/fb55/boolbase/master/tests.js
# npm tarball doesn't contain the license, so grab it from upstream as well
# it was added after the last NPM tarball release
Source2: https://raw.githubusercontent.com/fb55/boolbase/master/LICENSE
ExclusiveArch: %{nodejs_arches} noarch
BuildArch: noarch
BuildRequires: nodejs-packaging
%if 0%{?enable_tests}
BuildRequires: mocha
%endif
Requires: nodejs
%description
Two functions: One that returns true, one that returns false
%prep
%setup -q -n package
# setup the tests
cp -p %{SOURCE1} .
# copy the license
cp -p %{SOURCE2} .
%build
# nothing to do!
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
cp -pr package.json *.js \
%{buildroot}%{nodejs_sitelib}/%{packagename}
%nodejs_symlink_deps
%if 0%{?enable_tests}
%check
%{nodejs_symlink_deps} --check
%__nodejs tests.js
%endif
%files
%{!?_licensedir:%global license %doc}
%doc *.md
%license LICENSE
%{nodejs_sitelib}/%{packagename}
%changelog
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Mon Nov 02 2015 Jared Smith <jsmith@fedoraproject.org> - 1.0.0-2
- Add tests, even if they are overly simplistic
- Add the license from upstream github repo
* Wed Oct 14 2015 Jared Smith <jsmith@fedoraproject.org> - 1.0.0-1
- Initial packaging