Blob Blame History Raw
%{?nodejs_find_provides_and_requires}

%global packagename array-index
%global enable_tests 1

Name:		nodejs-array-index
Version:	0.2.0
Release:	4%{?dist}
Summary:	Invoke getter/setter functions on array-like objects

License:	MIT
# License text is at bottom of README.md
URL:		https://github.com/TooTallNate/array-index.git
Source0:	https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz

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

BuildRequires:	nodejs-packaging
%if 0%{?enable_tests}
BuildRequires:	grep
BuildRequires:	npm(debug)
%endif

%description
Invoke getter/setter functions on array-like objects


%prep
%setup -q -n package

# Create separate license file from the license information at the bottom of
# the README.md file
grep -A100 '^License$' README.md > LICENSE.md

%build
# nothing to do!

%install
mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
cp -pr *.json index.js \
	%{buildroot}%{nodejs_sitelib}/%{packagename}

%nodejs_symlink_deps

%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
%{__nodejs} -e 'require("./")'
%{__nodejs} test.js
%endif


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



%changelog
* Fri Dec 18 2015 Jared Smith <jsmith@fedoraproject.org> - 0.2.0-4
- Use grep from the PATH, because grep is not in the bindir on EL6

* Thu Dec 17 2015 Jared Smith <jsmith@fedoraproject.org> - 0.2.0-3
- Add build dependency on grep

* Wed Dec 16 2015 Jared Smith <jsmith@fedoraproject.org> - 0.2.0-2
- Initial packaging