From 9abad35cae9398e0b74adec4bb78bc6c79157b133e6ba4fbcb9e5e345bc65b8f Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Wed, 20 Sep 2017 17:43:08 +0000 Subject: [PATCH 1/4] Don't depend on ecj-bootstrap OBS-URL: https://build.opensuse.org/package/show/Java:packages/antlr?expand=0&rev=35 --- antlr-bootstrap.changes | 7 +++++++ antlr-bootstrap.spec | 12 +++++------- antlr.spec | 8 +------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/antlr-bootstrap.changes b/antlr-bootstrap.changes index 90a732e..4d49177 100644 --- a/antlr-bootstrap.changes +++ b/antlr-bootstrap.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Sep 20 17:39:46 UTC 2017 - fstrba@suse.com + +- Remove requirements of ecj-bootstrap and fastjar + * use the gcj.jar that comes with gccN-java + * use gjar-N instead of fastjar + ------------------------------------------------------------------- Fri Jul 4 11:17:30 UTC 2014 - tchvatal@suse.com diff --git a/antlr-bootstrap.spec b/antlr-bootstrap.spec index bb3728a..816637d 100644 --- a/antlr-bootstrap.spec +++ b/antlr-bootstrap.spec @@ -16,23 +16,21 @@ # +%define gccbinsuffix %(rpm -q --qf "-%{VERSION}" gcc-java) %define real_name antlr Name: antlr-bootstrap Version: 2.7.7 Release: 0 Summary: Antlr for bootstrapping purposes -License: BSD-3-Clause and SUSE-Public-Domain +License: BSD-3-Clause AND SUSE-Public-Domain Group: Development/Libraries/Java Url: http://www.antlr.org Source0: antlr-%{version}.tar.bz2 Source1: manifest.antlr -BuildRequires: ecj-bootstrap >= 0.570 -BuildRequires: fastjar BuildRequires: gcc-gij BuildRequires: gcc-java BuildRequires: unzip BuildRequires: zip -BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch %description @@ -96,10 +94,11 @@ function compileFiles() { # uses $TARGET_DIR to move created jar to function mkJar() { find -name "version.txt" -or -name "*.class" -or -name "*.properties" -or -name "*.rsc" -or -name "*manifest*" |\ - xargs %{_bindir}/fastjar -m manifest.* -cf ${1}.jar ; + xargs gjar%{gccbinsuffix} -m manifest.* -cf ${1}.jar ; mv ${1}.jar $TARGET_DIR } -COMPILER_COMMAND="gij -jar %{_javadir}/jdtcore.jar -cp " +ECJJAR=`gcj%{gccbinsuffix} -print-file-name=ecj.jar` +COMPILER_COMMAND="gij%{gccbinsuffix} -cp $ECJJAR org.eclipse.jdt.internal.compiler.batch.Main -cp " delBinaryFiles mkdir src mv antlr src @@ -115,7 +114,6 @@ install -m 0644 %{name}.jar %{buildroot}%{_javadir}/ ln -s -f %{_javadir}/%{name}.jar %{buildroot}/%{_javadir}/%{name}-%{version}.jar %files -%defattr(-,root,root) %{_javadir}/%{name}*.jar %changelog diff --git a/antlr.spec b/antlr.spec index d24c1f2..fd59543 100644 --- a/antlr.spec +++ b/antlr.spec @@ -20,7 +20,7 @@ Name: antlr Version: 2.7.7 Release: 0 Summary: Another Tool for Language Recognition -License: GPL-2.0+ and SUSE-Public-Domain and MIT +License: GPL-2.0+ AND SUSE-Public-Domain AND MIT Group: Development/Tools/Other Url: http://www.antlr.org/ Source0: antlr-%{version}.tar.bz2 @@ -41,7 +41,6 @@ Requires: %{name}-java Provides: %{name}-bootstrap = %{version} Obsoletes: %{name}-bootstrap < %{version} Obsoletes: %{name}-javadoc -BuildRoot: %{_tmppath}/%{name}-%{version}-build %description ANTLR, Another Tool for Language Recognition, (formerly PCCTS) is a @@ -156,7 +155,6 @@ find examples -type f | xargs chmod 0644 %fdupes -s examples %files -%defattr(0644,root,root,0755) %doc LICENSE.txt README.txt CHANGES.txt %dir %{_datadir}/%{name}-%{version} %defattr(0755,root,root,0755) @@ -164,22 +162,18 @@ find examples -type f | xargs chmod 0644 %{_bindir}/antlr-config %files java -%defattr(0644,root,root,0755) %dir %{_datadir}/%{name}-%{version} %{_datadir}/%{name}-%{version}/*jar %{_javadir}/%{name}*.jar %files manual -%defattr(0644,root,root,0755) %doc doc examples %files devel -%defattr(0644,root,root,0755) %attr(755,root,root) %{_libdir}/libantlr.a %{_includedir}/%{name} %files -n python-%{name} -%defattr(-,root,root) %dir %{_datadir}/%{name}-%{version} %{_datadir}/%{name}-%{version}/*py %{_datadir}/%{name}-%{version}/*pyc From 8b67854078bbe2d1348a094e6121ed6cc08a2efef7f30e8d37fa5e27ab14aa28 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Thu, 21 Sep 2017 10:48:41 +0000 Subject: [PATCH 2/4] Bring the defattr back to prevent rpmlint errors OBS-URL: https://build.opensuse.org/package/show/Java:packages/antlr?expand=0&rev=36 --- antlr.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/antlr.spec b/antlr.spec index fd59543..905fc72 100644 --- a/antlr.spec +++ b/antlr.spec @@ -155,6 +155,7 @@ find examples -type f | xargs chmod 0644 %fdupes -s examples %files +%defattr(0644,root,root,0755) %doc LICENSE.txt README.txt CHANGES.txt %dir %{_datadir}/%{name}-%{version} %defattr(0755,root,root,0755) @@ -162,18 +163,22 @@ find examples -type f | xargs chmod 0644 %{_bindir}/antlr-config %files java +%defattr(0644,root,root,0755) %dir %{_datadir}/%{name}-%{version} %{_datadir}/%{name}-%{version}/*jar %{_javadir}/%{name}*.jar %files manual +%defattr(0644,root,root,0755) %doc doc examples %files devel +%defattr(0644,root,root,0755) %attr(755,root,root) %{_libdir}/libantlr.a %{_includedir}/%{name} %files -n python-%{name} +%defattr(0644,root,root,0755) %dir %{_datadir}/%{name}-%{version} %{_datadir}/%{name}-%{version}/*py %{_datadir}/%{name}-%{version}/*pyc From 229f2f7a0b455ff87f10fded8d4e5f3d8d486fafa9ab03f6b39070294e779a7f Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Thu, 21 Sep 2017 10:59:26 +0000 Subject: [PATCH 3/4] Fix some rpmlint errors OBS-URL: https://build.opensuse.org/package/show/Java:packages/antlr?expand=0&rev=37 --- antlr-bootstrap.spec | 4 ++-- antlr.spec | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/antlr-bootstrap.spec b/antlr-bootstrap.spec index 816637d..3e97895 100644 --- a/antlr-bootstrap.spec +++ b/antlr-bootstrap.spec @@ -56,7 +56,7 @@ function delBinaryFiles() { done set -x } -#>>> make a string with all jar files found in target folder that can be used for a classpath string +#>>> make %{?_smp_mflags} a string with all jar files found in target folder that can be used for a classpath string # string is saved in JAR_CLASSPATH function mkTargetClasspath() { set +x @@ -89,7 +89,7 @@ function compileFiles() { done set -x } -#>>> make jar archive +#>>> make %{?_smp_mflags} jar archive # PARAM#1: name of jar archive (without .jar suffix) # uses $TARGET_DIR to move created jar to function mkJar() { diff --git a/antlr.spec b/antlr.spec index 905fc72..f462327 100644 --- a/antlr.spec +++ b/antlr.spec @@ -106,6 +106,7 @@ Haefelinger and Marq Kole. %setup -q # remove all binary libs find . -name "*.jar" -exec rm -f {} \; +find . -name Makefile.in | xargs chmod 0644 %patch0 cp -p %{SOURCE1} build.xml #Fix the source so that it compiles with GCC 4.5 @@ -153,9 +154,10 @@ install -m 0644 lib/cpp/%{name}/*hpp %{buildroot}%{_includedir}/%{name} ### find duplicates ### find examples -type f | xargs chmod 0644 %fdupes -s examples +find doc -type f | xargs chmod 0644 +%fdupes -s doc %files -%defattr(0644,root,root,0755) %doc LICENSE.txt README.txt CHANGES.txt %dir %{_datadir}/%{name}-%{version} %defattr(0755,root,root,0755) @@ -163,22 +165,18 @@ find examples -type f | xargs chmod 0644 %{_bindir}/antlr-config %files java -%defattr(0644,root,root,0755) %dir %{_datadir}/%{name}-%{version} %{_datadir}/%{name}-%{version}/*jar %{_javadir}/%{name}*.jar %files manual -%defattr(0644,root,root,0755) %doc doc examples %files devel -%defattr(0644,root,root,0755) %attr(755,root,root) %{_libdir}/libantlr.a %{_includedir}/%{name} %files -n python-%{name} -%defattr(0644,root,root,0755) %dir %{_datadir}/%{name}-%{version} %{_datadir}/%{name}-%{version}/*py %{_datadir}/%{name}-%{version}/*pyc From 07c2c8b44cb111dccecb382af8400d4208870e99fb9be5ca8ceb905d6daf107b Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Thu, 21 Sep 2017 11:02:53 +0000 Subject: [PATCH 4/4] Fix some rpmlint errors OBS-URL: https://build.opensuse.org/package/show/Java:packages/antlr?expand=0&rev=38 --- antlr.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/antlr.spec b/antlr.spec index f462327..b0105c6 100644 --- a/antlr.spec +++ b/antlr.spec @@ -160,7 +160,6 @@ find doc -type f | xargs chmod 0644 %files %doc LICENSE.txt README.txt CHANGES.txt %dir %{_datadir}/%{name}-%{version} -%defattr(0755,root,root,0755) %{_bindir}/antlr %{_bindir}/antlr-config