diff options
author | Elan Ruusamäe | 2013-05-28 08:05:28 (GMT) |
---|---|---|
committer | Elan Ruusamäe | 2013-05-28 08:05:28 (GMT) |
commit | 54271861ab7d253ab3c8f88daa442b3ea25e55ae (patch) | |
tree | 2006bead72ac6d2f0cbab28963abed8d64060dc4 | |
parent | f6f5125eed3e03eb1367b0fff9f27bf74809169e (diff) | |
download | jquery-cookie-master.zip jquery-cookie-master.tar.gz |
minify with closure-compierHEADauto/th/jquery-cookie-1.2.0-1master
893 -> 858 bytes :D
-rw-r--r-- | jquery-cookie.spec | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/jquery-cookie.spec b/jquery-cookie.spec index 3133796..e871529 100644 --- a/jquery-cookie.spec +++ b/jquery-cookie.spec @@ -10,7 +10,7 @@ Source0: https://github.com/carhartl/jquery-cookie/archive/v%{version}.tar.gz URL: http://plugins.jquery.com/cookie/ BuildRequires: js BuildRequires: rpmbuild(macros) > 1.268 -BuildRequires: yuicompressor +BuildRequires: closure-compiler Requires: jquery >= 1.3 BuildArch: noarch BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -27,9 +27,15 @@ cookies. %build install -d build # compress .js -%{__sed} -e 's,/\*!,/*,' jquery.cookie.js > build/tmp.js -yuicompressor --charset UTF-8 build/tmp.js -o build/jquery.cookie.js -js -C -f build/jquery.cookie.js +for js in jquery.cookie.js; do + out=build/${js#*/jquery.} +%if 0%{!?debug:1} + closure-compiler --js $js --charset UTF-8 --js_output_file $out + js -C -f $out +%else + cp -p $js $out +%endif +done %install rm -rf $RPM_BUILD_ROOT |