From d5e67fc06fc0a9cf351c2db3d9c942f14513c5af68dc1e7d56b8c3176815771e Mon Sep 17 00:00:00 2001 From: Gus Kenion Date: Tue, 15 Oct 2024 09:19:12 +0000 Subject: [PATCH 1/4] 1.9.1 OBS-URL: https://build.opensuse.org/package/show/Java:packages/jflex?expand=0&rev=47 --- .gitattributes | 23 +++++ .gitignore | 1 + _multibuild | 3 + jflex-1.8.2-generated-files.tar.xz | 3 + jflex-1.8.2-no-auto-value.patch | 19 ++++ jflex-1.8.2.tar.gz | 3 + jflex-1.9.1-generated-files.tar.xz | 3 + jflex-1.9.1-no-auto-value.patch | 20 ++++ jflex-1.9.1.tar.gz | 3 + jflex-bootstrap.changes | 115 +++++++++++++++++++++ jflex-bootstrap.spec | 149 +++++++++++++++++++++++++++ jflex-build.xml | 84 ++++++++++++++++ jflex.changes | 115 +++++++++++++++++++++ jflex.spec | 155 +++++++++++++++++++++++++++++ pre_checkin.sh | 14 +++ 15 files changed, 710 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 _multibuild create mode 100644 jflex-1.8.2-generated-files.tar.xz create mode 100644 jflex-1.8.2-no-auto-value.patch create mode 100644 jflex-1.8.2.tar.gz create mode 100644 jflex-1.9.1-generated-files.tar.xz create mode 100644 jflex-1.9.1-no-auto-value.patch create mode 100644 jflex-1.9.1.tar.gz create mode 100644 jflex-bootstrap.changes create mode 100644 jflex-bootstrap.spec create mode 100644 jflex-build.xml create mode 100644 jflex.changes create mode 100644 jflex.spec create mode 100644 pre_checkin.sh diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..93032d2 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + bootstrap + diff --git a/jflex-1.8.2-generated-files.tar.xz b/jflex-1.8.2-generated-files.tar.xz new file mode 100644 index 0000000..f5e26e6 --- /dev/null +++ b/jflex-1.8.2-generated-files.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d890172db8a2b5c581cc79012e17a64abfbe577aa01970972abe66900c5696f +size 33184 diff --git a/jflex-1.8.2-no-auto-value.patch b/jflex-1.8.2-no-auto-value.patch new file mode 100644 index 0000000..130ac4a --- /dev/null +++ b/jflex-1.8.2-no-auto-value.patch @@ -0,0 +1,19 @@ +--- jflex/src/main/java/jflex/base/IntPair.java ++++ jflex/src/main/java/jflex/base/IntPair.java +@@ -9,8 +9,6 @@ + + package jflex.base; + +-import com.google.auto.value.AutoValue; +- + /** + * Simple pair of integers. + * +@@ -19,7 +17,6 @@ import com.google.auto.value.AutoValue; + * @author Gerwin Klein + * @version JFlex 1.8.2 + */ +-@AutoValue + public abstract class IntPair { + + public abstract int start(); diff --git a/jflex-1.8.2.tar.gz b/jflex-1.8.2.tar.gz new file mode 100644 index 0000000..503d824 --- /dev/null +++ b/jflex-1.8.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a1e0d25e341d01de6b93ec32b45562905e69d06598113934b74f76b1be7927ab +size 4922218 diff --git a/jflex-1.9.1-generated-files.tar.xz b/jflex-1.9.1-generated-files.tar.xz new file mode 100644 index 0000000..796932f --- /dev/null +++ b/jflex-1.9.1-generated-files.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89a454e1ed10dbd2426e0ddf4f8bec520229fb292e7509196f7f5184f53cf04d +size 286720 diff --git a/jflex-1.9.1-no-auto-value.patch b/jflex-1.9.1-no-auto-value.patch new file mode 100644 index 0000000..ada7747 --- /dev/null +++ b/jflex-1.9.1-no-auto-value.patch @@ -0,0 +1,20 @@ +diff -urEbwB jflex-1.9.1.orig/src/main/java/jflex/base/IntPair.java jflex-1.9.1/src/main/java/jflex/base/IntPair.java +--- jflex-1.9.1.orig/src/main/java/jflex/base/IntPair.java 2024-10-15 11:01:17.724854292 +0200 ++++ jflex-1.9.1/src/main/java/jflex/base/IntPair.java 2024-10-15 11:02:56.115127297 +0200 +@@ -5,8 +5,6 @@ + + package jflex.base; + +-import com.google.auto.value.AutoValue; +- + /** + * Simple pair of integers. + * +@@ -15,7 +13,6 @@ + * @author Gerwin Klein + * @version JFlex 1.9.1 + */ +-@AutoValue + public abstract class IntPair { + + public abstract int start(); diff --git a/jflex-1.9.1.tar.gz b/jflex-1.9.1.tar.gz new file mode 100644 index 0000000..762e99f --- /dev/null +++ b/jflex-1.9.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e0c1e9eef91ff6df04d73fa5eaff13f3a02b679fee1474e5ccae007224df6df6 +size 4944916 diff --git a/jflex-bootstrap.changes b/jflex-bootstrap.changes new file mode 100644 index 0000000..b7a2c2b --- /dev/null +++ b/jflex-bootstrap.changes @@ -0,0 +1,115 @@ +------------------------------------------------------------------- +Wed Feb 21 22:06:45 UTC 2024 - Fridrich Strba + +- Use %patch -P N instead of deprecated %patchN. + +------------------------------------------------------------------- +Wed Oct 25 18:27:04 UTC 2023 - Fridrich Strba + +- Build with source and target levels 8 + +------------------------------------------------------------------- +Thu May 4 13:37:10 UTC 2023 - Frederic Crozat + +- Add _multibuild to define additional spec files as additional + flavors. + Eliminates the need for source package links in OBS. + +------------------------------------------------------------------- +Wed Mar 30 10:16:51 UTC 2022 - Fridrich Strba + +- Build against the standalone JavaEE modules unconditionally + +------------------------------------------------------------------- +Thu Mar 17 15:42:32 UTC 2022 - Fridrich Strba + +- Build against standalone glassfish-annotation-api for relevant + distribution versions that have JDK that does not contain the + JavaEE modules + +------------------------------------------------------------------- +Fri Jan 14 07:05:37 UTC 2022 - Fridrich Strba + +- Upgrade to version 1.8.2 + * fix build with recent java-cup +- Build the bootstrap package using ant with a generated build.xml +- Build the non-bootstrap package using maven, since its dependency + auto is already built with maven +- Added patch: + * jflex-1.8.2-no-auto-value.patch + + do not process auto-value-annotations in bootstrap build + + the generated file is pre-generated outside build for this + variant +- Removed patches: + * jflex-byaccj-utl.patch + * jflex-classpath.patch + * jflex-javac-no-target.patch + * jflex-junit4.patch + * jflex-no-cup-no-jflex.patch + + not needed in this version + +------------------------------------------------------------------- +Wed Oct 4 07:49:17 UTC 2017 - fstrba@suse.com + +- Removed a jflex-lex-scan.patch again, so that bot is happy + +------------------------------------------------------------------- +Tue Oct 3 17:31:18 UTC 2017 - fstrba@suse.com + +- Don't BuildRequire java-1_5_0-gcj-compat-devel, since it will be + soon gone; BuildRequire java-devel +- Build with java source and target level 1.6 to allow building + with jdk9 +- Sync the bootstrap and non-bootstrap spec files using the + jpackage-bootstrap-prepare.sh script and clean spec file + +------------------------------------------------------------------- +Mon Dec 2 12:44:19 UTC 2013 - mvyskocil@suse.com + +- conflict the non-bootstrap variant with the bootstrap variant + +------------------------------------------------------------------- +Thu Nov 14 12:31:24 UTC 2013 - mvyskocil@suse.com + +- Fix build with junit 4 + * jflex-junit4.patch + +------------------------------------------------------------------- +Mon Sep 9 11:06:00 UTC 2013 - tchvatal@suse.com + +- Move from jpackage-utils to javapackage-tools + +------------------------------------------------------------------- +Mon Aug 26 12:18:15 UTC 2013 - mvyskocil@suse.com + +- don't build tests when bootstrapping +- properly synchronized both spec files +- drop antlr-bootstrap dependency, it's pointless withouth javadoc + +------------------------------------------------------------------- +Fri Aug 23 09:06:21 UTC 2013 - mvyskocil@suse.com + +- don't build javadoc + +------------------------------------------------------------------- +Thu Feb 17 00:59:58 CET 2011 - mvyskocil@suse.cz + +- fix build with antlr-bootstrap + +------------------------------------------------------------------- +Thu May 21 17:11:33 CEST 2009 - mvyskocil@suse.cz + +- Removed a jflex-lex-scan.patch + +------------------------------------------------------------------- +Tue May 5 09:35:07 CEST 2009 - mvyskocil@suse.cz + +- Update to 1.4.3 (bugfix release) +- Build using java-1_5_0-gcj to allow openjdk bootstrap +- Recreated jflex-lex-scan.patch + +------------------------------------------------------------------- +Wed Apr 29 16:16:14 CEST 2009 - mvyskocil@suse.cz + +- Initial packaging of jflex-bootstrap 1.4.2 in SUSE (from jpp5) + diff --git a/jflex-bootstrap.spec b/jflex-bootstrap.spec new file mode 100644 index 0000000..85c8c38 --- /dev/null +++ b/jflex-bootstrap.spec @@ -0,0 +1,149 @@ +# +# spec file for package jflex-bootstrap +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +##### WARNING: please do not edit this auto generated spec file. Use the jflex.spec! ##### +%global with_bootstrap 1 +%bcond_with bootstrap +Name: jflex-bootstrap +Version: 1.8.2 +Release: 0 +Summary: Lexical Analyzer Generator for Java +License: BSD-3-Clause +Group: Development/Libraries/Java +URL: https://www.jflex.de/ +Source0: http://www.jflex.de/release/jflex-%{version}.tar.gz +Source1: jflex-%{version}-generated-files.tar.xz +Source2: jflex-build.xml +Patch0: jflex-1.8.2-no-auto-value.patch +BuildRequires: ant +BuildRequires: glassfish-annotation-api +BuildRequires: java-devel +BuildRequires: javapackages-local +Requires: java_cup +Requires: javapackages-tools +BuildArch: noarch +%if %{without bootstrap} +BuildRequires: fdupes +BuildRequires: java-cup +BuildRequires: jflex-bootstrap +BuildRequires: maven-local +BuildRequires: mvn(com.google.auto.value:auto-value) +BuildRequires: mvn(com.google.auto.value:auto-value-annotations) +Conflicts: jflex-bootstrap +%else +BuildRequires: java-cup-bootstrap +Conflicts: jflex +%endif + +%description +JFlex is a lexical analyzer generator for Java written in Java. It is +also a rewrite of the very useful tool JLex which was developed by +Elliot Berk at Princeton University. As Vern Paxson states for his C/C++ +tool flex: they do not share any code though. + +Design goals The main design goals of JFlex are: + + * Full unicode support + * Fast generated scanners + * Fast scanner generation + * Convenient specification syntax + * Platform independence + * JLex compatibility + +%if %without bootstrap +%package javadoc +Summary: API documentation for %{name} +Provides: %{name}-doc = %{version}-%{release} +Obsoletes: %{name}-doc < %{version}-%{release} + +%description javadoc +This package provides %{summary}. + +%endif + +%prep +%setup -q -n jflex-%{version} +find . -name '*.jar' -print -delete +find . -name '.gitignore' -print -delete +rm -rf src/generated +%pom_remove_plugin :jflex-maven-plugin +%pom_remove_plugin :cup-maven-plugin +%pom_remove_plugin :maven-shade-plugin +%pom_remove_plugin :jacoco-maven-plugin + +%pom_xpath_remove "pom:plugin[pom:artifactId='maven-site-plugin']" parent.xml +%pom_xpath_remove "pom:plugin[pom:artifactId='fmt-maven-plugin']" parent.xml +%pom_xpath_remove "pom:plugin[pom:artifactId='cup-maven-plugin']" parent.xml +%pom_xpath_remove "pom:plugin[pom:artifactId='maven-shade-plugin']" parent.xml +%pom_xpath_remove "pom:plugin[pom:artifactId='jacoco-maven-plugin']" parent.xml + +%pom_xpath_set pom:project/pom:properties/pom:jflex.jdk.version 1.8 parent.xml + +%if %{with bootstrap} +%setup -q -T -D -a 1 -n jflex-%{version} +cp %{SOURCE2} build.xml +mkdir -p lib +%patch -P 0 -p1 +build-jar-repository -s lib java-cup-runtime glassfish-annotation-api +%else +%{mvn_file} : %{name} JFlex +%endif + +%build +%if %{with bootstrap} +%{ant} package +%else +java-cup -parser LexParse -interface -destdir src/main/java src/main/cup/LexParse.cup +jflex -d src/main/java/jflex --skel src/main/jflex/skeleton.nested src/main/jflex/LexScan.flex +%{mvn_build} -f +%endif + +%install + +%if %{with bootstrap} +# jar +mkdir -p %{buildroot}%{_javadir} +cp -a target/jflex-%{version}.jar %{buildroot}%{_javadir}/jflex.jar + +# compatibility symlink +(cd %{buildroot}%{_javadir} && ln -s jflex.jar JFlex.jar) +%else +%mvn_install +%fdupes -s %{buildroot}/%{_javadocdir}/%{name} +%endif + +%jpackage_script jflex.Main "" "" jflex:java-cup jflex true + +%if %{with bootstrap} +%files +%{_javadir}/jflex.jar +%{_javadir}/JFlex.jar +%else + +%files -f .mfiles +%endif +%license src/main/resources/LICENSE_JFLEX +%doc README.md changelog.md +%attr(0755,root,root) %{_bindir}/jflex + +%if %without bootstrap +%files javadoc -f .mfiles-javadoc +%license src/main/resources/LICENSE_JFLEX +%endif + +%changelog diff --git a/jflex-build.xml b/jflex-build.xml new file mode 100644 index 0000000..cd1c4cc --- /dev/null +++ b/jflex-build.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jflex.changes b/jflex.changes new file mode 100644 index 0000000..b7a2c2b --- /dev/null +++ b/jflex.changes @@ -0,0 +1,115 @@ +------------------------------------------------------------------- +Wed Feb 21 22:06:45 UTC 2024 - Fridrich Strba + +- Use %patch -P N instead of deprecated %patchN. + +------------------------------------------------------------------- +Wed Oct 25 18:27:04 UTC 2023 - Fridrich Strba + +- Build with source and target levels 8 + +------------------------------------------------------------------- +Thu May 4 13:37:10 UTC 2023 - Frederic Crozat + +- Add _multibuild to define additional spec files as additional + flavors. + Eliminates the need for source package links in OBS. + +------------------------------------------------------------------- +Wed Mar 30 10:16:51 UTC 2022 - Fridrich Strba + +- Build against the standalone JavaEE modules unconditionally + +------------------------------------------------------------------- +Thu Mar 17 15:42:32 UTC 2022 - Fridrich Strba + +- Build against standalone glassfish-annotation-api for relevant + distribution versions that have JDK that does not contain the + JavaEE modules + +------------------------------------------------------------------- +Fri Jan 14 07:05:37 UTC 2022 - Fridrich Strba + +- Upgrade to version 1.8.2 + * fix build with recent java-cup +- Build the bootstrap package using ant with a generated build.xml +- Build the non-bootstrap package using maven, since its dependency + auto is already built with maven +- Added patch: + * jflex-1.8.2-no-auto-value.patch + + do not process auto-value-annotations in bootstrap build + + the generated file is pre-generated outside build for this + variant +- Removed patches: + * jflex-byaccj-utl.patch + * jflex-classpath.patch + * jflex-javac-no-target.patch + * jflex-junit4.patch + * jflex-no-cup-no-jflex.patch + + not needed in this version + +------------------------------------------------------------------- +Wed Oct 4 07:49:17 UTC 2017 - fstrba@suse.com + +- Removed a jflex-lex-scan.patch again, so that bot is happy + +------------------------------------------------------------------- +Tue Oct 3 17:31:18 UTC 2017 - fstrba@suse.com + +- Don't BuildRequire java-1_5_0-gcj-compat-devel, since it will be + soon gone; BuildRequire java-devel +- Build with java source and target level 1.6 to allow building + with jdk9 +- Sync the bootstrap and non-bootstrap spec files using the + jpackage-bootstrap-prepare.sh script and clean spec file + +------------------------------------------------------------------- +Mon Dec 2 12:44:19 UTC 2013 - mvyskocil@suse.com + +- conflict the non-bootstrap variant with the bootstrap variant + +------------------------------------------------------------------- +Thu Nov 14 12:31:24 UTC 2013 - mvyskocil@suse.com + +- Fix build with junit 4 + * jflex-junit4.patch + +------------------------------------------------------------------- +Mon Sep 9 11:06:00 UTC 2013 - tchvatal@suse.com + +- Move from jpackage-utils to javapackage-tools + +------------------------------------------------------------------- +Mon Aug 26 12:18:15 UTC 2013 - mvyskocil@suse.com + +- don't build tests when bootstrapping +- properly synchronized both spec files +- drop antlr-bootstrap dependency, it's pointless withouth javadoc + +------------------------------------------------------------------- +Fri Aug 23 09:06:21 UTC 2013 - mvyskocil@suse.com + +- don't build javadoc + +------------------------------------------------------------------- +Thu Feb 17 00:59:58 CET 2011 - mvyskocil@suse.cz + +- fix build with antlr-bootstrap + +------------------------------------------------------------------- +Thu May 21 17:11:33 CEST 2009 - mvyskocil@suse.cz + +- Removed a jflex-lex-scan.patch + +------------------------------------------------------------------- +Tue May 5 09:35:07 CEST 2009 - mvyskocil@suse.cz + +- Update to 1.4.3 (bugfix release) +- Build using java-1_5_0-gcj to allow openjdk bootstrap +- Recreated jflex-lex-scan.patch + +------------------------------------------------------------------- +Wed Apr 29 16:16:14 CEST 2009 - mvyskocil@suse.cz + +- Initial packaging of jflex-bootstrap 1.4.2 in SUSE (from jpp5) + diff --git a/jflex.spec b/jflex.spec new file mode 100644 index 0000000..c343779 --- /dev/null +++ b/jflex.spec @@ -0,0 +1,155 @@ +# +# spec file for package jflex +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "bootstrap" +%bcond_without bootstrap +%else +%bcond_with bootstrap +%endif +%if %{with bootstrap} +Name: jflex-bootstrap +%else +Name: jflex +%endif +Version: 1.9.1 +Release: 0 +Summary: Lexical Analyzer Generator for Java +License: BSD-3-Clause +Group: Development/Libraries/Java +URL: https://www.jflex.de/ +Source0: https://github.com/jflex-de/jflex/releases/download/v%{version}/jflex-%{version}.tar.gz +Source1: jflex-%{version}-generated-files.tar.xz +Source2: jflex-build.xml +Patch0: jflex-1.9.1-no-auto-value.patch +BuildRequires: ant +BuildRequires: glassfish-annotation-api +BuildRequires: java-devel +BuildRequires: javapackages-local +BuildRequires: jsr-305 +Requires: java_cup +Requires: javapackages-tools +BuildArch: noarch +%if %{without bootstrap} +BuildRequires: fdupes +BuildRequires: java-cup +BuildRequires: jflex-bootstrap +BuildRequires: maven-local +BuildRequires: mvn(com.google.auto.value:auto-value) +BuildRequires: mvn(com.google.auto.value:auto-value-annotations) +Conflicts: jflex-bootstrap +%else +BuildRequires: java-cup-bootstrap +Conflicts: jflex +%endif + +%description +JFlex is a lexical analyzer generator for Java written in Java. It is +also a rewrite of the very useful tool JLex which was developed by +Elliot Berk at Princeton University. As Vern Paxson states for his C/C++ +tool flex: they do not share any code though. + +Design goals The main design goals of JFlex are: + + * Full unicode support + * Fast generated scanners + * Fast scanner generation + * Convenient specification syntax + * Platform independence + * JLex compatibility + +%if %without bootstrap +%package javadoc +Summary: API documentation for %{name} +Provides: %{name}-doc = %{version}-%{release} +Obsoletes: %{name}-doc < %{version}-%{release} + +%description javadoc +This package provides %{summary}. + +%endif + +%prep +%setup -q -n jflex-%{version} +find . -name '*.jar' -print -delete +find . -name '.gitignore' -print -delete +rm -rf src/generated +%pom_remove_plugin :jflex-maven-plugin +%pom_remove_plugin :cup-maven-plugin +%pom_remove_plugin :maven-shade-plugin + +%pom_xpath_remove "pom:plugin[pom:artifactId='maven-site-plugin']" parent.xml +%pom_xpath_remove "pom:plugin[pom:artifactId='fmt-maven-plugin']" parent.xml +%pom_xpath_remove "pom:plugin[pom:artifactId='cup-maven-plugin']" parent.xml +%pom_xpath_remove "pom:plugin[pom:artifactId='maven-shade-plugin']" parent.xml + +%pom_xpath_set pom:project/pom:properties/pom:jflex.jdk.version 1.8 parent.xml + +%if %{with bootstrap} +%setup -q -T -D -a 1 -n jflex-%{version} +cp %{SOURCE2} build.xml +mkdir -p lib +%patch -P 0 -p1 +build-jar-repository -s lib jsr-305 java-cup-runtime glassfish-annotation-api +%else +%{mvn_file} : %{name} JFlex +%endif + +%build +%if %{with bootstrap} +ant -Dproject.version=%{version} package +%else +java-cup -parser LexParse -interface -destdir src/main/java src/main/cup/LexParse.cup +jflex -d src/main/java/jflex --skel src/main/jflex/skeleton.nested src/main/jflex/LexScan.flex +%{mvn_build} -f +%endif + +%install + +%if %{with bootstrap} +# jar +mkdir -p %{buildroot}%{_javadir} +cp -a target/jflex-%{version}.jar %{buildroot}%{_javadir}/jflex.jar + +# compatibility symlink +(cd %{buildroot}%{_javadir} && ln -s jflex.jar JFlex.jar) +%else +%mvn_install +%fdupes -s %{buildroot}/%{_javadocdir}/%{name} +%endif + +%jpackage_script jflex.Main "" "" jflex:java-cup jflex true + +%if %{with bootstrap} +%files +%{_javadir}/jflex.jar +%{_javadir}/JFlex.jar +%else + +%files -f .mfiles +%endif +%license src/main/resources/LICENSE_JFLEX +%doc README.md changelog.md +%attr(0755,root,root) %{_bindir}/jflex + +%if %without bootstrap +%files javadoc -f .mfiles-javadoc +%license src/main/resources/LICENSE_JFLEX +%endif + +%changelog diff --git a/pre_checkin.sh b/pre_checkin.sh new file mode 100644 index 0000000..270ba2a --- /dev/null +++ b/pre_checkin.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +NAME1=jflex +NAME2=jflex-bootstrap +COPY_CHANGES=true + +EDIT_WARNING="##### WARNING: please do not edit this auto generated spec file. Use the ${NAME1}.spec! #####\n" +sed "s/^%global _without_bootstrap.*$/${EDIT_WARNING}%global with_bootstrap 1/; + s/^\(Name:.*\)$/\1-bootstrap/; + " < ${NAME1}.spec > ${NAME2:-${NAME1}-bootstrap}.spec + +if ${COPY_CHANGES}; then + cp ${NAME1}.changes ${NAME2:-${NAME1}-bootstrap}.changes +fi From 8d596fb6ab017096235f47b963758f0a0e1abb7a7afa6414dbaee153dcd93680 Mon Sep 17 00:00:00 2001 From: Gus Kenion Date: Tue, 15 Oct 2024 10:59:44 +0000 Subject: [PATCH 2/4] OBS-URL: https://build.opensuse.org/package/show/Java:packages/jflex?expand=0&rev=48 --- _service | 15 ++++++++ jflex-1.9.1-generated-files.tar.xz | 4 +- jflex-1.9.1-no-auto-value.patch | 4 +- jflex-1.9.1.tar.gz | 3 -- jflex-1.9.1.tar.xz | 3 ++ jflex-build.xml | 2 +- jflex.spec | 61 ++++++++++++++++++++---------- 7 files changed, 64 insertions(+), 28 deletions(-) create mode 100644 _service delete mode 100644 jflex-1.9.1.tar.gz create mode 100644 jflex-1.9.1.tar.xz diff --git a/_service b/_service new file mode 100644 index 0000000..fd14b20 --- /dev/null +++ b/_service @@ -0,0 +1,15 @@ + + + git + https://github.com/jflex-de/jflex.git + v1.9.1 + v* + @PARENT_TAG@ + v(.*) + + + *.tar + xz + + + diff --git a/jflex-1.9.1-generated-files.tar.xz b/jflex-1.9.1-generated-files.tar.xz index 796932f..b8374d3 100644 --- a/jflex-1.9.1-generated-files.tar.xz +++ b/jflex-1.9.1-generated-files.tar.xz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:89a454e1ed10dbd2426e0ddf4f8bec520229fb292e7509196f7f5184f53cf04d -size 286720 +oid sha256:bbc9735a3d7ccfb857b1d52b65356e22563893cf6b738186fb662ba2534772bd +size 34996 diff --git a/jflex-1.9.1-no-auto-value.patch b/jflex-1.9.1-no-auto-value.patch index ada7747..af27c6c 100644 --- a/jflex-1.9.1-no-auto-value.patch +++ b/jflex-1.9.1-no-auto-value.patch @@ -1,6 +1,6 @@ diff -urEbwB jflex-1.9.1.orig/src/main/java/jflex/base/IntPair.java jflex-1.9.1/src/main/java/jflex/base/IntPair.java ---- jflex-1.9.1.orig/src/main/java/jflex/base/IntPair.java 2024-10-15 11:01:17.724854292 +0200 -+++ jflex-1.9.1/src/main/java/jflex/base/IntPair.java 2024-10-15 11:02:56.115127297 +0200 +--- jflex-1.9.1.orig/jflex/src/main/java/jflex/base/IntPair.java 2024-10-15 11:01:17.724854292 +0200 ++++ jflex-1.9.1/jflex/src/main/java/jflex/base/IntPair.java 2024-10-15 11:02:56.115127297 +0200 @@ -5,8 +5,6 @@ package jflex.base; diff --git a/jflex-1.9.1.tar.gz b/jflex-1.9.1.tar.gz deleted file mode 100644 index 762e99f..0000000 --- a/jflex-1.9.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e0c1e9eef91ff6df04d73fa5eaff13f3a02b679fee1474e5ccae007224df6df6 -size 4944916 diff --git a/jflex-1.9.1.tar.xz b/jflex-1.9.1.tar.xz new file mode 100644 index 0000000..d277a1c --- /dev/null +++ b/jflex-1.9.1.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6075bf194dff4c6b14d258a12bfbd2381749c922ebb8e15fcbba6c1e3ab17120 +size 3150432 diff --git a/jflex-build.xml b/jflex-build.xml index cd1c4cc..ebda9d7 100644 --- a/jflex-build.xml +++ b/jflex-build.xml @@ -25,7 +25,7 @@ - + diff --git a/jflex.spec b/jflex.spec index c343779..c2a3bdf 100644 --- a/jflex.spec +++ b/jflex.spec @@ -33,7 +33,7 @@ Summary: Lexical Analyzer Generator for Java License: BSD-3-Clause Group: Development/Libraries/Java URL: https://www.jflex.de/ -Source0: https://github.com/jflex-de/jflex/releases/download/v%{version}/jflex-%{version}.tar.gz +Source0: jflex-%{version}.tar.xz Source1: jflex-%{version}-generated-files.tar.xz Source2: jflex-build.xml Patch0: jflex-1.9.1-no-auto-value.patch @@ -52,6 +52,7 @@ BuildRequires: jflex-bootstrap BuildRequires: maven-local BuildRequires: mvn(com.google.auto.value:auto-value) BuildRequires: mvn(com.google.auto.value:auto-value-annotations) +BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin) Conflicts: jflex-bootstrap %else BuildRequires: java-cup-bootstrap @@ -74,6 +75,19 @@ Design goals The main design goals of JFlex are: * JLex compatibility %if %without bootstrap +%package maven-plugin +Summary: JFlex Maven Plugin + +%description maven-plugin +This is a Maven 3 plugin to generate Lexer code in Java from +a Lexer specification, using JFlex. + +%package -n cup-maven-plugin +Summary: CUP Maven plugin + +%description -n cup-maven-plugin +A plugin to generate Java parsers with CUP. + %package javadoc Summary: API documentation for %{name} Provides: %{name}-doc = %{version}-%{release} @@ -89,34 +103,36 @@ This package provides %{summary}. find . -name '*.jar' -print -delete find . -name '.gitignore' -print -delete rm -rf src/generated -%pom_remove_plugin :jflex-maven-plugin -%pom_remove_plugin :cup-maven-plugin -%pom_remove_plugin :maven-shade-plugin +%pom_remove_plugin :jflex-maven-plugin jflex +%pom_remove_plugin -r :cup-maven-plugin +%pom_remove_plugin -r :maven-shade-plugin +%pom_remove_plugin -r :maven-site-plugin +%pom_remove_plugin -r :fmt-maven-plugin +%pom_remove_plugin -r :maven-enforcer-plugin -%pom_xpath_remove "pom:plugin[pom:artifactId='maven-site-plugin']" parent.xml -%pom_xpath_remove "pom:plugin[pom:artifactId='fmt-maven-plugin']" parent.xml -%pom_xpath_remove "pom:plugin[pom:artifactId='cup-maven-plugin']" parent.xml -%pom_xpath_remove "pom:plugin[pom:artifactId='maven-shade-plugin']" parent.xml +%pom_xpath_set pom:project/pom:properties/pom:jflex.jdk.version 1.8 -%pom_xpath_set pom:project/pom:properties/pom:jflex.jdk.version 1.8 parent.xml +%pom_disable_module benchmark +%pom_disable_module testsuite %if %{with bootstrap} %setup -q -T -D -a 1 -n jflex-%{version} -cp %{SOURCE2} build.xml +cp %{SOURCE2} jflex/build.xml mkdir -p lib %patch -P 0 -p1 build-jar-repository -s lib jsr-305 java-cup-runtime glassfish-annotation-api %else -%{mvn_file} : %{name} JFlex +%{mvn_file} :jflex %{name} JFlex +%{mvn_package} :jflex-parent __noinstall %endif %build %if %{with bootstrap} -ant -Dproject.version=%{version} package +ant -Dproject.version=%{version} -f jflex/build.xml package %else -java-cup -parser LexParse -interface -destdir src/main/java src/main/cup/LexParse.cup -jflex -d src/main/java/jflex --skel src/main/jflex/skeleton.nested src/main/jflex/LexScan.flex -%{mvn_build} -f +java-cup -parser LexParse -interface -destdir jflex/src/main/java jflex/src/main/cup/LexParse.cup +jflex -d jflex/src/main/java/jflex --skel jflex/src/main/jflex/skeleton.nested jflex/src/main/jflex/LexScan.flex +%{mvn_build} -fs %endif %install @@ -124,7 +140,7 @@ jflex -d src/main/java/jflex --skel src/main/jflex/skeleton.nested src/main/jfle %if %{with bootstrap} # jar mkdir -p %{buildroot}%{_javadir} -cp -a target/jflex-%{version}.jar %{buildroot}%{_javadir}/jflex.jar +cp -a jflex/target/jflex-%{version}.jar %{buildroot}%{_javadir}/jflex.jar # compatibility symlink (cd %{buildroot}%{_javadir} && ln -s jflex.jar JFlex.jar) @@ -141,15 +157,20 @@ cp -a target/jflex-%{version}.jar %{buildroot}%{_javadir}/jflex.jar %{_javadir}/JFlex.jar %else -%files -f .mfiles +%files -f .mfiles-jflex %endif -%license src/main/resources/LICENSE_JFLEX -%doc README.md changelog.md +%license LICENSE.md +%doc README.md %attr(0755,root,root) %{_bindir}/jflex %if %without bootstrap +%files maven-plugin -f .mfiles-jflex-maven-plugin +%doc jflex-maven-plugin/README.md + +%files -n cup-maven-plugin -f .mfiles-cup-maven-plugin + %files javadoc -f .mfiles-javadoc -%license src/main/resources/LICENSE_JFLEX +%license LICENSE.md %endif %changelog From adfae6651ac3c6c5ebae78abba1909d62d134ddaf5d9719f5237122961f54744 Mon Sep 17 00:00:00 2001 From: Gus Kenion Date: Tue, 15 Oct 2024 11:26:27 +0000 Subject: [PATCH 3/4] changelog OBS-URL: https://build.opensuse.org/package/show/Java:packages/jflex?expand=0&rev=49 --- jflex.changes | 41 +++++++++++++++++++++++++++++++++++++++++ jflex.spec | 4 ++++ 2 files changed, 45 insertions(+) diff --git a/jflex.changes b/jflex.changes index b7a2c2b..e477933 100644 --- a/jflex.changes +++ b/jflex.changes @@ -1,3 +1,44 @@ +------------------------------------------------------------------- +Tue Oct 15 11:15:12 UTC 2024 - Gus Kenion + +- Upgrade to 1.9.1 + * JFlex 1.9.1 is a small bugfix release: + * fix negated char classes with overlapping content + (#1065, #1066): Expressions such as [^\s\n] were translated + incorrectly, because \s and \n overlap and the negation + operator ^ in version 1.9.0 did not handle this case correctly. + +- Includes changes from 1.9.0 + * JFlex 1.9.0 is a feature release with slight performance + improvements in the scanning engine. It also fixes all known + bugs of version 1.8.2. + * New features + + add optional token limit size (#1045, #197) + + warn for unicode escapes that are too long (#1042) + + directives and command line switches for enabling/disabling + JFlex warnings (#1020) + + allow custom annotations such as @SuppressWarnings + (#1027, #762) + + increase maximum supported DFA size to about 2^32 states + (#1003, #952) + + better error reporting for character classes (#996, #888, #939) + + allow comments after %yylexthrow (#794) + + make maven build reproducible (#765) + * Fixed bugs + + make character classes more robust (#985, #974, #986) + + fix NullPointerException when generating dot files (#769) + * Other + + update dependencies + + more and better property-based tests (#953) + + use SPDX license identifiers + + avoid use of createTempDir() (was used in tests only) + + migrate CI to GitHub actions + + migrate most tests to bazel + + improve test suite to work on non-US locales + + fix example file name for minijava example + + improved simple.flex example + + ------------------------------------------------------------------- Wed Feb 21 22:06:45 UTC 2024 - Fridrich Strba diff --git a/jflex.spec b/jflex.spec index c2a3bdf..9114eb8 100644 --- a/jflex.spec +++ b/jflex.spec @@ -52,7 +52,11 @@ BuildRequires: jflex-bootstrap BuildRequires: maven-local BuildRequires: mvn(com.google.auto.value:auto-value) BuildRequires: mvn(com.google.auto.value:auto-value-annotations) +BuildRequires: mvn(com.google.guava:guava) +BuildRequires: mvn(org.apache.maven.plugin-tools:maven-plugin-annotations) BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin) +BuildRequires: mvn(org.apache.maven:maven-core) +BuildRequires: mvn(org.apache.maven:maven-plugin-api) Conflicts: jflex-bootstrap %else BuildRequires: java-cup-bootstrap From 1a165e8ef9150ed4b6315d002a3b92fac54861a488dfefab84b48acad2c3efdb Mon Sep 17 00:00:00 2001 From: Gus Kenion Date: Fri, 18 Oct 2024 10:06:16 +0000 Subject: [PATCH 4/4] changelog OBS-URL: https://build.opensuse.org/package/show/Java:packages/jflex?expand=0&rev=50 --- jflex.changes | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/jflex.changes b/jflex.changes index e477933..daeee36 100644 --- a/jflex.changes +++ b/jflex.changes @@ -7,7 +7,6 @@ Tue Oct 15 11:15:12 UTC 2024 - Gus Kenion (#1065, #1066): Expressions such as [^\s\n] were translated incorrectly, because \s and \n overlap and the negation operator ^ in version 1.9.0 did not handle this case correctly. - - Includes changes from 1.9.0 * JFlex 1.9.0 is a feature release with slight performance improvements in the scanning engine. It also fixes all known @@ -37,7 +36,13 @@ Tue Oct 15 11:15:12 UTC 2024 - Gus Kenion + improve test suite to work on non-US locales + fix example file name for minijava example + improved simple.flex example - +- Remove jflex-1.8.2-no-auto-value.patch (not applicable to + versions newer than 1.8.2) +- Add jflex-1.9.1-no-auto-value.patch +- Merge multibuild logic into single .spec file + * remove jflex-bootstrap.spec + * remove jflex-bootstrap.changes + * remove pre-checkin.sh ------------------------------------------------------------------- Wed Feb 21 22:06:45 UTC 2024 - Fridrich Strba