%global modname backbone %if ! ( 0%{?fedora} || 0%{?rhel} >= 7 ) %{?nodejs_find_provides_and_requires} %global nodejs_arches %{ix86} x86_64 %{arm} %endif # tests are disabled for now (need QUnit, runs in PhantomJS?) %bcond_with tests Name: nodejs-%{modname} Version: 1.1.2 Release: 2%{?dist} Summary: Models, Views, Collections, and Events for JavaScript applications (Nodejs module) License: MIT URL: http://backbonejs.org/ Source0: http://registry.npmjs.org/%{modname}/-/%{modname}-%{version}.tgz # git archive --format=tar --prefix=test/ 1.1.2:test/ | bzip2 >tests-1.1.2.tar.bz2 Source1: tests-%{version}.tar.bz2 BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch BuildRequires: nodejs-packaging BuildRequires: web-assets-devel BuildRequires: uglify-js Requires: js-%{modname} = %{version}-%{release} %if %{with tests} BuildRequires: nodejs BuildRequires: nodejs-qunit %endif %description Backbone supplies structure to JavaScript-heavy applications by providing models key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing application over a RESTful JSON interface. This package provides Backbone as a Nodejs module, for use in server-side applications or with browserify. %package -n js-%{modname} Summary: Models, Views, Collections and Events for JavaScript applications Requires: web-assets-filesystem %description -n js-%{modname} Backbone supplies structure to JavaScript-heavy applications by providing models key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing application over a RESTful JSON interface. %prep %setup -q -n package %setup -q -T -D -a 1 -n package rm backbone-min.{js,map} %build uglifyjs backbone.js -m --source-map backbone-min.map -o backbone-min.js %if %{with tests} %check %nodejs_symlink_deps --check # ? %endif %install mkdir -p %{buildroot}%{_jsdir}/%{modname} cp -p backbone.js backbone-min.js backbone-min.map %{buildroot}%{_jsdir}/%{modname}/ mkdir -p %{buildroot}%{nodejs_sitelib}/%{modname} cp -p backbone.js package.json %{buildroot}%{nodejs_sitelib}/%{modname}/ %nodejs_symlink_deps %files %{nodejs_sitelib}/%{modname} %files -n js-%{modname} %doc README.md LICENSE %{_jsdir}/%{modname} %changelog * Wed Nov 12 2014 Dan Callaghan - 1.1.2-2 - updated package summaries and descriptions * Sun Oct 12 2014 Dan Callaghan - 1.1.2-1 - initial version