Compare commits
5 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
875f2b8349 | ||
|
|
bd55379bb7 | ||
|
|
e1aedcccae | ||
|
|
4c455d0047 | ||
|
|
c24b9b30e5 |
12 changed files with 3 additions and 607 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1 +0,0 @@
|
|||
/*.tar.gz
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
# yuicompressor
|
||||
|
||||
The yuicompressor package
|
||||
3
dead.package
Normal file
3
dead.package
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
Retired due to missing dependency jargs
|
||||
For minifying javascript use uglify-js instead
|
||||
For minifying css use python3-rcssmin instead
|
||||
2
sources
2
sources
|
|
@ -1,2 +0,0 @@
|
|||
SHA512 (yuicompressor-2.4.8.tar.gz) = cb955fc3677f930403f4f97aaad5d6ca5ec6ee834f464005ddfd8d83c4a532180859b72d55a4025b13f05a6a0146a1391d93668452e57035d4fc4f4d7f20d00b
|
||||
SHA512 (yuicompressor-rhino1_7R2.tar.gz) = 9613b61a435fb12906b1317b7c244346cbc59991cf7d775e726accd68b83c172dee71175e55cf85e48c07585a2c25f0b6e423fc6cd20961b465060f6bf7fae29
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
diff -ur yuicompressor-2.4.8.orig/build.xml yuicompressor-2.4.8/build.xml
|
||||
--- yuicompressor-2.4.8.orig/build.xml 2020-05-06 00:06:12.442911120 +0200
|
||||
+++ yuicompressor-2.4.8/build.xml 2020-05-06 00:11:53.587321510 +0200
|
||||
@@ -33,8 +33,8 @@
|
||||
deprecation="off"
|
||||
debug="on"
|
||||
includeantruntime="false"
|
||||
- target="1.5"
|
||||
- source="1.5">
|
||||
+ target="1.7"
|
||||
+ source="1.7">
|
||||
<classpath>
|
||||
<pathelement location="${lib.dir}/jargs.jar"/>
|
||||
</classpath>
|
||||
|
|
@ -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">
|
||||
<classpath>
|
||||
- <pathelement location="${lib.dir}/jargs-1.0.jar"/>
|
||||
- <pathelement location="${lib.dir}/rhino-1.7R2.jar"/>
|
||||
+ <pathelement location="${lib.dir}/jargs.jar"/>
|
||||
</classpath>
|
||||
</javac>
|
||||
</target>
|
||||
|
||||
<target name="build.jar" depends="build.classes">
|
||||
<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.7R2.jar" dest="${build.dir}/jar"/>
|
||||
<copy todir="${build.dir}/jar">
|
||||
<fileset dir="${build.dir}/classes" includes="**/*.class"/>
|
||||
+ <fileset dir="${src.dir}" includes="**/*.properties"/>
|
||||
</copy>
|
||||
<jar destfile="${build.dir}/${jar.name}" basedir="${build.dir}/jar">
|
||||
<manifest>
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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 <js|css>
|
||||
Specifies the type of the input file
|
||||
.TP
|
||||
\fB\-\-charset\fR <charset>
|
||||
Read the input file using <charset>
|
||||
.TP
|
||||
\fB\-\-line\-break\fR <column>
|
||||
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 <file>
|
||||
Place the output into <file>. 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 <drazzib@debian.org>
|
||||
and Michael Gilbert <michael.s.gilbert@gmail.com>,
|
||||
for the Debian GNU/Linux system (but may be used by others).
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
||||
http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.yahoo.platform.yui</groupId>
|
||||
<artifactId>yuicompressor</artifactId>
|
||||
<version>2.4.8</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>yui compressor</name>
|
||||
<url>http://developer.yahoo.com/yui/compressor/</url>
|
||||
|
||||
<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 is those
|
||||
cases) Compared to jsmin, the average savings is around 20%.
|
||||
</description>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>BSD License</name>
|
||||
<url>http://developer.yahoo.com/yui/license.html</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<mailingLists>
|
||||
<mailingList>
|
||||
<name>yui-compressor-forum</name>
|
||||
<archive>http://yuilibrary.com/forum/viewforum.php?f=94/</archive>
|
||||
</mailingList>
|
||||
</mailingLists>
|
||||
|
||||
<scm>
|
||||
<connection>scm:git:git://github.com/yui/yuicompressor.git</connection>
|
||||
<url>http://github.com/yui/yuicompressor</url>
|
||||
</scm>
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<id>julienlecomte</id>
|
||||
<name>Julien Lecomte</name>
|
||||
</developer>
|
||||
<developer>
|
||||
<id>isaacs</id>
|
||||
<name>Isaac Z. Schlueter</name>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.sf</groupId>
|
||||
<artifactId>jargs</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
@ -1,134 +0,0 @@
|
|||
Name: yuicompressor
|
||||
Version: 2.4.8
|
||||
Release: 14%{?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
|
||||
# Update source and target for JDK 17
|
||||
Patch3: %{name}-java-version.patch
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: ant
|
||||
BuildRequires: javapackages-local
|
||||
BuildRequires: mvn(net.sf:jargs)
|
||||
Provides: bundled(rhino) = 1.7R2
|
||||
# Explicit requires for javapackages-tools since yuicompressor script
|
||||
# uses /usr/share/java-utils/java-functions
|
||||
Requires: javapackages-tools
|
||||
|
||||
%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
|
||||
%patch3 -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 Feb 05 2022 Jiri Vanek <jvanek@redhat.com> - 2.4.8-14
|
||||
- Rebuilt for java-17-openjdk as system jdk
|
||||
- Update source and target for JDK 17
|
||||
|
||||
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.8-13
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.8-12
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
|
||||
* Thu Jan 28 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.8-11
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.8-10
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Sat Jul 11 2020 Jiri Vanek <jvanek@redhat.com> - 2.4.8-9
|
||||
- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11
|
||||
|
||||
* Tue May 05 2020 Mattias Ellert <mattias.ellert@physics.uu.se> - 2.4.8-8
|
||||
- Update source and target for JDK 11
|
||||
|
||||
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.8-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.8-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.8-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
* Fri Aug 31 2018 Severin Gehwolf <sgehwolf@redhat.com> - 2.4.8-4
|
||||
- Add explicit requirement on javapackages-tools since yuicompressor
|
||||
script uses java-functions. See RHBZ#1600426.
|
||||
|
||||
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.8-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.8-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||
|
||||
* Tue Dec 05 2017 Mattias Ellert <mattias.ellert@physics.uu.se> - 2.4.8-1
|
||||
- Initial packaging for Fedora
|
||||
Loading…
Add table
Add a link
Reference in a new issue