From d5e67fc06fc0a9cf351c2db3d9c942f14513c5af68dc1e7d56b8c3176815771e Mon Sep 17 00:00:00 2001 From: Gus Kenion Date: Tue, 15 Oct 2024 09:19:12 +0000 Subject: [PATCH] 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