From 2cb369d8ef6f9ef81f3d9c9886ba5b385b67ffba Mon Sep 17 00:00:00 2001 From: Jerry James Date: Mon, 27 Mar 2023 15:45:55 -0600 Subject: [PATCH] Update to 7.0.12 Also: - Convert License tag to SPDX - Add bootstrap build mode - Add patch to fix javadoc errors in the JavaCharStream template - Add patch to remove duplicate @Deprecated annotations --- .gitignore | 1 + 0001-Add-javadoc-target-to-build.xml.patch | 25 -- ...oc-errors-in-JavaCharStream.template.patch | 61 ++++ ...ve-extraneous-Deprecated-annotations.patch | 50 +++ javacc-javadoc.patch | 94 ++++++ javacc-template-javadoc.patch | 306 ++++++++++++++++++ javacc.spec | 81 +++-- sources | 2 +- 8 files changed, 575 insertions(+), 45 deletions(-) delete mode 100644 0001-Add-javadoc-target-to-build.xml.patch create mode 100644 0001-Fix-javadoc-errors-in-JavaCharStream.template.patch create mode 100644 0002-Remove-extraneous-Deprecated-annotations.patch create mode 100644 javacc-javadoc.patch create mode 100644 javacc-template-javadoc.patch diff --git a/.gitignore b/.gitignore index 622be3a..a61efb5 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ javacc-5.0src.tar.gz /7.0.1.tar.gz /release_7_0_2.tar.gz /7.0.4.tar.gz +/javacc-7.0.12.tar.gz diff --git a/0001-Add-javadoc-target-to-build.xml.patch b/0001-Add-javadoc-target-to-build.xml.patch deleted file mode 100644 index 2132410..0000000 --- a/0001-Add-javadoc-target-to-build.xml.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 8f1dda63b3e44835a0a88975b368c132f538fd4f Mon Sep 17 00:00:00 2001 -From: Michal Srb -Date: Tue, 30 Jul 2013 15:10:14 +0200 -Subject: [PATCH] Add javadoc target to build.xml - ---- - build.xml | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/build.xml b/build.xml -index 7337939..0b283c5 100644 ---- a/build.xml -+++ b/build.xml -@@ -538,4 +538,8 @@ THE POSSIBILITY OF SUCH DAMAGE. - - - -+ -+ -+ -+ - --- -1.8.1.4 - diff --git a/0001-Fix-javadoc-errors-in-JavaCharStream.template.patch b/0001-Fix-javadoc-errors-in-JavaCharStream.template.patch new file mode 100644 index 0000000..a8f4d6a --- /dev/null +++ b/0001-Fix-javadoc-errors-in-JavaCharStream.template.patch @@ -0,0 +1,61 @@ +From 930afd9bf6d2a0324d806fd7ce2eeba7a223d2d1 Mon Sep 17 00:00:00 2001 +From: Jerry James +Date: Sat, 25 Mar 2023 15:17:02 -0600 +Subject: [PATCH] Fix javadoc errors in JavaCharStream.template + +Signed-off-by: Jerry James +--- + src/main/resources/templates/JavaCharStream.template | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +diff --git a/src/main/resources/templates/JavaCharStream.template b/src/main/resources/templates/JavaCharStream.template +index dc56b5b..07ee0de 100644 +--- a/src/main/resources/templates/JavaCharStream.template ++++ b/src/main/resources/templates/JavaCharStream.template +@@ -501,7 +501,6 @@ class JavaCharStream + + /** Constructor. + * @param dstream the underlying data source. +- * @param startline line number of the first character of the stream, mostly for error messages. + */ + public JavaCharStream(java.io.Reader dstream) + { +@@ -570,7 +569,7 @@ class JavaCharStream + * @param encoding the character encoding of the data stream. + * @param startline line number of the first character of the stream, mostly for error messages. + * @param startcolumn column number of the first character of the stream. +- * @throws UnsupportedEncodingException encoding is invalid or unsupported. ++ * @throws java.io.UnsupportedEncodingException encoding is invalid or unsupported. + */ + public JavaCharStream(java.io.InputStream dstream, String encoding, int startline, + int startcolumn) throws java.io.UnsupportedEncodingException +@@ -592,7 +591,7 @@ class JavaCharStream + /** Constructor. + * @param dstream the underlying data source. + * @param encoding the character encoding of the data stream. +- * @throws UnsupportedEncodingException encoding is invalid or unsupported. ++ * @throws java.io.UnsupportedEncodingException encoding is invalid or unsupported. + */ + public JavaCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException + { +@@ -636,7 +635,7 @@ class JavaCharStream + * @param encoding the character encoding of the data stream. + * @param startline line number of the first character of the stream, mostly for error messages. + * @param startcolumn column number of the first character of the stream. +- * @throws UnsupportedEncodingException encoding is invalid or unsupported. ++ * @throws java.io.UnsupportedEncodingException encoding is invalid or unsupported. + */ + public void ReInit(java.io.InputStream dstream, String encoding, int startline, + int startcolumn) throws java.io.UnsupportedEncodingException +@@ -656,7 +655,7 @@ class JavaCharStream + /** Reinitialise. + * @param dstream the underlying data source. + * @param encoding the character encoding of the data stream. +- * @throws UnsupportedEncodingException encoding is invalid or unsupported. ++ * @throws java.io.UnsupportedEncodingException encoding is invalid or unsupported. + */ + public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException + { +-- +2.39.2 + diff --git a/0002-Remove-extraneous-Deprecated-annotations.patch b/0002-Remove-extraneous-Deprecated-annotations.patch new file mode 100644 index 0000000..59c87ad --- /dev/null +++ b/0002-Remove-extraneous-Deprecated-annotations.patch @@ -0,0 +1,50 @@ +From 64614546bd0c24469603241acd80dcb2c8035c8c Mon Sep 17 00:00:00 2001 +From: Jerry James +Date: Mon, 27 Mar 2023 15:34:48 -0600 +Subject: [PATCH] Remove extraneous @Deprecated annotations + +--- + .../resources/templates/gwt/SimpleCharStream.template | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/src/main/resources/templates/gwt/SimpleCharStream.template b/src/main/resources/templates/gwt/SimpleCharStream.template +index 9c88437..a1de1e3 100644 +--- a/src/main/resources/templates/gwt/SimpleCharStream.template ++++ b/src/main/resources/templates/gwt/SimpleCharStream.template +@@ -215,14 +215,13 @@ ${SUPPORT_CLASS_VISIBILITY_PUBLIC?public :}class SimpleCharStream + return c; + } + +-#if GENERATE_ANNOTATIONS +- @Deprecated +-#fi + /** + * @deprecated + * @see #getEndColumn + */ ++#if GENERATE_ANNOTATIONS + @Deprecated ++#fi + ${PREFIX}public int getColumn() { + #if KEEP_LINE_COLUMN + return bufcolumn[bufpos]; +@@ -231,14 +230,13 @@ ${SUPPORT_CLASS_VISIBILITY_PUBLIC?public :}class SimpleCharStream + #fi + } + +-#if GENERATE_ANNOTATIONS +- @Deprecated +-#fi + /** + * @deprecated + * @see #getEndLine + */ ++#if GENERATE_ANNOTATIONS + @Deprecated ++#fi + ${PREFIX}public int getLine() { + #if KEEP_LINE_COLUMN + return bufline[bufpos]; +-- +2.39.2 + diff --git a/javacc-javadoc.patch b/javacc-javadoc.patch new file mode 100644 index 0000000..81a2d83 --- /dev/null +++ b/javacc-javadoc.patch @@ -0,0 +1,94 @@ +--- javacc-javacc-7.0.12/src/main/java/org/javacc/parser/NonTerminal.java.orig 2022-12-23 03:58:07.000000000 -0700 ++++ javacc-javacc-7.0.12/src/main/java/org/javacc/parser/NonTerminal.java 2023-03-25 15:06:29.752641666 -0600 +@@ -94,28 +94,28 @@ public String getName() { + } + + /** +- * @param argument_tokens the argument_tokens to set ++ * @param parametrized_type__tokens the parametrized type tokens to set + */ +-public void setParametrizedTypeTokens(List argument_tokens) { +- this.argument_tokens = argument_tokens; ++public void setParametrizedTypeTokens(List parametrized_type__tokens) { ++ this.parametrized_type__tokens = parametrized_type__tokens; + } + + /** +- * @return the argument_tokens ++ * @return the parametrized type tokens + */ + public List getParametrizedTypeTokens() { + return parametrized_type__tokens; + } + + /** +- * @param argument_tokens the argument_tokens to set ++ * @param argument_tokens the argument tokens to set + */ +-public void setArgumentTokens(List parametrized_type__tokens) { +- this.parametrized_type__tokens = parametrized_type__tokens; ++public void setArgumentTokens(List argument_tokens) { ++ this.argument_tokens = argument_tokens; + } + + /** +- * @return the argument_tokens ++ * @return the argument tokens + */ + public List getArgumentTokens() { + return argument_tokens; +--- javacc-javacc-7.0.12/src/main/java/org/javacc/parser/ROneOrMore.java.orig 2022-12-23 03:58:07.000000000 -0700 ++++ javacc-javacc-7.0.12/src/main/java/org/javacc/parser/ROneOrMore.java 2023-03-25 14:54:33.946649796 -0600 +@@ -29,7 +29,7 @@ + package org.javacc.parser; + + /** +- * Describes one-or-more regular expressions (). ++ * Describes one-or-more regular expressions (<foo+>). + */ + + public class ROneOrMore extends RegularExpression { +--- javacc-javacc-7.0.12/src/main/java/org/javacc/parser/RRepetitionRange.java.orig 2022-12-23 03:58:07.000000000 -0700 ++++ javacc-javacc-7.0.12/src/main/java/org/javacc/parser/RRepetitionRange.java 2023-03-25 14:55:02.786247660 -0600 +@@ -31,7 +31,7 @@ import java.util.ArrayList; + import java.util.List; + + /** +- * Describes one-or-more regular expressions (). ++ * Describes one-or-more regular expressions (<foo+>). + */ + + public class RRepetitionRange extends RegularExpression { +--- javacc-javacc-7.0.12/src/main/java/org/javacc/parser/RZeroOrMore.java.orig 2022-12-23 03:58:07.000000000 -0700 ++++ javacc-javacc-7.0.12/src/main/java/org/javacc/parser/RZeroOrMore.java 2023-03-25 14:55:21.049992983 -0600 +@@ -29,7 +29,7 @@ + package org.javacc.parser; + + /** +- * Describes zero-or-more regular expressions (). ++ * Describes zero-or-more regular expressions (<foo*>). + */ + + public class RZeroOrMore extends RegularExpression { +--- javacc-javacc-7.0.12/src/main/java/org/javacc/parser/RZeroOrOne.java.orig 2022-12-23 03:58:07.000000000 -0700 ++++ javacc-javacc-7.0.12/src/main/java/org/javacc/parser/RZeroOrOne.java 2023-03-25 14:55:40.577720078 -0600 +@@ -28,7 +28,7 @@ + package org.javacc.parser; + + /** +- * Describes zero-or-one regular expressions (). ++ * Describes zero-or-one regular expressions (<foo?>). + */ + + public class RZeroOrOne extends RegularExpression { +--- javacc-javacc-7.0.12/src/main/java/org/javacc/parser/TokenProduction.java.orig 2022-12-23 03:58:07.000000000 -0700 ++++ javacc-javacc-7.0.12/src/main/java/org/javacc/parser/TokenProduction.java 2023-03-25 15:06:51.760333891 -0600 +@@ -61,7 +61,7 @@ public class TokenProduction { + + /** + * The states in which this regular expression production exists. If +- * this array is null, then "<*>" has been specified and this regular ++ * this array is null, then "<*>" has been specified and this regular + * expression exists in all states. However, this null value is + * replaced by a String array that includes all lexical state names + * during the semanticization phase. diff --git a/javacc-template-javadoc.patch b/javacc-template-javadoc.patch new file mode 100644 index 0000000..e56cc7c --- /dev/null +++ b/javacc-template-javadoc.patch @@ -0,0 +1,306 @@ +--- javacc-javacc-7.0.12/src/main/resources/templates/gwt/SimpleCharStream.template.orig 2022-12-23 03:58:07.000000000 -0700 ++++ javacc-javacc-7.0.12/src/main/resources/templates/gwt/SimpleCharStream.template 2023-03-26 11:28:53.769605854 -0600 +@@ -215,14 +215,13 @@ ${SUPPORT_CLASS_VISIBILITY_PUBLIC?public + return c; + } + +-#if GENERATE_ANNOTATIONS +- @Deprecated +-#fi + /** + * @deprecated + * @see #getEndColumn + */ ++#if GENERATE_ANNOTATIONS + @Deprecated ++#fi + ${PREFIX}public int getColumn() { + #if KEEP_LINE_COLUMN + return bufcolumn[bufpos]; +@@ -231,14 +230,13 @@ ${SUPPORT_CLASS_VISIBILITY_PUBLIC?public + #fi + } + +-#if GENERATE_ANNOTATIONS +- @Deprecated +-#fi + /** + * @deprecated + * @see #getEndLine + */ ++#if GENERATE_ANNOTATIONS + @Deprecated ++#fi + ${PREFIX}public int getLine() { + #if KEEP_LINE_COLUMN + return bufline[bufpos]; +--- javacc-javacc-7.0.12/src/main/resources/templates/JavaCharStream.template.orig 2022-12-23 03:58:07.000000000 -0700 ++++ javacc-javacc-7.0.12/src/main/resources/templates/JavaCharStream.template 2023-03-25 10:14:49.496652118 -0600 +@@ -58,39 +58,66 @@ class JavaCharStream + throw new java.io.IOException(); // Should never come here + } + +-/* Position in buffer. */ ++ /** Position in buffer. */ + ${PREFIX}public int bufpos = -1; ++ /** Size of the buffer. */ + ${PREFIX}int bufsize; ++ /** Number of characters available in the buffer. */ + ${PREFIX}int available; ++ /** Buffer position of the first character of the current token. */ + ${PREFIX}int tokenBegin; + #if KEEP_LINE_COLUMN ++ /** Line number of each buffer character. */ + ${PREFIX}protected int bufline[]; ++ /** Column number of each buffer character. */ + ${PREFIX}protected int bufcolumn[]; + ++ /** Current column number. */ + ${PREFIX}protected int column = 0; ++ /** Current line number. */ + ${PREFIX}protected int line = 1; + ++ /** True if the previous character is a carriage return. */ + ${PREFIX}protected boolean prevCharIsCR = false; ++ /** True if the previous character is a linefeed. */ + ${PREFIX}protected boolean prevCharIsLF = false; + #fi + ++ /** The input stream from which characters are read. */ + ${PREFIX}protected java.io.Reader inputStream; + ++ /** The buffer containing the next character. */ + ${PREFIX}protected char[] nextCharBuf; ++ /* The buffer. */ + ${PREFIX}protected char[] buffer; ++ /** Index one beyond the last character in the buffer. */ + ${PREFIX}protected int maxNextCharInd = 0; ++ /** Index of the next character in the buffer. */ + ${PREFIX}protected int nextCharInd = -1; ++ /** The number of characters in the buffer. */ + ${PREFIX}protected int inBuf = 0; ++ /** The tab size. */ + ${PREFIX}protected int tabSize = 1; ++ /** Whether to track the line and column. */ + #if KEEP_LINE_COLUMN + ${PREFIX}protected boolean trackLineColumn = true; + #else + ${PREFIX}protected boolean trackLineColumn = false; + #fi + ++ /** Set the tab size. ++ * @param i the tab size ++ */ + ${PREFIX}public void setTabSize(int i) { tabSize = i; } ++ /** Get the tab size. ++ * @return the tab size. ++ */ + ${PREFIX}public int getTabSize() { return tabSize; } + ++/** ++ * Make the buffer bigger. ++ * @param wrapAround true if the buffer wraps around ++ */ + ${PREFIX}protected void ExpandBuff(boolean wrapAround) + { + char[] newbuffer = new char[bufsize + 2048]; +@@ -144,6 +171,10 @@ class JavaCharStream + tokenBegin = 0; + } + ++/** ++ * Fill the buffer. ++ * @throws java.io.IOException an exception occurs while filling the buffer ++ */ + ${PREFIX}protected void FillBuff() throws java.io.IOException + { + int i; +@@ -178,6 +209,11 @@ class JavaCharStream + } + } + ++/** ++ * Read one byte. ++ * @return the byte ++ * @throws java.io.IOException an exception occurs while filling the buffer ++ */ + ${PREFIX}protected char ReadByte() throws java.io.IOException + { + if (++nextCharInd >= maxNextCharInd) +@@ -186,7 +222,11 @@ class JavaCharStream + return nextCharBuf[nextCharInd]; + } + +-/* @return starting character for token. */ ++/** ++ * Get the first character of the token. ++ * @return starting character for token. ++ * @throws java.io.IOException an exception occurs while fetching a character ++ */ + ${PREFIX}public char BeginToken() throws java.io.IOException + { + if (inBuf > 0) +@@ -206,6 +246,9 @@ class JavaCharStream + return readChar(); + } + ++/** ++ * Get more buffer space if needed. ++ */ + ${PREFIX}protected void AdjustBuffSize() + { + if (available == bufsize) +@@ -227,6 +270,9 @@ class JavaCharStream + } + #if KEEP_LINE_COLUMN + ++/** Update line and column due to adding a character. ++ * @param c the character that is added ++ */ + ${PREFIX}protected void UpdateLineColumn(char c) + { + column++; +@@ -268,7 +314,10 @@ class JavaCharStream + } + #fi + +-/* Read a character. */ ++/** Read a character. ++ * @return the character that is read ++ * @throws java.io.IOException an error occurred while reading the character ++ */ + ${PREFIX}public char readChar() throws java.io.IOException + { + if (inBuf > 0) +@@ -378,9 +427,10 @@ class JavaCharStream + } + } + +- /* ++ /** + * @deprecated + * @see #getEndColumn ++ * @return the column number. + */ + #if GENERATE_ANNOTATIONS + @Deprecated +@@ -393,7 +443,7 @@ class JavaCharStream + #fi + } + +- /* ++ /** + * @deprecated + * @see #getEndLine + * @return the line number. +@@ -450,7 +500,9 @@ class JavaCharStream + #fi + } + +-/** Retreat. */ ++/** Retreat. ++ * @param amount number of characters to back up ++ */ + ${PREFIX}public void backup(int amount) { + + inBuf += amount; +@@ -501,13 +553,17 @@ class JavaCharStream + + /** Constructor. + * @param dstream the underlying data source. +- * @param startline line number of the first character of the stream, mostly for error messages. + */ + public JavaCharStream(java.io.Reader dstream) + { + this(dstream, 1, 1, 4096); + } +-/* Reinitialise. */ ++/** Reinitialise. ++ * @param dstream the underlying data source. ++ * @param startline line number of the first character of the stream, mostly for error messages. ++ * @param startcolumn column number of the first character of the stream. ++ * @param buffersize size of the buffer ++ */ + public void ReInit(java.io.Reader dstream, + int startline, int startcolumn, int buffersize) + { +@@ -534,19 +590,32 @@ class JavaCharStream + nextCharInd = bufpos = -1; + } + +-/* Reinitialise. */ ++/** Reinitialise. ++ * @param dstream the underlying data source. ++ * @param startline line number of the first character of the stream, mostly for error messages. ++ * @param startcolumn column number of the first character of the stream. ++ */ + public void ReInit(java.io.Reader dstream, + int startline, int startcolumn) + { + ReInit(dstream, startline, startcolumn, 4096); + } + +-/* Reinitialise. */ ++/** Reinitialise. ++ * @param dstream the underlying data source. ++ */ + public void ReInit(java.io.Reader dstream) + { + ReInit(dstream, 1, 1, 4096); + } +-/** Constructor. */ ++/** Constructor. ++ * @param dstream the underlying data source. ++ * @param encoding the character encoding of the data stream. ++ * @param startline line number of the first character of the stream, mostly for error messages. ++ * @param startcolumn column number of the first character of the stream. ++ * @param buffersize size of the buffer ++ * @throws java.io.UnsupportedEncodingException encoding is invalid or unsupported. ++ */ + public JavaCharStream(java.io.InputStream dstream, String encoding, int startline, + int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException + { +@@ -570,7 +639,7 @@ class JavaCharStream + * @param encoding the character encoding of the data stream. + * @param startline line number of the first character of the stream, mostly for error messages. + * @param startcolumn column number of the first character of the stream. +- * @throws UnsupportedEncodingException encoding is invalid or unsupported. ++ * @throws java.io.UnsupportedEncodingException encoding is invalid or unsupported. + */ + public JavaCharStream(java.io.InputStream dstream, String encoding, int startline, + int startcolumn) throws java.io.UnsupportedEncodingException +@@ -592,7 +661,7 @@ class JavaCharStream + /** Constructor. + * @param dstream the underlying data source. + * @param encoding the character encoding of the data stream. +- * @throws UnsupportedEncodingException encoding is invalid or unsupported. ++ * @throws java.io.UnsupportedEncodingException encoding is invalid or unsupported. + */ + public JavaCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException + { +@@ -613,6 +682,7 @@ class JavaCharStream + * @param startline line number of the first character of the stream, mostly for error messages. + * @param startcolumn column number of the first character of the stream. + * @param buffersize size of the buffer ++ * @throws java.io.UnsupportedEncodingException encoding is invalid or unsupported. + */ + public void ReInit(java.io.InputStream dstream, String encoding, int startline, + int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException +@@ -636,7 +706,7 @@ class JavaCharStream + * @param encoding the character encoding of the data stream. + * @param startline line number of the first character of the stream, mostly for error messages. + * @param startcolumn column number of the first character of the stream. +- * @throws UnsupportedEncodingException encoding is invalid or unsupported. ++ * @throws java.io.UnsupportedEncodingException encoding is invalid or unsupported. + */ + public void ReInit(java.io.InputStream dstream, String encoding, int startline, + int startcolumn) throws java.io.UnsupportedEncodingException +@@ -656,7 +726,7 @@ class JavaCharStream + /** Reinitialise. + * @param dstream the underlying data source. + * @param encoding the character encoding of the data stream. +- * @throws UnsupportedEncodingException encoding is invalid or unsupported. ++ * @throws java.io.UnsupportedEncodingException encoding is invalid or unsupported. + */ + public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException + { diff --git a/javacc.spec b/javacc.spec index 1b62ad2..fe5561b 100644 --- a/javacc.spec +++ b/javacc.spec @@ -28,18 +28,36 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # +# Build in bootstrap mode on new architectures +%bcond_with bootstrap + Name: javacc -Version: 7.0.4 -Release: 14%{?dist} +Version: 7.0.12 +Release: 1%{?dist} Epoch: 0 Summary: A parser/scanner generator for java -License: BSD -URL: http://javacc.org -Source0: https://github.com/javacc/javacc/archive/%{version}.tar.gz + +# BSD-3-Clause: the project as a whole +# BSD-2-Clause: +# - src/main/javacc/ConditionParser.jj +# - src/main/java/org/javacc/parser/OutputFile.java +# - src/main/java/org/javacc/utils/OutputFileGenerator.java +License: BSD-3-Clause AND BSD-2-Clause +URL: https://javacc.org/ +Source0: https://github.com/javacc/javacc/archive/%{name}-%{version}.tar.gz +# Fix javadoc errors in the JavaCharStream template +# https://github.com/javacc/javacc/pull/257 +Patch0: 0001-Fix-javadoc-errors-in-JavaCharStream.template.patch +# Remove duplicate @Deprecated annotations +# https://github.com/javacc/javacc/pull/259 +Patch1: 0002-Remove-extraneous-Deprecated-annotations.patch BuildRequires: javapackages-local BuildRequires: ant +%if %{without bootstrap} BuildRequires: javacc +%endif + # Explicit javapackages-tools requires since scripts use # /usr/share/java-utils/java-functions Requires: javapackages-tools @@ -56,6 +74,12 @@ standard capabilities related to parser generation such as tree building (via a tool called JJTree included with JavaCC), actions, debugging, etc. %package manual +# BSD-3-Clause: the project license +# GPL-2.0-or-later: docs/grammars/AsnParser.jj +# LGPL-2.1-or-later: docs/grammars/{ChemNumber.jj,RTFParser.jj} +# AFL-2.0 OR BSD-3-Clause: docs/grammars/EcmaScript.jjt +# ISC: docs/grammars/JSONParser.jjt +License: BSD-3-Clause AND GPL-2.0-or-later AND LGPL-2.1-or-later AND (AFL-2.0 OR BSD-3-Clause) AND ISC Summary: Manual for %{name} %description manual @@ -68,30 +92,41 @@ Requires: %{name} = %{version}-%{release} %description demo Examples for %{name}. -%package javadoc -Summary: Javadoc for %{name} - -%description javadoc -This package contains the API documentation for %{name}. +%javadoc_package %prep -%setup -q -n %{name}-%{version} +%autosetup -n %{name}-%{name}-%{version} -p1 +%if %{without bootstrap} # Remove binary information in the source tar find . -name "*.jar" -delete -find . -name "*.class" -delete +%endif +find examples -name .gitignore -delete -find ./examples -type f -exec sed -i 's/\r//' {} \; +fixtimestamp() { + touch -r $1.orig $1 + rm $1.orig +} + +mv examples/JJTreeExamples/cpp/README examples/JJTreeExamples/cpp/README.orig +iconv -f WINDOWS-1252 -t UTF-8 examples/JJTreeExamples/cpp/README.orig > \ + examples/JJTreeExamples/cpp/README +fixtimestamp examples/JJTreeExamples/cpp/README + +sed -i.orig 's/\r//' examples/JJTreeExamples/cpp/eg3.jjt +fixtimestamp examples/JJTreeExamples/cpp/eg3.jjt %build +%if %{without bootstrap} build-jar-repository -p bootstrap javacc +%endif # There is maven pom which doesn't really work for building. The tests don't # work either (even when using bundled jars). ant jar javadoc -Dant.build.javac.source=1.8 -Dant.build.javac.target=1.8 # The pom dependencies are also wrong -%mvn_artifact --skip-dependencies pom.xml target/javacc-%{version}.jar +%mvn_artifact --skip-dependencies pom.xml target/javacc.jar %install %mvn_file : %{name} @@ -103,24 +138,32 @@ ln -s %{_bindir}/javacc %{buildroot}%{_bindir}/javacc.sh %jpackage_script jjdoc '' '' javacc jjdoc true %jpackage_script jjtree '' '' javacc jjtree true +# Swizzle an absolute symlink into a relative symlink +rm %{buildroot}%{_bindir}/javacc.sh +ln -s javacc %{buildroot}%{_bindir}/javacc.sh + %files -f .mfiles %license LICENSE -%doc README +%doc README.md %{_bindir}/javacc %{_bindir}/javacc.sh %{_bindir}/jjdoc %{_bindir}/jjtree %files manual -%doc www/* +%doc docs/* %files demo %doc examples -%files javadoc -f .mfiles-javadoc -%license LICENSE - %changelog +* Sat Apr 1 2023 Jerry James - 0:7.0.12-1 +- Update to 7.0.12 +- Convert License tag to SPDX +- Add bootstrap build mode +- Add patch to fix javadoc errors in the JavaCharStream template +- Add patch to remove duplicate @Deprecated annotations + * Thu Jan 19 2023 Fedora Release Engineering - 0:7.0.4-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild diff --git a/sources b/sources index c6e7d4b..e45e107 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (7.0.4.tar.gz) = b93c93e8490aae9a26b0de948896ec6d7a044c205d09584c3908988e24a3ea63a1147365115b17a15c6fb311c44f53ddff7c11f092731cbd05d3ec1950ef57f1 +SHA512 (javacc-7.0.12.tar.gz) = 963983d39696705051cf568201a17ccc63995f90572782fdbf2b1df4d20b682f7b6f69b5d7e950db9e27f30eac961b483e813bccb91a10365e0836b905cbe3fc