[nodejs-grunt-contrib-uglify] Do not use gzip feature of maxmin on f20/f19/el6

Jamie Nguyen jamielinux at fedoraproject.org
Thu May 8 19:55:01 UTC 2014


commit 964a3e84c3ec5fd625db60e87a23cafb06231849
Author: Jamie Nguyen <j at jamielinux.com>
Date:   Thu May 8 20:54:09 2014 +0100

    Do not use gzip feature of maxmin on f20/f19/el6

 ...y-0.4.0-Do-not-use-gzip-feature-of-maxmin.patch |   25 ++++++++++++++++++++
 nodejs-grunt-contrib-uglify.spec                   |   15 +++++++++++-
 2 files changed, 39 insertions(+), 1 deletions(-)
---
diff --git a/nodejs-grunt-contrib-uglify-0.4.0-Do-not-use-gzip-feature-of-maxmin.patch b/nodejs-grunt-contrib-uglify-0.4.0-Do-not-use-gzip-feature-of-maxmin.patch
new file mode 100644
index 0000000..497c610
--- /dev/null
+++ b/nodejs-grunt-contrib-uglify-0.4.0-Do-not-use-gzip-feature-of-maxmin.patch
@@ -0,0 +1,25 @@
+From 61e329c76e6e229dd2460fb57aac4865f44acd43 Mon Sep 17 00:00:00 2001
+From: Jamie Nguyen <j at jamielinux.com>
+Date: Thu, 8 May 2014 18:50:26 +0100
+Subject: [PATCH] Do not use gzip feature of maxmin
+
+---
+ tasks/uglify.js | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tasks/uglify.js b/tasks/uglify.js
+index e31d9b8..50fcaa5 100644
+--- a/tasks/uglify.js
++++ b/tasks/uglify.js
+@@ -160,7 +160,7 @@ module.exports = function(grunt) {
+       }
+ 
+       grunt.log.writeln('File ' + chalk.cyan(f.dest) + ' created: ' +
+-                        maxmin(result.max, output, options.report === 'gzip'));
++                        maxmin(result.max, output, false));
+     });
+   });
+ };
+-- 
+1.9.0
+
diff --git a/nodejs-grunt-contrib-uglify.spec b/nodejs-grunt-contrib-uglify.spec
index 1cd6129..a81ef24 100644
--- a/nodejs-grunt-contrib-uglify.spec
+++ b/nodejs-grunt-contrib-uglify.spec
@@ -4,7 +4,7 @@
 
 Name:       nodejs-grunt-contrib-uglify
 Version:    0.4.0
-Release:    2%{?dist}
+Release:    3%{?dist}
 Summary:    Minify files with UglifyJS
 License:    MIT
 Group:      System Environment/Libraries
@@ -21,6 +21,10 @@ 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
+# 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.
+Patch1:     %{name}-0.4.0-Do-not-use-gzip-feature-of-maxmin.patch
 
 BuildArch:  noarch
 %if 0%{?fedora} >= 19
@@ -51,6 +55,11 @@ BuildRequires:  npm(grunt-contrib-nodeunit)
 %setup -q -T -D -a 1 -n package
 %setup -q -T -D -a 2 -n package
 %patch0 -p1
+
+%if 0%{?fedora} < 21 || 0%{?rhel} < 7
+%patch1 -p1
+%endif
+
 cp -p %{SOURCE20} Gruntfile.js
 
 %nodejs_fixdep uglify-js '~2.4'
@@ -71,6 +80,7 @@ cp -pr package.json tasks/ \
 %if 0%{?enable_tests}
 %check
 %nodejs_symlink_deps --check
+ln -sf %{nodejs_sitelib}/uglify-js node_modules/uglify-js
 /usr/bin/grunt test
 %endif
 
@@ -81,6 +91,9 @@ cp -pr package.json tasks/ \
 
 
 %changelog
+* Thu May 08 2014 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.4.0-3
+- patch out use of maxmin where js-zlib cannot be packaged
+
 * Wed Mar 19 2014 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.4.0-2
 - 'nodejs_fixdep uglify-js' required because our dependency handler doesn't yet
   support the package.json '^' notation


More information about the scm-commits mailing list