%{?nodejs_find_provides_and_requires}
%global enable_tests 1
Name: nodejs-grunt-contrib-uglify
Version: 0.5.0
Release: 1%{?dist}
Summary: Minify files with UglifyJS
License: MIT
Group: System Environment/Libraries
URL: https://github.com/gruntjs/grunt-contrib-uglify
Source0: http://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-%{version}.tgz
# The test files are not included in the npm tarball.
# Source1 is generated by running Source10, which pulls from the upstream
# version control repository.
Source1: tests-v%{version}.tar.bz2
Source2: docs-v%{version}.tar.bz2
Source10: dl-tests.sh
# wget https://raw.githubusercontent.com/gruntjs/grunt-contrib-uglify/6f5563bfc4c29f12cd7c019fc4ede735322b1524/Gruntfile.js
Source20: Gruntfile-v%{version}.js
# The gzip feature of maxmin requires js-zlib, which cannot be packaged for
# fedora<20 or rhel<7 so we shall disable the use of this feature where
# needed.
Patch0: %{name}-0.4.0-Do-not-use-gzip-feature-of-maxmin.patch
BuildArch: noarch
%if 0%{?fedora} >= 19
ExclusiveArch: %{nodejs_arches} noarch
%else
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
%endif
BuildRequires: nodejs-packaging
BuildRequires: npm(grunt-cli)
BuildRequires: uglify-js
%if 0%{?enable_tests}
BuildRequires: npm(chalk)
BuildRequires: npm(maxmin)
BuildRequires: npm(grunt-contrib-clean)
BuildRequires: npm(grunt-contrib-internal)
BuildRequires: npm(grunt-contrib-nodeunit)
%endif
%description
%{summary}.
%prep
%setup -q -n package
%setup -q -T -D -a 1 -n package
%setup -q -T -D -a 2 -n package
%if 0%{?fedora} < 21 || 0%{?rhel} < 7
%patch0 -p1
%endif
cp -p %{SOURCE20} Gruntfile.js
%nodejs_fixdep maxmin '~0.2'
%nodejs_fixdep uglify-js '~2.4'
%build
#nothing to do
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/grunt-contrib-uglify
cp -pr package.json tasks/ \
%{buildroot}%{nodejs_sitelib}/grunt-contrib-uglify
%nodejs_symlink_deps
%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
/usr/bin/grunt test
%endif
%files
%doc LICENSE-MIT README.md docs/
%{nodejs_sitelib}/grunt-contrib-uglify
%changelog
* Sun Jun 29 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.5.0-1
- update to upstream release 0.5.0
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Thu May 08 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.4.0-3
- patch out use of maxmin where js-zlib cannot be packaged
* Wed Mar 19 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.4.0-2
- 'nodejs_fixdep uglify-js' required because our dependency handler doesn't yet
support the package.json '^' notation
* Wed Mar 12 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.4.0-1
- update to upstream release 0.4.0
* Mon Feb 24 2014 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.3.2-1
- update to upstream release 0.3.2
* Fri Jun 21 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.2.2-1
- initial package