Blob Blame History Raw
%{?nodejs_find_provides_and_requires}

%global enable_tests 0

Name:       nodejs-grunt-contrib-uglify
Version:    0.4.0
Release:    2%{?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.github.com/gruntjs/grunt-contrib-uglify/eb7480384888e1e09113edd7591a47f244da79a3/Gruntfile.js
Source20:   Gruntfile-v%{version}.js

# One test failing which is also failing in the upstream Travis instance.
Patch0:     %{name}-0.4.0-Remove-failing-test.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
%patch0 -p1
cp -p %{SOURCE20} Gruntfile.js

%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
* 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