%global modname typeahead.js %if ! ( 0%{?fedora} || 0%{?rhel} >= 7 ) %{?nodejs_find_provides_and_requires} %global nodejs_arches %{ix86} x86_64 %{arm} %endif # tests are disabled since they require a browser or PhantomJS %bcond_with tests Name: nodejs-%{modname} Version: 0.10.5 Release: 1%{?dist} Summary: Autocomplete library for JavaScript License: MIT URL: http://twitter.github.com/typeahead.js Source0: http://registry.npmjs.org/%{modname}/-/%{modname}-%{version}.tgz BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch BuildRequires: nodejs-packaging BuildRequires: npm(semver) BuildRequires: npm(grunt-cli) BuildRequires: npm(grunt-contrib-uglify) BuildRequires: web-assets-devel Requires: js-%{modname} = %{version}-%{release} %if %{with tests} BuildRequires: npm(karma) BuildRequires: npm(mocha) %endif %description Inspired by twitter.com's autocomplete search functionality, typeahead.js is a flexible JavaScript library that provides a strong foundation for building robust typeaheads. The typeahead.js library consists of 2 components: the suggestion engine, Bloodhound, and the UI view, Typeahead. The suggestion engine is responsible for computing suggestions for a given query. The UI view is responsible for rendering suggestions and handling DOM interactions. Both components can be used separately, but when used together, they can provided a rich typeahead experience. %package -n js-%{modname} Summary: %{summary} Requires: web-assets-filesystem %description -n js-%{modname} Inspired by twitter.com's autocomplete search functionality, typeahead.js is a flexible JavaScript library that provides a strong foundation for building robust typeaheads. The typeahead.js library consists of 2 components: the suggestion engine, Bloodhound, and the UI view, Typeahead. The suggestion engine is responsible for computing suggestions for a given query. The UI view is responsible for rendering suggestions and handling DOM interactions. Both components can be used separately, but when used together, they can provided a rich typeahead experience. %prep %setup -q -n package # remove prebuilt files rm -r dist/ %build %nodejs_symlink_deps --check grunt build %if %{with tests} %check TEST_SUITE=unit test/ci %endif %install mkdir -p %{buildroot}%{_jsdir}/%{modname} cp -pr src/ dist/ %{buildroot}%{_jsdir}/%{modname}/ mkdir -p %{buildroot}%{nodejs_sitelib}/%{modname} cp -p package.json %{buildroot}%{nodejs_sitelib}/%{modname}/ ln -s %{_jsdir}/src %{_jsdir}/dist %{buildroot}%{nodejs_sitelib}/%{modname}/ %nodejs_symlink_deps %files %{nodejs_sitelib}/%{modname} %files -n js-%{modname} %doc README.md CHANGELOG.md LICENSE doc/* %{_jsdir}/%{modname} %changelog * Sun Oct 12 2014 Dan Callaghan - 0.10.5-1 - initial version