From 6df781495dd6a2020afc3cecff7cc0fcd6cfd5f83399841e8432ff0f10b1073f Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Thu, 17 May 2018 20:03:41 +0000 Subject: [PATCH 1/6] OBS-URL: https://build.opensuse.org/package/show/Java:packages/jflex?expand=0&rev=21 --- jflex-bootstrap.spec | 4 ++-- jflex.spec | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/jflex-bootstrap.spec b/jflex-bootstrap.spec index b692222..6ac7ce4 100644 --- a/jflex-bootstrap.spec +++ b/jflex-bootstrap.spec @@ -1,7 +1,7 @@ # # spec file for package jflex-bootstrap # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -29,7 +29,7 @@ Name: jflex-bootstrap Version: 1.4.3 Release: 0 Summary: Lexical Analyzer Generator for Java -License: GPL-2.0+ +License: GPL-2.0-or-later Group: Development/Libraries/Java Url: http://www.jflex.de/ Source0: http://www.jflex.de/jflex-%{version}.tar.bz2 diff --git a/jflex.spec b/jflex.spec index edc5e6b..7a6ba31 100644 --- a/jflex.spec +++ b/jflex.spec @@ -1,7 +1,7 @@ # # spec file for package jflex # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -28,7 +28,7 @@ Name: jflex Version: 1.4.3 Release: 0 Summary: Lexical Analyzer Generator for Java -License: GPL-2.0+ +License: GPL-2.0-or-later Group: Development/Libraries/Java Url: http://www.jflex.de/ Source0: http://www.jflex.de/jflex-%{version}.tar.bz2 From 314cd526e434877a59dcdbf9b49c9aeb8c72953974542fcda73a6a21a3e27c2f Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Thu, 7 Feb 2019 08:02:00 +0000 Subject: [PATCH 2/6] OBS-URL: https://build.opensuse.org/package/show/Java:packages/jflex?expand=0&rev=22 --- jflex-bootstrap.spec | 4 ++-- jflex.spec | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/jflex-bootstrap.spec b/jflex-bootstrap.spec index 6ac7ce4..b692222 100644 --- a/jflex-bootstrap.spec +++ b/jflex-bootstrap.spec @@ -1,7 +1,7 @@ # # spec file for package jflex-bootstrap # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -29,7 +29,7 @@ Name: jflex-bootstrap Version: 1.4.3 Release: 0 Summary: Lexical Analyzer Generator for Java -License: GPL-2.0-or-later +License: GPL-2.0+ Group: Development/Libraries/Java Url: http://www.jflex.de/ Source0: http://www.jflex.de/jflex-%{version}.tar.bz2 diff --git a/jflex.spec b/jflex.spec index 7a6ba31..edc5e6b 100644 --- a/jflex.spec +++ b/jflex.spec @@ -1,7 +1,7 @@ # # spec file for package jflex # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -28,7 +28,7 @@ Name: jflex Version: 1.4.3 Release: 0 Summary: Lexical Analyzer Generator for Java -License: GPL-2.0-or-later +License: GPL-2.0+ Group: Development/Libraries/Java Url: http://www.jflex.de/ Source0: http://www.jflex.de/jflex-%{version}.tar.bz2 From cc83dabf7931d9fcacef27576fde7f07d396cda723262a1fff341dbd23cdf752 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Wed, 12 Jan 2022 10:38:26 +0000 Subject: [PATCH 3/6] OBS-URL: https://build.opensuse.org/package/show/Java:packages/jflex?expand=0&rev=23 --- jflex-1.4.3.tar.bz2 | 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-bootstrap.spec | 151 +++++++++++++---------------- jflex-build.xml | 84 ++++++++++++++++ jflex-byaccj-utl.patch | 13 --- jflex-classpath.patch | 47 --------- jflex-javac-no-target.patch | 11 --- jflex-junit4.patch | 13 --- jflex-no-cup-no-jflex.patch | 57 ----------- jflex.spec | 151 +++++++++++++---------------- jpackage-bootstrap-prepare.sh | 36 ------- pre_checkin.sh | 14 +++ 14 files changed, 261 insertions(+), 344 deletions(-) delete mode 100644 jflex-1.4.3.tar.bz2 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-build.xml delete mode 100644 jflex-byaccj-utl.patch delete mode 100644 jflex-classpath.patch delete mode 100644 jflex-javac-no-target.patch delete mode 100644 jflex-junit4.patch delete mode 100644 jflex-no-cup-no-jflex.patch delete mode 100644 jpackage-bootstrap-prepare.sh create mode 100644 pre_checkin.sh diff --git a/jflex-1.4.3.tar.bz2 b/jflex-1.4.3.tar.bz2 deleted file mode 100644 index c40ff08..0000000 --- a/jflex-1.4.3.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5837eb7c72c265dacc638ad29f6df6da2161247130b34846a6955e131ee08f31 -size 1188715 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-bootstrap.spec b/jflex-bootstrap.spec index b692222..7e8f979 100644 --- a/jflex-bootstrap.spec +++ b/jflex-bootstrap.spec @@ -1,7 +1,7 @@ # # spec file for package jflex-bootstrap # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,46 +12,40 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # -%define with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}} -%define without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}} -%define bcond_with() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}} -%define bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}} ##### WARNING: please do not edit this auto generated spec file. Use the jflex.spec! ##### -%define with_bootstrap 1 -%define section free +%global with_bootstrap 1 +%bcond_with bootstrap Name: jflex-bootstrap -# This line is not a comment, please do not remove it! -#%(sh %{_sourcedir}/jpackage-bootstrap-prepare.sh %{_sourcedir} %{name}) -Version: 1.4.3 +Version: 1.8.2 Release: 0 Summary: Lexical Analyzer Generator for Java -License: GPL-2.0+ +License: BSD-3-Clause Group: Development/Libraries/Java -Url: http://www.jflex.de/ -Source0: http://www.jflex.de/jflex-%{version}.tar.bz2 -Source1: jflex.script -Source100: jpackage-bootstrap-prepare.sh -Patch0: jflex-javac-no-target.patch -Patch1: jflex-no-cup-no-jflex.patch -Patch2: jflex-classpath.patch -Patch4: jflex-byaccj-utl.patch -#PATCH-FIX-OPENSUSE: make AllTests.main empty, code was not compatible with junit 4 -Patch5: jflex-junit4.patch +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: java-cup-bootstrap BuildRequires: java-devel +BuildRequires: javapackages-local Requires: java_cup Requires: javapackages-tools BuildArch: noarch -%if %without bootstrap +%if %{without bootstrap} +BuildRequires: fdupes +BuildRequires: java-cup BuildRequires: jflex-bootstrap -BuildRequires: junit +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 @@ -71,89 +65,82 @@ Design goals The main design goals of JFlex are: * JLex compatibility %if %without bootstrap -%package doc -Summary: Documentation and examples for %{name} -Group: Development/Libraries/Java +%package javadoc +Summary: API documentation for %{name} +Provides: %{name}-doc = %{version}-%{release} +Obsoletes: %{name}-doc < %{version}-%{release} -%description doc -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. +%description javadoc +This package provides %{summary}. -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 - -This package contains documentation and examples for %{name} %endif %prep %setup -q -n jflex-%{version} -perl -pi -e 's/\r$//g' examples/standalone/sample.inp -rm -rf src/java_cup -find . -name '*.jar' | xargs -t rm -%if %without bootstrap -export CLASSPATH=$(build-classpath java-cup java-cup-runtime junit jflex) -export OPT_JAR_LIST=: -pushd src -%{ant} realclean -%{ant} -Dant.build.javac.source=1.6 -Dant.build.javac.target=1.6 jflex -popd -%endif +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 + +%if %{with bootstrap} +%setup -q -T -D -a 1 -n jflex-%{version} +cp %{SOURCE2} build.xml %patch0 -p1 - -%if %with bootstrap -%patch1 -p1 - -echo `pwd` -rm -rf src/JFlex/tests -%else # with bootstrap -# You must use Re jflex.spec and have a java-cup and jflex installed -%patch2 -p1 -%patch4 -p1 -%patch5 -p1 +mkdir -p lib +build-jar-repository -s lib java-cup-runtime +%else +%{mvn_file} : %{name} JFlex %endif %build -pushd src -%if %without bootstrap -export CLASSPATH=$(build-classpath java-cup java-cup-runtime junit jflex antlr-bootstrap) +%if %{with bootstrap} +%{ant} package %else -export CLASSPATH=$(build-classpath java-cup java-cup-runtime junit antlr-bootstrap) +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 -export OPT_JAR_LIST=: -echo `pwd` -%{ant} -Dant.build.javac.source=1.6 -Dant.build.javac.target=1.6 jar -popd %install + +%if %{with bootstrap} # jar mkdir -p %{buildroot}%{_javadir} -cp -a lib/JFlex.jar %{buildroot}%{_javadir}/jflex-%{version}.jar -(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do ln -s ${jar} `echo $jar| sed "s|-%{version}||g"`; done) +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 -mkdir -p %{buildroot}%{_bindir} -install -p -m 0755 %{SOURCE1} %{buildroot}%{_bindir}/jflex +%jpackage_script jflex.Main "" "" jflex:java-cup jflex true +%if %{with bootstrap} %files -%doc COPYRIGHT src/README src/changelog -%attr(0755,root,root) %{_bindir}/jflex %{_javadir}/jflex.jar -%{_javadir}/jflex-%{version}.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 doc -%doc examples doc +%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..61556a1 --- /dev/null +++ b/jflex-build.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jflex-byaccj-utl.patch b/jflex-byaccj-utl.patch deleted file mode 100644 index a3f12d8..0000000 --- a/jflex-byaccj-utl.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- jflex/examples/byaccj/README.orig 2003-01-07 16:30:17.000000000 +0100 -+++ jflex/examples/byaccj/README 2005-10-06 21:08:38.000000000 +0200 -@@ -1,8 +1,8 @@ - This directory contains an interoperability example for BYacc/J and JFlex - (a small calculator) - --You need the parser generator byacc/j from --http://troi.lincom-asg.com/~rjamison/byacc/ -+You need the parser generator byacc/j from -+http://byaccj.sourceforge.net/ - for this example to work (version byacc/j 1.1 has been tested). - - Use the Makefile to generate the lexer and parser. diff --git a/jflex-classpath.patch b/jflex-classpath.patch deleted file mode 100644 index 4d3ba2c..0000000 --- a/jflex-classpath.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- jflex-1.4.2/src/build.xml.orig 2008-08-07 13:01:10.926485858 -0400 -+++ jflex-1.4.2/src/build.xml 2008-08-07 13:03:33.725486421 -0400 -@@ -7,10 +7,10 @@ - - - -- -+ - - -- -+ - - - -@@ -28,12 +28,16 @@ - - - -+ - - - -+ - - - -@@ -41,12 +45,14 @@ - - - -+ - - - diff --git a/jflex-javac-no-target.patch b/jflex-javac-no-target.patch deleted file mode 100644 index 636bda1..0000000 --- a/jflex-javac-no-target.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- jflex-1.4.2/src/build.xml.orig 2008-05-28 04:54:17.000000000 -0400 -+++ jflex-1.4.2/src/build.xml 2008-08-07 13:00:25.977345228 -0400 -@@ -64,8 +64,6 @@ - description="compile all classes"> - - diff --git a/jflex-junit4.patch b/jflex-junit4.patch deleted file mode 100644 index ad2a1fd..0000000 --- a/jflex-junit4.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: jflex-1.4.3/src/JFlex/tests/AllTests.java -=================================================================== ---- jflex-1.4.3.orig/src/JFlex/tests/AllTests.java -+++ jflex-1.4.3/src/JFlex/tests/AllTests.java -@@ -32,7 +32,7 @@ import junit.framework.TestSuite; - public class AllTests { - - public static void main(String[] args) { -- junit.textui.TestRunner.run(AllTests.class); -+ //junit.textui.TestRunner.run(AllTests.class); - } - - public static Test suite() { diff --git a/jflex-no-cup-no-jflex.patch b/jflex-no-cup-no-jflex.patch deleted file mode 100644 index 1658c78..0000000 --- a/jflex-no-cup-no-jflex.patch +++ /dev/null @@ -1,57 +0,0 @@ ---- jflex-1.4.2/src/build.xml.orig 2008-08-07 13:13:24.346611761 -0400 -+++ jflex-1.4.2/src/build.xml 2008-08-07 13:14:15.625486402 -0400 -@@ -28,12 +28,13 @@ - - - -- - - - -+ - - - -@@ -41,12 +42,14 @@ - - - -+ - - - -@@ -60,7 +63,7 @@ - - -- - - - -+ - - - diff --git a/jflex.spec b/jflex.spec index edc5e6b..44d63b1 100644 --- a/jflex.spec +++ b/jflex.spec @@ -1,7 +1,7 @@ # # spec file for package jflex # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,45 +12,39 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # -%define with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}} -%define without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}} -%define bcond_with() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}} -%define bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}} -%define _without_bootstrap 1 -%define section free +%global _without_bootstrap 1 +%bcond_with bootstrap Name: jflex -# This line is not a comment, please do not remove it! -#%(sh %{_sourcedir}/jpackage-bootstrap-prepare.sh %{_sourcedir} %{name}) -Version: 1.4.3 +Version: 1.8.2 Release: 0 Summary: Lexical Analyzer Generator for Java -License: GPL-2.0+ +License: BSD-3-Clause Group: Development/Libraries/Java -Url: http://www.jflex.de/ -Source0: http://www.jflex.de/jflex-%{version}.tar.bz2 -Source1: jflex.script -Source100: jpackage-bootstrap-prepare.sh -Patch0: jflex-javac-no-target.patch -Patch1: jflex-no-cup-no-jflex.patch -Patch2: jflex-classpath.patch -Patch4: jflex-byaccj-utl.patch -#PATCH-FIX-OPENSUSE: make AllTests.main empty, code was not compatible with junit 4 -Patch5: jflex-junit4.patch +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: java-cup-bootstrap BuildRequires: java-devel +BuildRequires: javapackages-local Requires: java_cup Requires: javapackages-tools BuildArch: noarch -%if %without bootstrap +%if %{without bootstrap} +BuildRequires: fdupes +BuildRequires: java-cup BuildRequires: jflex-bootstrap -BuildRequires: junit +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 @@ -70,89 +64,82 @@ Design goals The main design goals of JFlex are: * JLex compatibility %if %without bootstrap -%package doc -Summary: Documentation and examples for %{name} -Group: Development/Libraries/Java +%package javadoc +Summary: API documentation for %{name} +Provides: %{name}-doc = %{version}-%{release} +Obsoletes: %{name}-doc < %{version}-%{release} -%description doc -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. +%description javadoc +This package provides %{summary}. -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 - -This package contains documentation and examples for %{name} %endif %prep %setup -q -n jflex-%{version} -perl -pi -e 's/\r$//g' examples/standalone/sample.inp -rm -rf src/java_cup -find . -name '*.jar' | xargs -t rm -%if %without bootstrap -export CLASSPATH=$(build-classpath java-cup java-cup-runtime junit jflex) -export OPT_JAR_LIST=: -pushd src -%{ant} realclean -%{ant} -Dant.build.javac.source=1.6 -Dant.build.javac.target=1.6 jflex -popd -%endif +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 + +%if %{with bootstrap} +%setup -q -T -D -a 1 -n jflex-%{version} +cp %{SOURCE2} build.xml %patch0 -p1 - -%if %with bootstrap -%patch1 -p1 - -echo `pwd` -rm -rf src/JFlex/tests -%else # with bootstrap -# You must use Re jflex.spec and have a java-cup and jflex installed -%patch2 -p1 -%patch4 -p1 -%patch5 -p1 +mkdir -p lib +build-jar-repository -s lib java-cup-runtime +%else +%{mvn_file} : %{name} JFlex %endif %build -pushd src -%if %without bootstrap -export CLASSPATH=$(build-classpath java-cup java-cup-runtime junit jflex antlr-bootstrap) +%if %{with bootstrap} +%{ant} package %else -export CLASSPATH=$(build-classpath java-cup java-cup-runtime junit antlr-bootstrap) +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 -export OPT_JAR_LIST=: -echo `pwd` -%{ant} -Dant.build.javac.source=1.6 -Dant.build.javac.target=1.6 jar -popd %install + +%if %{with bootstrap} # jar mkdir -p %{buildroot}%{_javadir} -cp -a lib/JFlex.jar %{buildroot}%{_javadir}/jflex-%{version}.jar -(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do ln -s ${jar} `echo $jar| sed "s|-%{version}||g"`; done) +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 -mkdir -p %{buildroot}%{_bindir} -install -p -m 0755 %{SOURCE1} %{buildroot}%{_bindir}/jflex +%jpackage_script jflex.Main "" "" jflex:java-cup jflex true +%if %{with bootstrap} %files -%doc COPYRIGHT src/README src/changelog -%attr(0755,root,root) %{_bindir}/jflex %{_javadir}/jflex.jar -%{_javadir}/jflex-%{version}.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 doc -%doc examples doc +%files javadoc -f .mfiles-javadoc +%license src/main/resources/LICENSE_JFLEX %endif %changelog diff --git a/jpackage-bootstrap-prepare.sh b/jpackage-bootstrap-prepare.sh deleted file mode 100644 index 8bf1dcc..0000000 --- a/jpackage-bootstrap-prepare.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -# This script is based on libcdio_spec-prepare.sh (thanks to sbrabec@suse.cz) -# create a -bootstrap spec for majority of Java packages for bootstrapping -# -#Usage: -# 1.) add these two lines below into the spec file including hash sign (#) -# behind the Name: tag -# # This line is not a comment, please do not remove it! -# #%(sh %{_sourcedir}/jpackage-bootstrap-prepare.sh %{_sourcedir} %{name}) -# 2.) you need to define a with_bootstrap macro with value 1 -# -# How it works: -# 1.) Was called by rpmbuild (or Re, or should be invoked manually from command line) -# 2.) Rename the package name to name-bootstrap -# 3.) Redefine the with_bootstrap macro to _without_bootstrap 1 -# 4.) Define a real_name macro with real name (used in %install and %files) -# 5.) Copy the .changes to -boostrap.changes - - -ORIG_SPEC=${2%-bootstrap} -# Never update -bootstrap file when it is already opened. It will break advanced build scripts: -if [[ "${2}" != "${ORIG_SPEC}" ]]; then - exit -fi - -if [[ ! -f ${1}/${ORIG_SPEC}.spec ]] ; then - exit -fi - -EDIT_WARNING="##### WARNING: please do not edit this auto generated spec file. Use the ${ORIG_SPEC}.spec! #####\n" -sed "s/^%define _without_bootstrap.*$/${EDIT_WARNING}%define with_bootstrap 1/; - s/^\(Name:.*\)$/\1-bootstrap/; - " < ${1}/${ORIG_SPEC}.spec > ${1}/${ORIG_SPEC}-bootstrap.spec - -cp -a ${1}/${ORIG_SPEC}.changes ${1}/${ORIG_SPEC}-bootstrap.changes 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 9580b84548c8f0d20e83f5339e0201b6698c5ba4fe11c14a79023a086eda6870 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Wed, 12 Jan 2022 10:38:37 +0000 Subject: [PATCH 4/6] OBS-URL: https://build.opensuse.org/package/show/Java:packages/jflex?expand=0&rev=24 --- jflex.script | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 jflex.script diff --git a/jflex.script b/jflex.script deleted file mode 100644 index 08a14f8..0000000 --- a/jflex.script +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -# -# jflex script -# JPackage Project - -# Source functions library -if [ -f /usr/share/java-utils/java-functions ] ; then - . /usr/share/java-utils/java-functions -else - echo "Can't find functions library, aborting" - exit 1 -fi - -# Configuration -MAIN_CLASS="JFlex.Main" -BASE_FLAGS="" -BASE_OPTIONS="" -BASE_JARS="jflex" - -# Set parameters -set_jvm -set_classpath $BASE_JARS -set_flags $BASE_FLAGS -set_options $BASE_OPTIONS - -# Let's start -run "$@" From eba1f3c832b83736ea0e74b75b846c0ff3f66a99b711cdbed458bdf9cdff72e5 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Fri, 14 Jan 2022 07:11:20 +0000 Subject: [PATCH 5/6] OBS-URL: https://build.opensuse.org/package/show/Java:packages/jflex?expand=0&rev=25 --- jflex-bootstrap.changes | 16 ++++++++++++++++ jflex.changes | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/jflex-bootstrap.changes b/jflex-bootstrap.changes index eded0a9..23c849f 100644 --- a/jflex-bootstrap.changes +++ b/jflex-bootstrap.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +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 +- 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 diff --git a/jflex.changes b/jflex.changes index eded0a9..23c849f 100644 --- a/jflex.changes +++ b/jflex.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +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 +- 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 From 8e0888c90b511fb06fd52fd8edb1a54de2bbf376d3a1d5e3702de9e28795498e Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Fri, 14 Jan 2022 07:26:31 +0000 Subject: [PATCH 6/6] OBS-URL: https://build.opensuse.org/package/show/Java:packages/jflex?expand=0&rev=26 --- jflex-bootstrap.changes | 5 +++++ jflex.changes | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/jflex-bootstrap.changes b/jflex-bootstrap.changes index 23c849f..d6d3412 100644 --- a/jflex-bootstrap.changes +++ b/jflex-bootstrap.changes @@ -6,6 +6,11 @@ Fri Jan 14 07:05:37 UTC 2022 - Fridrich Strba - 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 diff --git a/jflex.changes b/jflex.changes index 23c849f..d6d3412 100644 --- a/jflex.changes +++ b/jflex.changes @@ -6,6 +6,11 @@ Fri Jan 14 07:05:37 UTC 2022 - Fridrich Strba - 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