Blob Blame History Raw
%global commit b5de20331f9caf0b3d4e6d223ffea0bb7e3511f4
%global shortcommit %(c=%{commit}; echo ${c:0:7})

Name:           js-sizzle
Version:        1.10.19
Release:        4%{?dist}
Summary:        A pure-JavaScript CSS selector engine
BuildArch:      noarch

%global ver_x %(echo %{version} | cut -d. -f1)
%global ver_y %(echo %{version} | cut -d. -f2)
%global ver_z %(echo %{version} | cut -d. -f3)

License:        MIT     
URL:            http://sizzlejs.com/
Source0:        https://github.com/jquery/sizzle/archive/%{commit}/%{name}-%{commit}.tar.gz

# disable gzip-js during build
Patch1:         %{name}-disable-gzip-js.patch

BuildRequires:  web-assets-devel
BuildRequires:  nodejs-packaging

Provides:       %{name}-static = %{version}-%{release}

# for the benefit of those installing the review, will drop when importing
Obsoletes:      %{name}-source < %{version}

BuildRequires:  nodejs-grunt >= 0.4.4-3
BuildRequires:  npm(grunt-cli)
BuildRequires:  npm(grunt-contrib-uglify)
BuildRequires:  npm(load-grunt-tasks)

Requires:       web-assets-filesystem

%description
A pure-JavaScript CSS selector engine designed to be easily dropped in to a host
library.

%prep
%setup -qn sizzle-%{commit}
%patch1 -p1

#remove precompiled stuff
rm -rf dist/*


%build
%nodejs_symlink_deps --build
grunt -v compile uglify


# missing dependencies
#%%check
#grunt


%install
%global inslibdir %{buildroot}%{_jsdir}/sizzle

mkdir -p %{inslibdir}/%{version}
cp -p dist/* %{inslibdir}/%{version}

ln -s %{version} %{inslibdir}/latest
ln -s %{version} %{inslibdir}/%{ver_x}
ln -s %{version} %{inslibdir}/%{ver_x}.%{ver_y}

%files
%{_jsdir}/sizzle
%doc AUTHORS.txt CONTRIBUTING.md MIT-LICENSE.txt README.md


%changelog
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.10.19-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Tue Jun 03 2014 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1.10.19-3
- follow the github SourceURL guidelines

* Sat May 31 2014 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1.10.19-2
- drop sed hack now that grunt is fixed

* Fri May 30 2014 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1.10.19-1
- update to 1.10.19
- use system packages for build

* Wed Mar 19 2014 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1.10.16-0.1
- initial package