%{?nodejs_find_provides_and_requires} %global packagename grunt-contrib-jshint %global enable_tests 1 Name: nodejs-grunt-contrib-jshint Version: 1.0.0 Release: 1%{?dist} Summary: Validate files with JSHint License: MIT URL: https://github.com/gruntjs/grunt-contrib-jshint Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz # Grab the Gruntfile.js file from upstream GitHub repo Source1: https://raw.githubusercontent.com/gruntjs/grunt-contrib-jshint/v%{version}/Gruntfile.js # Grab the .jshintrc file from upstream GitHub repo Source2: https://raw.githubusercontent.com/gruntjs/grunt-contrib-jshint/v%{version}/.jshintrc # Grab the .jshintignore file from upstream GitHub repo Source3: https://raw.githubusercontent.com/gruntjs/grunt-contrib-jshint/v%{version}/.jshintignore # Grab the license file from upstream GitHub repo Source4: https://raw.githubusercontent.com/gruntjs/grunt-contrib-jshint/v%{version}/LICENSE-MIT # The test files are not included in the npm tarball. # Source{5-6} is generated by running Source10, which pulls from the upstream # version control repository. Source5: tests-%{version}.tar.bz2 Source6: docs-%{version}.tar.bz2 Source10: dl-tests.sh # Patch to disable one failing test Patch0: nodejs-grunt-contrib-jshint_fix-tests.patch ExclusiveArch: %{nodejs_arches} noarch BuildArch: noarch BuildRequires: nodejs-packaging %if 0%{?enable_tests} BuildRequires: npm(chalk) BuildRequires: npm(grunt) BuildRequires: npm(grunt-cli) BuildRequires: npm(hooker) BuildRequires: npm(jshint) BuildRequires: npm(nodeunit) BuildRequires: npm(grunt-contrib-internal) BuildRequires: npm(grunt-contrib-nodeunit) %endif %description Validate files with JSHint %prep %setup -q -n package # copy the Gruntfile cp -p %{SOURCE1} . # copy the .jshintrc file cp -p %{SOURCE2} . # copy the .jshintignore file cp -p %{SOURCE3} . # copy the license file cp -p %{SOURCE4} . # setup the tests %setup -q -T -D -a 5 -n package # setup the docs %setup -q -T -D -a 6 -n package %patch0 -p1 %build # nothing to do! %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename} cp -pr package.json tasks/ \ %{buildroot}%{nodejs_sitelib}/%{packagename} %nodejs_symlink_deps %check %nodejs_symlink_deps --check %{__nodejs} -e 'require("./")' %if 0%{?enable_tests} ls -atlr node_modules/ %{_bindir}/nodeunit %else %{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m" %endif %files %{!?_licensedir:%global license %doc} %doc *.md docs/ %license LICENSE-MIT %{nodejs_sitelib}/%{packagename} %changelog * Mon Jul 04 2016 Jared Smith - 1.0.0-1 - Update to upstream 1.0.0 release * Thu Oct 22 2015 Jared Smith - 0.11.3-2 - Rebuilt to fix packaging dependencies and tests * Tue Oct 20 2015 Jared Smith - 0.11.3-1 - Initial packaging