Author: gilbert-guest Date: 2009-12-30 23:11:14 +0000 (Wed, 30 Dec 2009) New Revision: 11322
Added: trunk/yuicompressor/debian/README.source trunk/yuicompressor/debian/bin/ trunk/yuicompressor/debian/bin/yui-compressor trunk/yuicompressor/debian/fetch-upstream trunk/yuicompressor/debian/patches/ trunk/yuicompressor/debian/patches/decompiler.patch trunk/yuicompressor/debian/patches/parser.patch trunk/yuicompressor/debian/patches/series trunk/yuicompressor/debian/patches/token.patch trunk/yuicompressor/debian/patches/tokenstream.patch trunk/yuicompressor/debian/patches/use-system-libraries.patch trunk/yuicompressor/debian/yui-compressor.1.xml trunk/yuicompressor/debian/yui-compressor.install Removed: trunk/yuicompressor/debian/orig-tar.exclude trunk/yuicompressor/debian/orig-tar.sh Modified: trunk/yuicompressor/debian/changelog trunk/yuicompressor/debian/control trunk/yuicompressor/debian/rules Log: updates to yui-compressor (should now be ready for upload to unstable) Added: trunk/yuicompressor/debian/README.source =================================================================== --- trunk/yuicompressor/debian/README.source (rev 0) +++ trunk/yuicompressor/debian/README.source 2009-12-30 23:11:14 UTC (rev 11322) @@ -0,0 +1,2 @@ +this package uses quilt for its patch system, see: +/usr/share/doc/quilt/README.source Added: trunk/yuicompressor/debian/bin/yui-compressor =================================================================== --- trunk/yuicompressor/debian/bin/yui-compressor (rev 0) +++ trunk/yuicompressor/debian/bin/yui-compressor 2009-12-30 23:11:14 UTC (rev 11322) @@ -0,0 +1,2 @@ +#!/bin/sh +java -jar /usr/share/yui-compressor/yui-compressor.jar $@ Modified: trunk/yuicompressor/debian/changelog =================================================================== --- trunk/yuicompressor/debian/changelog 2009-12-30 22:21:50 UTC (rev 11321) +++ trunk/yuicompressor/debian/changelog 2009-12-30 23:11:14 UTC (rev 11322) @@ -1,4 +1,4 @@ -yuicompressor (2.4.2-1) UNRELEASED; urgency=low +yui-compressor (2.4.2-1) UNRELEASED; urgency=low [ Dominik Smatana ] * Initial release (closes: #519938) @@ -11,4 +11,13 @@ [ Release jar needs a rule set to minimize classpath conflicts when used in a build environment that has Rhino ] + [ Michael Gilbert ] + * Download the required rhino source files in the orig tarball + fetching script. + * Add patches for build file to use system rhino and jargs libraries. + * Apply yui-compressor patches to the included rhino source. + * Add a README.source to describe the patch system. + * Add a launcher shell script. + * Add a manpage for the shell script. + -- Damien Raude-Morvan <draz...@debian.org> Mon, 09 Nov 2009 23:36:47 +0100 Modified: trunk/yuicompressor/debian/control =================================================================== --- trunk/yuicompressor/debian/control 2009-12-30 22:21:50 UTC (rev 11321) +++ trunk/yuicompressor/debian/control 2009-12-30 23:11:14 UTC (rev 11322) @@ -1,18 +1,18 @@ -Source: yuicompressor +Source: yui-compressor Section: java Priority: optional Maintainer: Debian Java Maintainers <pkg-java-maintainers@lists.alioth.debian.org> -Uploaders: Dominik Smatana <dominik.smat...@gmail.com>, Damien Raude-Morvan <draz...@debian.org> -Build-Depends: cdbs, debhelper (>= 7), default-jdk, ant -Build-Depends-Indep: libjargs-java +Uploaders: Dominik Smatana <dominik.smat...@gmail.com> , Damien Raude-Morvan <draz...@debian.org> , Michael Gilbert <michael.s.gilb...@gmail.com> +Build-Depends: cdbs , debhelper (>= 7) , default-jdk , ant , quilt , docbook2x +Build-Depends-Indep: libjargs-java , rhino (>= 1.7R2) , rhino (<< 1.7R3) Homepage: http://developer.yahoo.com/yui/compressor/ Vcs-Svn: svn://svn.debian.org/svn/pkg-java/trunk/yuicompressor/ Vcs-Browser: http://svn.debian.org/wsvn/pkg-java/trunk/yuicompressor/ Standards-Version: 3.8.3 -Package: yuicompressor +Package: yui-compressor Architecture: all -Depends: default-jre-headless, libjargs-java +Depends: ${misc:Depends} Description: YUI Compressor is JavaScript/CSS minifier The YUI Compressor is a JavaScript compressor which, in addition to removing comments and white-spaces, obfuscates local variables using the smallest @@ -22,4 +22,3 @@ . The YUI Compressor is also able to safely compress CSS files. The decision on which compressor is being used is made on the file extension (js or css). - Added: trunk/yuicompressor/debian/fetch-upstream =================================================================== --- trunk/yuicompressor/debian/fetch-upstream (rev 0) +++ trunk/yuicompressor/debian/fetch-upstream 2009-12-30 23:11:14 UTC (rev 11322) @@ -0,0 +1,37 @@ +#!/bin/sh +set -e + +echo $# +if test "$#" != "2" ; then + echo "usage: $0 <upstream version number> <rhino library version number>" + exit 1 +fi +version="$1" +rhino_version="$2" +curdir="$PWD" + +# download +cd /tmp +wget -N http://yuilibrary.com/downloads/yuicompressor/yuicompressor-$version.zip +unzip -xq yuicompressor-$version.zip +rm yuicompressor-$version.zip + +# cleanup +rm -rf yuicompressor-$version/build +rm -rf yuicompressor-$version/lib +rm -rf yuicompressor-$version/src/org/mozilla/javascript/* + +# download rhino source +apt-get source rhino=$rhino_version +rhino_version="$(echo $rhino_version | cut -d - -f 1)" +cp rhino-$rhino_version/src/org/mozilla/javascript/Decompiler.java yuicompressor-$version/src/org/mozilla/javascript +cp rhino-$rhino_version/src/org/mozilla/javascript/Parser.java yuicompressor-$version/src/org/mozilla/javascript +cp rhino-$rhino_version/src/org/mozilla/javascript/Token.java yuicompressor-$version/src/org/mozilla/javascript +cp rhino-$rhino_version/src/org/mozilla/javascript/TokenStream.java yuicompressor-$version/src/org/mozilla/javascript + +# repack +mv yuicompressor-$version yui-compressor-$version +tar czf yui-compressor_$version.orig.tar.gz yui-compressor-$version +rm -rf yui-compressor-$version +mv yui-compressor_$version.orig.tar.gz $curdir +echo "Done: successfully created yui-compressor_$version.orig.tar.gz." Deleted: trunk/yuicompressor/debian/orig-tar.exclude =================================================================== --- trunk/yuicompressor/debian/orig-tar.exclude 2009-12-30 22:21:50 UTC (rev 11321) +++ trunk/yuicompressor/debian/orig-tar.exclude 2009-12-30 23:11:14 UTC (rev 11322) @@ -1 +0,0 @@ -*.jar Deleted: trunk/yuicompressor/debian/orig-tar.sh =================================================================== --- trunk/yuicompressor/debian/orig-tar.sh 2009-12-30 22:21:50 UTC (rev 11321) +++ trunk/yuicompressor/debian/orig-tar.sh 2009-12-30 23:11:14 UTC (rev 11322) @@ -1,19 +0,0 @@ -#!/bin/sh -e - -# $2 = version -# $3 = file -DIR=yuicompressor-$2.orig -TAR=yuicompressor_$2.orig.tar.gz - -# clean up the upstream tarball -unzip $3 -mv yuicompressor-$2 $DIR -GZIP=--best tar czf $TAR -X debian/orig-tar.exclude $DIR -rm -rf $DIR - -# move to directory 'tarballs' -if [ -r .svn/deb-layout ]; then - . .svn/deb-layout - mv $TAR $origDir - echo "moved $TAR to $origDir" -fi Added: trunk/yuicompressor/debian/patches/decompiler.patch =================================================================== --- trunk/yuicompressor/debian/patches/decompiler.patch (rev 0) +++ trunk/yuicompressor/debian/patches/decompiler.patch 2009-12-30 23:11:14 UTC (rev 11322) @@ -0,0 +1,21 @@ +--- a/src/org/mozilla/javascript/Decompiler.java.orig 2008-11-14 10:13:36.000000000 -0500 ++++ b/src/org/mozilla/javascript/Decompiler.java 2008-11-14 10:13:36.000000000 -0500 +@@ -166,6 +166,18 @@ + appendString('/' + regexp + '/' + flags); + } + ++ void addJScriptConditionalComment(String str) ++ { ++ addToken(Token.CONDCOMMENT); ++ appendString(str); ++ } ++ ++ void addPreservedComment(String str) ++ { ++ addToken(Token.KEEPCOMMENT); ++ appendString(str); ++ } ++ + void addNumber(double n) + { + addToken(Token.NUMBER); Added: trunk/yuicompressor/debian/patches/parser.patch =================================================================== --- trunk/yuicompressor/debian/patches/parser.patch (rev 0) +++ trunk/yuicompressor/debian/patches/parser.patch 2009-12-30 23:11:14 UTC (rev 11322) @@ -0,0 +1,35 @@ +--- a/src/org/mozilla/javascript/Parser.java 2008-11-14 10:13:36.000000000 -0500 ++++ b/src/org/mozilla/javascript/Parser.java 2008-11-14 10:13:36.000000000 -0500 +@@ -163,11 +163,30 @@ + { + int tt = currentFlaggedToken; + if (tt == Token.EOF) { +- tt = ts.getToken(); ++ ++ while ((tt = ts.getToken()) == Token.CONDCOMMENT || tt == Token.KEEPCOMMENT) { ++ if (tt == Token.CONDCOMMENT) { ++ /* Support for JScript conditional comments */ ++ decompiler.addJScriptConditionalComment(ts.getString()); ++ } else { ++ /* Support for preserved comments */ ++ decompiler.addPreservedComment(ts.getString()); ++ } ++ } ++ + if (tt == Token.EOL) { + do { + tt = ts.getToken(); +- } while (tt == Token.EOL); ++ ++ if (tt == Token.CONDCOMMENT) { ++ /* Support for JScript conditional comments */ ++ decompiler.addJScriptConditionalComment(ts.getString()); ++ } else if (tt == Token.KEEPCOMMENT) { ++ /* Support for preserved comments */ ++ decompiler.addPreservedComment(ts.getString()); ++ } ++ ++ } while (tt == Token.EOL || tt == Token.CONDCOMMENT || tt == Token.KEEPCOMMENT); + tt |= TI_AFTER_EOL; + } + currentFlaggedToken = tt; Added: trunk/yuicompressor/debian/patches/series =================================================================== --- trunk/yuicompressor/debian/patches/series (rev 0) +++ trunk/yuicompressor/debian/patches/series 2009-12-30 23:11:14 UTC (rev 11322) @@ -0,0 +1,5 @@ +use-system-libraries.patch +decompiler.patch +parser.patch +token.patch +tokenstream.patch Added: trunk/yuicompressor/debian/patches/token.patch =================================================================== --- trunk/yuicompressor/debian/patches/token.patch (rev 0) +++ trunk/yuicompressor/debian/patches/token.patch 2009-12-30 23:11:14 UTC (rev 11322) @@ -0,0 +1,15 @@ +--- a/src/org/mozilla/javascript/Token.java.orig 2009-12-25 00:39:07.000000000 -0500 ++++ b/src/org/mozilla/javascript/Token.java 2009-12-25 00:39:39.000000000 -0500 +@@ -258,7 +258,11 @@ + LETEXPR = 157, + WITHEXPR = 158, + DEBUGGER = 159, +- LAST_TOKEN = 159; ++ ++ CONDCOMMENT = 160, ++ KEEPCOMMENT = 161, ++ ++ LAST_TOKEN = 162; + + public static String name(int token) + { Added: trunk/yuicompressor/debian/patches/tokenstream.patch =================================================================== --- trunk/yuicompressor/debian/patches/tokenstream.patch (rev 0) +++ trunk/yuicompressor/debian/patches/tokenstream.patch 2009-12-30 23:11:14 UTC (rev 11322) @@ -0,0 +1,172 @@ +--- a/src/org/mozilla/javascript/TokenStream.java.orig 2009-12-25 00:40:57.000000000 -0500 ++++ b/src/org/mozilla/javascript/TokenStream.java 2009-12-25 00:41:26.000000000 -0500 +@@ -526,7 +526,7 @@ + stringBufferTop = 0; + + c = getChar(); +- strLoop: while (c != quoteChar) { ++ while (c != quoteChar) { + if (c == '\n' || c == EOF_CHAR) { + ungetChar(c); + parser.addError("msg.unterminated.string.lit"); +@@ -535,89 +535,47 @@ + + if (c == '\\') { + // We've hit an escaped character +- int escapeVal; + + c = getChar(); ++ + switch (c) { +- case 'b': c = '\b'; break; +- case 'f': c = '\f'; break; +- case 'n': c = '\n'; break; +- case 'r': c = '\r'; break; +- case 't': c = '\t'; break; +- +- // \v a late addition to the ECMA spec, +- // it is not in Java, so use 0xb +- case 'v': c = 0xb; break; +- +- case 'u': +- // Get 4 hex digits; if the u escape is not +- // followed by 4 hex digits, use 'u' + the +- // literal character sequence that follows. +- int escapeStart = stringBufferTop; +- addToString('u'); +- escapeVal = 0; +- for (int i = 0; i != 4; ++i) { +- c = getChar(); +- escapeVal = Kit.xDigitToInt(c, escapeVal); +- if (escapeVal < 0) { +- continue strLoop; +- } +- addToString(c); +- } +- // prepare for replace of stored 'u' sequence +- // by escape value +- stringBufferTop = escapeStart; +- c = escapeVal; +- break; +- case 'x': +- // Get 2 hex digits, defaulting to 'x'+literal +- // sequence, as above. +- c = getChar(); +- escapeVal = Kit.xDigitToInt(c, 0); +- if (escapeVal < 0) { +- addToString('x'); +- continue strLoop; +- } else { +- int c1 = c; +- c = getChar(); +- escapeVal = Kit.xDigitToInt(c, escapeVal); +- if (escapeVal < 0) { +- addToString('x'); +- addToString(c1); +- continue strLoop; +- } else { +- // got 2 hex digits +- c = escapeVal; +- } +- } +- break; + +- case '\n': +- // Remove line terminator after escape to follow +- // SpiderMonkey and C/C++ +- c = getChar(); +- continue strLoop; ++ case '\\': // backslash ++ case 'b': // backspace ++ case 'f': // form feed ++ case 'n': // line feed ++ case 'r': // carriage return ++ case 't': // horizontal tab ++ case 'v': // vertical tab ++ case 'd': // octal sequence ++ case 'u': // unicode sequence ++ case 'x': // hexadecimal sequence ++ // Only keep the '\' character for those ++ // characters that need to be escaped... ++ // Don't escape quoting characters... ++ addToString('\\'); ++ addToString(c); ++ break; + +- default: +- if ('0' <= c && c < '8') { +- int val = c - '0'; +- c = getChar(); +- if ('0' <= c && c < '8') { +- val = 8 * val + c - '0'; +- c = getChar(); +- if ('0' <= c && c < '8' && val <= 037) { +- // c is 3rd char of octal sequence only +- // if the resulting val <= 0377 +- val = 8 * val + c - '0'; +- c = getChar(); +- } ++ case '\n': ++ // Remove line terminator after escape ++ break; ++ ++ default: ++ if (isDigit(c)) { ++ // Octal representation of a character. ++ // Preserve the escaping (see Y! bug #1637286) ++ addToString('\\'); + } +- ungetChar(c); +- c = val; +- } ++ addToString(c); ++ break; + } ++ ++ } else { ++ ++ addToString(c); + } +- addToString(c); ++ + c = getChar(); + } + +@@ -760,16 +718,35 @@ + } + if (matchChar('*')) { + boolean lookForSlash = false; ++ StringBuffer sb = new StringBuffer(); + for (;;) { + c = getChar(); + if (c == EOF_CHAR) { + parser.addError("msg.unterminated.comment"); + return Token.ERROR; +- } else if (c == '*') { ++ } ++ sb.append((char) c); ++ if (c == '*') { + lookForSlash = true; + } else if (c == '/') { + if (lookForSlash) { +- continue retry; ++ sb.delete(sb.length()-2, sb.length()); ++ String s1 = sb.toString(); ++ String s2 = s1.trim(); ++ if (s1.startsWith("!")) { ++ // Remove the leading '!' ++ this.string = s1.substring(1); ++ return Token.KEEPCOMMENT; ++ } else if (s2.startsWith("@cc_on") || ++ s2.startsWith("@if") || ++ s2.startsWith("@elif") || ++ s2.startsWith("@else") || ++ s2.startsWith("@end")) { ++ this.string = s1; ++ return Token.CONDCOMMENT; ++ } else { ++ continue retry; ++ } + } + } else { + lookForSlash = false; Added: trunk/yuicompressor/debian/patches/use-system-libraries.patch =================================================================== --- trunk/yuicompressor/debian/patches/use-system-libraries.patch (rev 0) +++ trunk/yuicompressor/debian/patches/use-system-libraries.patch 2009-12-30 23:11:14 UTC (rev 11322) @@ -0,0 +1,34 @@ +--- a/build.xml 2009-12-25 14:46:22.000000000 -0500 ++++ b/build.xml 2009-12-25 15:59:59.000000000 -0500 +@@ -20,10 +20,10 @@ + includes="**/*.java" + deprecation="off" + debug="on" +- source="1.4"> ++ source="1.5"> + <classpath> +- <pathelement location="${lib.dir}/jargs-1.0.jar"/> +- <pathelement location="${lib.dir}/rhino-1.6R7.jar"/> ++ <pathelement location="/usr/share/java/jargs.jar"/> ++ <pathelement location="/usr/share/java/js.jar"/> + </classpath> + </javac> + </target> +@@ -32,8 +32,8 @@ + <mkdir dir="${build.dir}/jar"/> + <!-- The order is important here. Rhino MUST be unjarred first! + (some of our own classes will override the Rhino classes) --> +- <unjar src="${lib.dir}/jargs-1.0.jar" dest="${build.dir}/jar"/> +- <unjar src="${lib.dir}/rhino-1.6R7.jar" dest="${build.dir}/jar"/> ++ <unjar src="/usr/share/java/jargs.jar" dest="${build.dir}/jar"/> ++ <unjar src="/usr/share/java/js.jar" dest="${build.dir}/jar"/> + <copy todir="${build.dir}/jar"> + <fileset dir="${build.dir}/classes" includes="**/*.class"/> + </copy> +@@ -63,4 +63,4 @@ + includes="${dist.package.name}/**/*"/> + </target> + +-</project> +\ No newline at end of file ++</project> Modified: trunk/yuicompressor/debian/rules =================================================================== --- trunk/yuicompressor/debian/rules 2009-12-30 22:21:50 UTC (rev 11321) +++ trunk/yuicompressor/debian/rules 2009-12-30 23:11:14 UTC (rev 11322) @@ -11,11 +11,18 @@ DEB_ANT_BUILD_TARGET := build.jar DEB_DH_INSTALLCHANGELOGS_ARGS := doc/CHANGELOG -LIBRARY=yuicompressor +LIBRARY=yui-compressor VERSION=2.4.2 clean:: - -rm -fr build/* + rm -rf build + rm -f yui-compressor.1.gz + rm -f doc/changelog +build/yui-compressor:: + cp build/yuicompressor-${VERSION}.jar build/yui-compressor.jar + docbook2x-man debian/yui-compressor.1.xml + gzip -9f yui-compressor.1 + get-orig-source: uscan --force-download Added: trunk/yuicompressor/debian/yui-compressor.1.xml =================================================================== --- trunk/yuicompressor/debian/yui-compressor.1.xml (rev 0) +++ trunk/yuicompressor/debian/yui-compressor.1.xml 2009-12-30 23:11:14 UTC (rev 11322) @@ -0,0 +1,69 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" +"/usr/share/xml/docbook/schema/dtd/4.4/docbookx.dtd" [ + +<!-- + Copyright (C) 2009 Michael S. Gilbert <michael.s.gilbert>. +--> + + <!ENTITY dhname "yui-compressor"> + <!ENTITY dhucname "yui-compressor"> + <!ENTITY dhsection "1"> + +]> + +<refentry id="yui-compressor-1" lang="en"> + <refentryinfo> + <title>yui-compressor</title> + <productname>yui-compressor</productname> + <date>$Date: 2009-12-26 12:51:31 $</date> + <authorgroup> + <author> + <firstname>Michael</firstname> + <surname>Gilbert</surname> + <affiliation> + <address> + <email>michael.s.gilb...@gmail.com</email> + </address> + </affiliation> + </author> + </authorgroup> + <copyright> + <year>2009</year> + <holder>Michael S Gilbert</holder> + </copyright> + </refentryinfo> + <refmeta> + <refentrytitle>&dhucname;</refentrytitle> + <manvolnum>&dhsection;</manvolnum> + </refmeta> + <refnamediv id="name"> + <refname>&dhname;</refname> + <refpurpose>creates packaged javascript libraries</refpurpose> + </refnamediv> + <refsect1 id="options"> + <title>OPTIONS</title> + <para><command>&dhname;</command> has the following options: + </para> + <variablelist> + <varlistentry id="h"> + <term><option>-h,--help</option></term> + <listitem><para>display help and more information.</para></listitem> + </varlistentry> + <varlistentry id="o"> + <term><option>-o file</option></term> + <listitem><para>place the output into file (default is stdout).</para></listitem> + </varlistentry> + </variablelist> + </refsect1> + <refsect1 id="examples"> + <title>EXAMPLES</title> + <para>The following example demonstrates how to use <command>&dhname;</command>. + </para> + <cmdsynopsis> + <command>&dhname;</command> + <arg choice="plain"><option>-o packed.js</option></arg> + <arg choice="plain"><option>uncompressed.js</option></arg> + </cmdsynopsis> + </refsect1> +</refentry> Added: trunk/yuicompressor/debian/yui-compressor.install =================================================================== --- trunk/yuicompressor/debian/yui-compressor.install (rev 0) +++ trunk/yuicompressor/debian/yui-compressor.install 2009-12-30 23:11:14 UTC (rev 11322) @@ -0,0 +1,3 @@ +build/yui-compressor.jar /usr/share/yui-compressor +debian/bin/yui-compressor /usr/bin +yui-compressor.1.gz /usr/share/man/man1 _______________________________________________ pkg-java-commits mailing list pkg-java-comm...@lists.alioth.debian.org http://lists.alioth.debian.org/mailman/listinfo/pkg-java-commits