diff --git a/.gitignore b/.gitignore index e92a582..6ffb0de 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/qdox-2.0~M10.tar.gz +SOURCES/qdox-2.1.0.tar.gz diff --git a/.qdox.metadata b/.qdox.metadata index d2f68da..a0f8ee6 100644 --- a/.qdox.metadata +++ b/.qdox.metadata @@ -1 +1 @@ -23152becb77e6cbae4f4587bb557af3441f6734f SOURCES/qdox-2.0~M10.tar.gz +394cf684ad344d4a366944fe1b4169fcc9bb7d9c SOURCES/qdox-2.1.0.tar.gz diff --git a/SOURCES/0001-Port-to-JFlex-1.7.0.patch b/SOURCES/0001-Port-to-JFlex-1.7.0.patch deleted file mode 100644 index 441858b..0000000 --- a/SOURCES/0001-Port-to-JFlex-1.7.0.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 31f530b26bd4625ffe41aa16c48836455ef81c23 Mon Sep 17 00:00:00 2001 -From: Mikolaj Izdebski -Date: Fri, 7 Jun 2019 10:39:34 +0200 -Subject: [PATCH] Port to JFlex 1.7.0 - ---- - src/grammar/lexer.flex | 2 +- - .../java/com/thoughtworks/qdox/library/ClassLoaderLibrary.java | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/grammar/lexer.flex b/src/grammar/lexer.flex -index 9b567ff..cd9d5b6 100644 ---- a/src/grammar/lexer.flex -+++ b/src/grammar/lexer.flex -@@ -168,7 +168,7 @@ import java.util.*; - } - - public JFlexLexer( java.io.InputStream stream, java.io.Writer writer ) { -- this( stream ); -+ this( new java.io.InputStreamReader( stream, java.nio.charset.Charset.forName( "UTF-8" ) ) ); - this.writer = writer; - } - -diff --git a/src/main/java/com/thoughtworks/qdox/library/ClassLoaderLibrary.java b/src/main/java/com/thoughtworks/qdox/library/ClassLoaderLibrary.java -index c947f9b..5b415c0 100644 ---- a/src/main/java/com/thoughtworks/qdox/library/ClassLoaderLibrary.java -+++ b/src/main/java/com/thoughtworks/qdox/library/ClassLoaderLibrary.java -@@ -112,7 +112,7 @@ public class ClassLoaderLibrary - if ( sourceStream != null ) - { - Builder builder = getModelBuilder(); -- JavaLexer lexer = new JFlexLexer( sourceStream ); -+ JavaLexer lexer = new JFlexLexer( new java.io.InputStreamReader( sourceStream, java.nio.charset.Charset.forName( "UTF-8" ) ) ); - Parser parser = new Parser( lexer, builder ); - parser.setDebugLexer( debugLexer ); - parser.setDebugParser( debugParser ); --- -2.21.0 - diff --git a/SOURCES/generate-tarball.sh b/SOURCES/generate-tarball.sh index 6fb2053..dea833b 100755 --- a/SOURCES/generate-tarball.sh +++ b/SOURCES/generate-tarball.sh @@ -5,12 +5,12 @@ name=qdox version="$(sed -n 's/Version:\s*//p' *.spec)" # RETRIEVE -wget "http://repo2.maven.org/maven2/com/thoughtworks/qdox/qdox/${version/'~'/'-'}/${name}-${version/'~'/'-'}-project.tar.gz" -O "${name}-${version}.orig.tar.gz" +wget "https://repo1.maven.org/maven2/com/thoughtworks/qdox/qdox/${version/'~'/'-'}/${name}-${version/'~'/'-'}-project.tar.gz" -O "${name}-${version}.orig.tar.gz" rm -rf tarball-tmp mkdir tarball-tmp -cd tarball-tmp -tar xf "../${name}-${version}.orig.tar.gz" +pushd tarball-tmp +tar -xf "../${name}-${version}.orig.tar.gz" # CLEAN TARBALL find -name '*.jar' -delete @@ -18,6 +18,6 @@ find -name '*.class' -delete # contains possibly proprietary binaries of YACC rm -r */bootstrap -tar cf "../${name}-${version}.tar.gz" * -cd .. +tar -czf "../${name}-${version}.tar.gz" * +popd rm -r tarball-tmp "${name}-${version}.orig.tar.gz" diff --git a/SOURCES/qdox-port-tests-to-java-21.patch b/SOURCES/qdox-port-tests-to-java-21.patch new file mode 100644 index 0000000..96d67d1 --- /dev/null +++ b/SOURCES/qdox-port-tests-to-java-21.patch @@ -0,0 +1,11 @@ +--- qdox-2.1.0/src/test/java/com/thoughtworks/qdox/JavaProjectBuilderTest.java~ 2024-07-04 11:31:50.910952394 +0200 ++++ qdox-2.1.0/src/test/java/com/thoughtworks/qdox/JavaProjectBuilderTest.java 2024-07-04 11:31:53.318965066 +0200 +@@ -319,7 +319,7 @@ + JavaClass list = builder.getClassByName("java.util.List"); + Assertions.assertTrue(list.isInterface()); + Assertions.assertNull(list.getSuperJavaClass()); +- Assertions.assertEquals("java.util.Collection", list.getImplements().get(0).getValue()); ++ Assertions.assertEquals("java.util.SequencedCollection", list.getImplements().get(0).getValue()); + } + + @Test diff --git a/SPECS/qdox.spec b/SPECS/qdox.spec index 089320a..7e525fc 100644 --- a/SPECS/qdox.spec +++ b/SPECS/qdox.spec @@ -1,12 +1,13 @@ -%global upstream_version %(echo %{version} | tr '~' '-') +%bcond_with bootstrap Name: qdox -Version: 2.0~M10 -Release: 2%{?dist} +Version: 2.1.0 +Release: 11%{?dist} Summary: Extract class/interface/method definitions from sources -License: ASL 2.0 +License: Apache-2.0 URL: https://github.com/paul-hammant/qdox BuildArch: noarch +ExclusiveArch: %{java_arches} noarch # ./generate-tarball.sh Source0: %{name}-%{version}.tar.gz @@ -14,16 +15,18 @@ Source1: qdox-MANIFEST.MF # Remove bundled binaries which are possibly proprietary Source2: generate-tarball.sh -Patch0: 0001-Port-to-JFlex-1.7.0.patch - -BuildRequires: maven-local -BuildRequires: mvn(org.apache.maven.plugins:maven-assembly-plugin) -BuildRequires: mvn(org.apache.maven.plugins:maven-invoker-plugin) -BuildRequires: mvn(org.codehaus.mojo:exec-maven-plugin) -BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:) +Patch: qdox-port-tests-to-java-21.patch BuildRequires: byaccj +%if %{with bootstrap} +BuildRequires: javapackages-bootstrap +%else +BuildRequires: maven-local BuildRequires: jflex +BuildRequires: mvn(org.assertj:assertj-core) +BuildRequires: mvn(org.junit.jupiter:junit-jupiter) +BuildRequires: mvn(org.mockito:mockito-core) +%endif %description QDox is a high speed, small footprint parser @@ -33,59 +36,156 @@ It is designed to be used by active code generators or documentation tools. %package javadoc -Summary: Javadoc for %{name} +Summary: API documentation for %{name} %description javadoc -API docs for %{name}. +API documentation for %{name}. %prep -%setup -q -n %{name}-%{upstream_version} -%patch0 -p1 +%autosetup -p1 + +# remove unnecessary dependency on parent POM +%pom_remove_parent # We don't need these plugins %pom_remove_plugin :animal-sniffer-maven-plugin +%pom_remove_plugin :maven-assembly-plugin %pom_remove_plugin :maven-failsafe-plugin -%pom_remove_plugin :maven-jflex-plugin +%pom_remove_plugin :maven-invoker-plugin +%pom_remove_plugin :jflex-maven-plugin %pom_remove_plugin :maven-enforcer-plugin +%pom_remove_plugin :exec-maven-plugin %mvn_file : %{name} %mvn_alias : qdox:qdox -%pom_xpath_set pom:workingDirectory '${basedir}/src/main/java/com/thoughtworks/qdox/parser/impl' - %build +%{?jpb_env} + # Generate scanners (upstream does this with maven-jflex-plugin) jflex -d src/main/java/com/thoughtworks/qdox/parser/impl src/grammar/lexer.flex jflex -d src/main/java/com/thoughtworks/qdox/parser/impl src/grammar/commentlexer.flex +# Generate parsers (upstream does this with exec-maven-plugin) +(cd ./src/main/java/com/thoughtworks/qdox/parser/impl + byaccj -v -Jnorun -Jnoconstruct -Jclass=DefaultJavaCommentParser -Jpackage=com.thoughtworks.qdox.parser.impl ../../../../../../../grammar/commentparser.y + byaccj -v -Jnorun -Jnoconstruct -Jclass=Parser -Jimplements=CommentHandler -Jsemantic=Value -Jpackage=com.thoughtworks.qdox.parser.impl -Jstack=500 ../../../../../../../grammar/parser.y +) + # Build artifact -%mvn_build -f -- -Dqdox.byaccj.executable=byaccj +%mvn_build -- -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8 # Inject OSGi manifests -jar ufm target/%{name}-%{upstream_version}.jar %{SOURCE1} +jar ufm target/%{name}-%{version}.jar %{SOURCE1} %install %mvn_install %files -f .mfiles -%doc LICENSE.txt README.md +%license LICENSE.txt +%doc README.md %files javadoc -f .mfiles-javadoc -%doc LICENSE.txt +%license LICENSE.txt %changelog +* Fri Nov 29 2024 Mikolaj Izdebski - 2.1.0-10 +- Update javapackages test plan to f42 + +* Fri Jul 19 2024 Fedora Release Engineering - 2.1.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Thu Jul 04 2024 Mikolaj Izdebski - 2.1.0-4 +- Enable upstream test suite + +* Tue Feb 27 2024 Jiri Vanek - 2.1.0-3 +- Rebuilt for java-21-openjdk as system jdk + +* Fri Feb 23 2024 Jiri Vanek - 2.1.0-2 +- bump of release for for java-21-openjdk as system jdk + +* Fri Feb 02 2024 Mikolaj Izdebski - 2.1.0-1 +- Update to upstream version 2.1.0 + +* Fri Jan 26 2024 Fedora Release Engineering - 2.0.3-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Jan 22 2024 Fedora Release Engineering - 2.0.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Sep 01 2023 Mikolaj Izdebski - 2.0.3-2 +- Convert License tag to SPDX format + +* Thu Aug 17 2023 Mikolaj Izdebski - 2.0.3-1 +- Update to upstream version 2.0.3 + +* Fri Jul 21 2023 Fedora Release Engineering - 2.0.0-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Fri Jan 20 2023 Fedora Release Engineering - 2.0.0-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Fri Jul 22 2022 Fedora Release Engineering - 2.0.0-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Sat Feb 05 2022 Jiri Vanek - 2.0.0-9 +- Rebuilt for java-17-openjdk as system jdk + +* Fri Jan 21 2022 Fedora Release Engineering - 2.0.0-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Tue Nov 02 2021 Mikolaj Izdebski - 2.0.0-7 +- Set explicit Java compiler source/target levels to 1.7 + +* Fri Jul 23 2021 Fedora Release Engineering - 2.0.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Mon May 17 2021 Mikolaj Izdebski - 2.0.0-5 +- Bootstrap build +- Non-bootstrap build + +* Wed Jan 27 2021 Fedora Release Engineering - 0:2.0.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering - 0:2.0.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Sat Jul 11 2020 Jiri Vanek - 0:2.0.0-2 +- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11 + +* Wed Feb 26 2020 Marian Koncek - 2.0.0-1 +- Update to upstream version 2.0.0 + +* Thu Feb 13 2020 Fabio Valentini - 0:2.0.0-1 +- Update to version 2.0.0. + +* Thu Jan 30 2020 Fedora Release Engineering - 0:2.0-8.M9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Nov 22 2019 Fabio Valentini - 0:2.0-7.M9 +- Remove unnecessary dependency on parent POM. + * Tue Nov 05 2019 Mikolaj Izdebski - 2.0~M10-2 - Mass rebuild for javapackages-tools 201902 * Wed Sep 18 2019 Marian Koncek - 2.0~M10-1 - Update to upstream version 2.0~M10 +* Sun Aug 18 2019 Fabio Valentini - 0:2.0-6.M9 +- Port to jflex 1.7.0. + +* Fri Jul 26 2019 Fedora Release Engineering - 0:2.0-5.M9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Fri Jun 07 2019 Mikolaj Izdebski - 2.0-5.M9 - Port to JFlex 1.7.0 * Fri May 24 2019 Mikolaj Izdebski - 2.0-4.M9 - Mass rebuild for javapackages-tools 201901 +* Sat Feb 02 2019 Fedora Release Engineering - 0:2.0-4.M9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Tue Jul 31 2018 Michael Simacek - 0:2.0-3.M9 - Repack tarball to remove possibly proprietary binaries