diff --git a/.gitignore b/.gitignore deleted file mode 100644 index f6a3a77..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/*.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 1cb985d..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# yuicompressor - -The yuicompressor package \ No newline at end of file diff --git a/dead.package b/dead.package new file mode 100644 index 0000000..0a0853d --- /dev/null +++ b/dead.package @@ -0,0 +1,3 @@ +Retired due to missing dependency jargs +For minifying javascript use uglify-js instead +For minifying css use python3-rcssmin instead diff --git a/sources b/sources deleted file mode 100644 index d8dbdab..0000000 --- a/sources +++ /dev/null @@ -1,2 +0,0 @@ -SHA512 (yuicompressor-2.4.8.tar.gz) = cb955fc3677f930403f4f97aaad5d6ca5ec6ee834f464005ddfd8d83c4a532180859b72d55a4025b13f05a6a0146a1391d93668452e57035d4fc4f4d7f20d00b -SHA512 (yuicompressor-rhino1_7R2.tar.gz) = 9613b61a435fb12906b1317b7c244346cbc59991cf7d775e726accd68b83c172dee71175e55cf85e48c07585a2c25f0b6e423fc6cd20961b465060f6bf7fae29 diff --git a/yuicompressor-remove-jars.patch b/yuicompressor-remove-jars.patch deleted file mode 100644 index c0fbfd1..0000000 --- a/yuicompressor-remove-jars.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff -ur yuicompressor-2.4.8.orig/build.xml yuicompressor-2.4.8/build.xml ---- yuicompressor-2.4.8.orig/build.xml 2013-05-15 09:23:58.000000000 +0200 -+++ yuicompressor-2.4.8/build.xml 2017-12-20 11:55:21.853626638 +0100 -@@ -36,20 +36,16 @@ - target="1.5" - source="1.5"> - -- -- -+ - - - - - - -- -- -- - - -+ - - - diff --git a/yuicompressor-rhino.patch b/yuicompressor-rhino.patch deleted file mode 100644 index c5776d9..0000000 --- a/yuicompressor-rhino.patch +++ /dev/null @@ -1,255 +0,0 @@ -diff -ur yuicompressor-2.4.8.orig/src/org/mozilla/javascript/Decompiler.java yuicompressor-2.4.8/src/org/mozilla/javascript/Decompiler.java ---- yuicompressor-2.4.8.orig/src/org/mozilla/javascript/Decompiler.java 2009-03-22 14:32:26.000000000 +0100 -+++ yuicompressor-2.4.8/src/org/mozilla/javascript/Decompiler.java 2017-12-05 17:33:46.070639980 +0100 -@@ -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); -diff -ur yuicompressor-2.4.8.orig/src/org/mozilla/javascript/Parser.java yuicompressor-2.4.8/src/org/mozilla/javascript/Parser.java ---- yuicompressor-2.4.8.orig/src/org/mozilla/javascript/Parser.java 2009-03-22 14:32:24.000000000 +0100 -+++ yuicompressor-2.4.8/src/org/mozilla/javascript/Parser.java 2017-12-05 17:33:46.071639969 +0100 -@@ -2465,6 +2465,16 @@ - reportError("msg.unexpected.eof"); - break; - -+ case Token.CONDCOMMENT: -+ String condComment = ts.getString(); -+ decompiler.addJScriptConditionalComment(condComment); -+ return nf.createString(condComment); -+ -+ case Token.KEEPCOMMENT: -+ String keepComment = ts.getString(); -+ decompiler.addPreservedComment(keepComment); -+ return nf.createString(keepComment); -+ - default: - reportError("msg.syntax"); - break; -diff -ur yuicompressor-2.4.8.orig/src/org/mozilla/javascript/Token.java yuicompressor-2.4.8/src/org/mozilla/javascript/Token.java ---- yuicompressor-2.4.8.orig/src/org/mozilla/javascript/Token.java 2009-03-22 14:32:26.000000000 +0100 -+++ yuicompressor-2.4.8/src/org/mozilla/javascript/Token.java 2017-12-05 17:33:46.072639958 +0100 -@@ -258,7 +258,11 @@ - LETEXPR = 157, - WITHEXPR = 158, - DEBUGGER = 159, -- LAST_TOKEN = 159; -+ -+ CONDCOMMENT = 160, // JScript conditional comment -+ KEEPCOMMENT = 161, // /*! ... */ comment -+ -+ LAST_TOKEN = 161; - - public static String name(int token) - { -diff -ur yuicompressor-2.4.8.orig/src/org/mozilla/javascript/TokenStream.java yuicompressor-2.4.8/src/org/mozilla/javascript/TokenStream.java ---- yuicompressor-2.4.8.orig/src/org/mozilla/javascript/TokenStream.java 2009-03-22 14:32:26.000000000 +0100 -+++ yuicompressor-2.4.8/src/org/mozilla/javascript/TokenStream.java 2017-12-05 17:33:46.072639958 +0100 -@@ -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; -- } -+ -+ 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); -- } -- // 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; -+ break; - -- case '\n': -- // Remove line terminator after escape to follow -- // SpiderMonkey and C/C++ -- c = getChar(); -- continue strLoop; -- -- 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; -@@ -876,9 +853,9 @@ - if (startToken != Token.DIV) Kit.codeBug(); - } - -- boolean inCharSet = false; // true if inside a '['..']' pair - int c; -- while ((c = getChar()) != '/' || inCharSet) { -+ boolean inClass = false; -+ while ((c = getChar()) != '/' || inClass) { - if (c == '\n' || c == EOF_CHAR) { - ungetChar(c); - throw parser.reportError("msg.unterminated.re.lit"); -@@ -887,9 +864,9 @@ - addToString(c); - c = getChar(); - } else if (c == '[') { -- inCharSet = true; -+ inClass = true; - } else if (c == ']') { -- inCharSet = false; -+ inClass = false; - } - addToString(c); - } diff --git a/yuicompressor-rhino.sh b/yuicompressor-rhino.sh deleted file mode 100755 index 3e09318..0000000 --- a/yuicompressor-rhino.sh +++ /dev/null @@ -1,9 +0,0 @@ -#! /bin/sh - -rhino=rhino1_7R2 - -wget -N http://ftp.mozilla.org/pub/mozilla.org/js/${rhino}.zip -rm -rf ${rhino} -unzip ${rhino}.zip ${rhino}/src/org/mozilla/* ${rhino}/LICENSE.txt -( cd ${rhino} ; tar -z -c --group root --owner root -f ../yuicompressor-${rhino}.tar.gz src LICENSE.txt ) -rm ${rhino}.zip diff --git a/yuicompressor-tests.patch b/yuicompressor-tests.patch deleted file mode 100644 index 3a2b94f..0000000 --- a/yuicompressor-tests.patch +++ /dev/null @@ -1,49 +0,0 @@ -diff -ur yuicompressor-2.4.8.orig/tests/suite.sh yuicompressor-2.4.8/tests/suite.sh ---- yuicompressor-2.4.8.orig/tests/suite.sh 2013-05-15 09:23:58.000000000 +0200 -+++ yuicompressor-2.4.8/tests/suite.sh 2017-12-07 03:45:47.374338608 +0100 -@@ -1,7 +1,7 @@ --#!/usr/bin/env bash -+#!/bin/sh - - cd $(dirname $0) -- -+ - # Get the jar to use. - jar="$(ls ../build/*.jar | sort | tail -n1)" - echo "jar: $jar" -@@ -15,18 +15,11 @@ - filetype="$( - echo $testfile | egrep -o '(cs|j)s' - )" -- -- if [ "$2" == "cssminjs" ]; then -- actual="$( -- java -jar ../lib/rhino-1.7R2.jar suite.rhino $testfile -- )" -- -- else -- actual="$( -- java -jar $jar --type $filetype $testfile -- )" -- fi -- -+ -+ actual="$( -+ java -cp $(build-classpath jargs):$jar com.yahoo.platform.yui.compressor.Bootstrap --type $filetype $testfile -+ )" -+ - if [ "$expected" == "$actual" ]; then - echo "Passed: $testfile" > /dev/stderr - else -@@ -52,11 +45,3 @@ - ls *.{css,js} | while read testfile; do - runtest $testfile || exit 1 - done -- --echo --echo "now testing the JS port of CSSMIN..." --ls *.css | while read testfile; do -- runtest $testfile "cssminjs" || exit 1 --done -- --exit 0 diff --git a/yuicompressor.1 b/yuicompressor.1 deleted file mode 100644 index 6bded98..0000000 --- a/yuicompressor.1 +++ /dev/null @@ -1,51 +0,0 @@ -.TH YUI-COMPRESSOR "1" "January 2010" "yui-compressor " "User Commands" -.SH NAME -yuicompressor \- JavaScript/CSS minifier -.SH SYNOPSIS -.B yuicompressor -\fR[\fIoptions\fR] [\fIinput file\fR] -.SH DESCRIPTION -Global Options -.TP -\fB\-h\fR, \fB\-\-help\fR -Displays this information -.TP -\fB\-\-type\fR -Specifies the type of the input file -.TP -\fB\-\-charset\fR -Read the input file using -.TP -\fB\-\-line\-break\fR -Insert a line break after the specified column number -.TP -\fB\-v\fR, \fB\-\-verbose\fR -Display informational messages and warnings -.TP -\fB\-o\fR -Place the output into . Defaults to stdout. -.PP -JavaScript Options -.TP -\fB\-\-nomunge\fR -Minify only, do not obfuscate -.TP -\fB\-\-preserve\-semi\fR -Preserve all semicolons -.TP -\fB\-\-disable\-optimizations\fR -Disable all micro optimizations -.PP -If no input file is specified, it defaults to stdin. In this case, the 'type' -option is required. Otherwise, the 'type' option is required only if the input -file extension is neither 'js' nor 'css'. -.SH EXAMPLES -The following example demonstrates how to use yuicompressor -.TP -.B yuicompressor -o compressed.js original.js -.SH SEE ALSO -.BR /usr/share/doc/yuicompressor/README.md -.SH AUTHOR -This manual page was written by Damien Raude-Morvan -and Michael Gilbert , -for the Debian GNU/Linux system (but may be used by others). diff --git a/yuicompressor.pom b/yuicompressor.pom deleted file mode 100644 index 2838b0b..0000000 --- a/yuicompressor.pom +++ /dev/null @@ -1,63 +0,0 @@ - - - - 4.0.0 - com.yahoo.platform.yui - yuicompressor - 2.4.8 - jar - - yui compressor - http://developer.yahoo.com/yui/compressor/ - - - The YUI Compressor is a JavaScript compressor which, in addition to removing - comments and white-spaces, obfuscates local variables using the smallest - possible variable name. This obfuscation is safe, even when using constructs - such as 'eval' or 'with' (although the compression is not optimal is those - cases) Compared to jsmin, the average savings is around 20%. - - - - - BSD License - http://developer.yahoo.com/yui/license.html - repo - - - - - - yui-compressor-forum - http://yuilibrary.com/forum/viewforum.php?f=94/ - - - - - scm:git:git://github.com/yui/yuicompressor.git - http://github.com/yui/yuicompressor - - - - - julienlecomte - Julien Lecomte - - - isaacs - Isaac Z. Schlueter - - - - - - net.sf - jargs - 1.0 - - - - diff --git a/yuicompressor.spec b/yuicompressor.spec deleted file mode 100644 index a32c59f..0000000 --- a/yuicompressor.spec +++ /dev/null @@ -1,93 +0,0 @@ -Name: yuicompressor -Version: 2.4.8 -Release: 3%{?dist} -Summary: YUI Compressor - The Yahoo JavaScript and CSS Compressor - -# Source 0 is BSD, Source 1 is MPLv1.1 or GPLv2+ -License: BSD and (MPLv1.1 or GPLv2+) -URL: https://yui.github.com/%{name}/ -Source0: https://github.com/yui/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz -# The yuicompressor uses the javascript parser from rhino. -# However, it calls private functions not exported by the -# rhino jar, so it can not use the jar provided by the -# distribution. The upstream source unjars a bundled copy of -# the rhino jar and builds using its precompiled class files. -# This violates the no precompiled sources guidelines. Only -# part of the rhino source tree is used by yuicompressor. The -# upstream sources also contains modified versions of a few -# of the rhino sources. These changes are restored by patch 0. -# Source 1 is a slimmed down version of the rhino sources of -# the same version that is bundled in the upstream sources. -# Source 2 is the script used to create Source 1. -Source1: %{name}-rhino1_7R2.tar.gz -Source2: %{name}-rhino.sh -# Man page - copied from Debian -Source3: %{name}.1 -# Pom file based on template from upstream: -# https://github.com/yui/yuicompressor/raw/master/maven_central/template/pom.xml.template -Source4: %{name}.pom -# This patch restores yuicompressor's changes to the rhino -# sources overwritten by Source 1 -Patch0: %{name}-rhino.patch -# Remove references to prebuilt jars in build.xml -Patch1: %{name}-remove-jars.patch -# Fix test script - only test yuicompressor, not rhino -Patch2: %{name}-tests.patch - -BuildArch: noarch -BuildRequires: ant -BuildRequires: javapackages-local -BuildRequires: mvn(net.sf:jargs) -Provides: bundled(rhino) = 1.7R2 - -%description -The YUI Compressor is a JavaScript compressor which, in addition to -removing comments and white-spaces, obfuscates local variables using -the smallest possible variable name. This obfuscation is safe, even -when using constructs such as 'eval' or 'with' (although the -compression is not optimal in those cases) Compared to jsmin, the -average savings is around 20%. - -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). - -%prep -%setup -q -a 1 -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -# Remove prebuilt jars -rm -rf lib/* -ln -s $(build-classpath jargs) lib - -%build -%ant - -%install -%mvn_artifact %{SOURCE4} build/%{name}-%{version}.jar -%mvn_install - -%jpackage_script com.yahoo.platform.yui.compressor.Bootstrap "" "" jargs:%{name} %{name} true - -mkdir -p %{buildroot}%{_mandir}/man1 -install -m 644 %{SOURCE3} %{buildroot}%{_mandir}/man1 - -%check -tests/suite.sh - -%files -f .mfiles -%{_bindir}/%{name} -%doc %{_mandir}/man1/%{name}.1* -%doc README.md doc/CHANGELOG -%license LICENSE.TXT LICENSE.txt - -%changelog -* Sat Jul 14 2018 Fedora Release Engineering - 2.4.8-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Fri Feb 09 2018 Fedora Release Engineering - 2.4.8-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Tue Dec 05 2017 Mattias Ellert - 2.4.8-1 -- Initial packaging for Fedora