# THIS PACKAGE IS NOT READY FOR FEDORA. # It uses npm to install its build dependencies. # It will not build in koji since this requires access to registry.npmjs.org. %global insdirname sizzle %global ver_x 1 %global ver_y 10 %global ver_z 16 Name: js-sizzle Version: %{ver_x}.%{ver_y}.%{ver_z} Release: 0.1%{?dist} Summary: A pure-JavaScript CSS selector engine BuildArch: noarch License: MIT URL: http://sizzlejs.com/ Source0: https://github.com/jquery/sizzle/archive/%{version}/%{name}-%{version}.tar.gz BuildRequires: web-assets-devel BuildRequires: nodejs-packaging Provides: %{name}-static #we're going to do this for now BuildRequires: npm #instead of this... #BuildRequires: npm(grunt) #BuildRequires: npm(grunt-cli) #BuildRequires: npm(grunt-contrib-qunit) #BuildRequires: npm(grunt-contrib-uglify) #BuildRequires: npm(grunt-contrib-watch) #BuildRequires: npm(grunt-compare-size) #BuildRequires: npm(grunt-git-authors) #BuildRequires: npm(grunt-jsonlint) #BuildRequires: npm(grunt-bowercopy) #BuildRequires: npm(grunt-jscs-checker) #BuildRequires: npm(gzip-js) #BuildRequires: npm(load-grunt-tasks) #BuildRequires: npm(testswarm) Requires: web-assets-filesystem %description A pure-JavaScript CSS selector engine designed to be easily dropped in to a host library. # jQuery is um, special %package source Summary: A pure-JavaScript CSS selector engine - source code Requires: %{name} = %{version}-%{release} # this is sort-of implied by the whole nature of this package but we do this so # the magic that will track this in the future will still be triggered Provides: js-sizzle-source-static %description source The source code for Sizzle, needed only to build jQuery and other DOM libraries that use it. %prep %setup -qn sizzle-%{version} #remove precompiled stuff rm -f dist/* #do not use the nonfree jshint library %nodejs_fixdep --dev -r grunt-contrib-jshint #look ma, I cheated! npm install %build #--force is neccessary to bypass jshint ./node_modules/.bin/grunt --force #%%check #tests run as part of build process %install %global inslibdir %{buildroot}%{_jsdir}/%{insdirname} %global inssrcdir %{buildroot}%{_prefix}/src/%{insdirname} 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} ln -s %{version}/sizzle.js %{inslibdir}/sizzle.js ln -s %{version}/sizzle.min.js %{inslibdir}/sizzle.min.js #install the source #when there isn't a big dumb node_modules folder in here we can just cp * mkdir -p %{inssrcdir}/%{version} shopt -s extglob cp -pr !(node_modules) %{inssrcdir}/%{version} ln -s %{version} %{inssrcdir}/latest ln -s %{version} %{inssrcdir}/%{ver_x} ln -s %{version} %{inssrcdir}/%{ver_x}.%{ver_y} %files %{_jsdir}/%{insdirname} %doc AUTHORS.txt MIT-LICENSE.txt README.md %files source %{_prefix}/src/%{insdirname} %changelog * Wed Mar 19 2014 T.C. Hollingsworth - 1.10.16-0.1 - initial package