Accepting request 730041 from home:fstrba:maven
OBS-URL: https://build.opensuse.org/request/show/730041 OBS-URL: https://build.opensuse.org/package/show/Java:packages/antlr3?expand=0&rev=1
This commit is contained in:
commit
ea707bce16
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -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
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.osc
|
63
0001-java8-fix.patch
Normal file
63
0001-java8-fix.patch
Normal file
@ -0,0 +1,63 @@
|
||||
From 33f662c60e6e7b703e197854d2478a8747f044f0 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Simacek <msimacek@redhat.com>
|
||||
Date: Tue, 17 Jun 2014 19:36:24 +0200
|
||||
Subject: [PATCH] java8 fix
|
||||
|
||||
Signed-off-by: Michael Simacek <msimacek@redhat.com>
|
||||
---
|
||||
tool/src/main/java/org/antlr/codegen/CodeGenerator.java | 2 +-
|
||||
tool/src/main/java/org/antlr/tool/Grammar.java | 4 ++--
|
||||
tool/src/main/java/org/antlr/tool/Strip.java | 2 +-
|
||||
3 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/tool/src/main/java/org/antlr/codegen/CodeGenerator.java b/tool/src/main/java/org/antlr/codegen/CodeGenerator.java
|
||||
index b279bd5..566e33c 100644
|
||||
--- a/tool/src/main/java/org/antlr/codegen/CodeGenerator.java
|
||||
+++ b/tool/src/main/java/org/antlr/codegen/CodeGenerator.java
|
||||
@@ -1087,7 +1087,7 @@ public class CodeGenerator {
|
||||
catch (Exception tse) {
|
||||
ErrorManager.internalError("can't parse template action",tse);
|
||||
}
|
||||
- GrammarAST rewriteTree = parseResult.getTree();
|
||||
+ GrammarAST rewriteTree = (GrammarAST)parseResult.getTree();
|
||||
|
||||
// then translate via codegen.g
|
||||
CodeGenTreeWalker gen = new CodeGenTreeWalker(new CommonTreeNodeStream(rewriteTree));
|
||||
diff --git a/tool/src/main/java/org/antlr/tool/Grammar.java b/tool/src/main/java/org/antlr/tool/Grammar.java
|
||||
index 667ebb2..4ca4328 100644
|
||||
--- a/tool/src/main/java/org/antlr/tool/Grammar.java
|
||||
+++ b/tool/src/main/java/org/antlr/tool/Grammar.java
|
||||
@@ -706,7 +706,7 @@ public class Grammar {
|
||||
}
|
||||
}
|
||||
|
||||
- setGrammarTree(result.getTree());
|
||||
+ setGrammarTree((GrammarAST)result.getTree());
|
||||
|
||||
//if ( grammarTree!=null ) System.out.println("grammar tree: "+grammarTree.toStringTree());
|
||||
|
||||
@@ -927,7 +927,7 @@ public class Grammar {
|
||||
parser.setGrammarType(this.type);
|
||||
try {
|
||||
ANTLRParser.rule_return result = parser.rule();
|
||||
- return result.getTree();
|
||||
+ return (GrammarAST)result.getTree();
|
||||
}
|
||||
catch (Exception e) {
|
||||
ErrorManager.error(ErrorManager.MSG_ERROR_CREATING_ARTIFICIAL_RULE,
|
||||
diff --git a/tool/src/main/java/org/antlr/tool/Strip.java b/tool/src/main/java/org/antlr/tool/Strip.java
|
||||
index f411090..ddda4ed 100644
|
||||
--- a/tool/src/main/java/org/antlr/tool/Strip.java
|
||||
+++ b/tool/src/main/java/org/antlr/tool/Strip.java
|
||||
@@ -64,7 +64,7 @@ public class Strip {
|
||||
tokens = new TokenRewriteStream(lex);
|
||||
ANTLRv3Parser g = new ANTLRv3Parser(tokens);
|
||||
ANTLRv3Parser.grammarDef_return r = g.grammarDef();
|
||||
- CommonTree t = r.getTree();
|
||||
+ CommonTree t = (CommonTree)r.getTree();
|
||||
if (tree_option) System.out.println(t.toStringTree());
|
||||
rewrite(g.getTreeAdaptor(),t,g.getTokenNames());
|
||||
}
|
||||
--
|
||||
2.7.4
|
||||
|
3
3.5.2.tar.gz
Normal file
3
3.5.2.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a66d12fd5ca052fdd2b0a64b70d0c58db40e6dec72c3f4497934203090d92808
|
||||
size 6927136
|
3
antlr-javascript-runtime-3.1.zip
Normal file
3
antlr-javascript-runtime-3.1.zip
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:34702dcbb6d52877aaaede6de4a685bc57e4680f7e029f8aa97906042ba90e27
|
||||
size 66409
|
1
antlr3-bootstrap-rpmlintrc
Normal file
1
antlr3-bootstrap-rpmlintrc
Normal file
@ -0,0 +1 @@
|
||||
addFilter("shlib-policy-name-error")
|
308
antlr3-bootstrap.spec
Normal file
308
antlr3-bootstrap.spec
Normal file
@ -0,0 +1,308 @@
|
||||
#
|
||||
# spec file for package antlr3
|
||||
#
|
||||
# Copyright (c) 2019 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
|
||||
# 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/
|
||||
#
|
||||
|
||||
|
||||
%bcond_without bootstrap
|
||||
Version: %{antlr_version}
|
||||
Release: 0
|
||||
Summary: ANother Tool for Language Recognition
|
||||
License: BSD
|
||||
Group: Development/Libraries/Java
|
||||
URL: https://www.antlr3.org/
|
||||
Source0: https://github.com/antlr/antlr3/archive/%{antlr_version}.tar.gz
|
||||
Source1: http://www.antlr3.org/download/antlr-javascript-runtime-%{javascript_runtime_version}.zip
|
||||
Patch0: 0001-java8-fix.patch
|
||||
# Generate OSGi metadata
|
||||
Patch1: osgi-manifest.patch
|
||||
BuildRequires: maven-local
|
||||
BuildRequires: mvn(antlr:antlr)
|
||||
BuildRequires: mvn(org.antlr:ST4)
|
||||
BuildRequires: mvn(org.antlr:antlr-runtime)
|
||||
BuildRequires: mvn(org.antlr:stringtemplate)
|
||||
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
|
||||
BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin)
|
||||
BuildRequires: mvn(org.apache.maven:maven-plugin-api)
|
||||
BuildRequires: mvn(org.apache.maven:maven-project)
|
||||
BuildRequires: mvn(org.codehaus.plexus:plexus-compiler-api)
|
||||
BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:)
|
||||
BuildRequires: mvn(xerces:dom3-xml-apis)
|
||||
BuildRequires: unzip
|
||||
%if %{with bootstrap}
|
||||
Name: antlr3-bootstrap
|
||||
Source100: %{name}-rpmlintrc
|
||||
Patch100: antlr3-generated_sources.patch
|
||||
BuildRequires: xz
|
||||
#!BuildRequires: stringtemplate4-bootstrap
|
||||
%else
|
||||
Name: antlr3
|
||||
BuildRequires: ant
|
||||
BuildRequires: antlr
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: libtool
|
||||
BuildRequires: mvn(org.antlr:antlr)
|
||||
BuildRequires: mvn(org.antlr:antlr3-maven-plugin)
|
||||
#!BuildRequires: stringtemplate4
|
||||
#!BuildRequires: antlr3-bootstrap-tool
|
||||
%endif
|
||||
|
||||
%description
|
||||
ANother Tool for Language Recognition, is a language tool
|
||||
that provides a framework for constructing recognizers,
|
||||
interpreters, compilers, and translators from grammatical
|
||||
descriptions containing actions in a variety of target languages.
|
||||
|
||||
%package tool
|
||||
Summary: ANother Tool for Language Recognition
|
||||
Group: Development/Libraries/Java
|
||||
Requires: mvn(org.antlr:antlr-runtime) = %{antlr_version}
|
||||
# Explicit requires for javapackages-tools since antlr3-script
|
||||
# uses /usr/share/java-utils/java-functions
|
||||
BuildArch: noarch
|
||||
|
||||
%description tool
|
||||
ANother Tool for Language Recognition, is a language tool
|
||||
that provides a framework for constructing recognizers,
|
||||
interpreters, compilers, and translators from grammatical
|
||||
descriptions containing actions in a variety of target languages.
|
||||
|
||||
%package javadoc
|
||||
Summary: API documentation for %{name}
|
||||
Group: Documentation/HTML
|
||||
BuildArch: noarch
|
||||
|
||||
%description javadoc
|
||||
%{summary}.
|
||||
|
||||
%package javascript
|
||||
Version: %{javascript_runtime_version}
|
||||
Release: 0
|
||||
Summary: Javascript run-time support for ANTLR-generated parsers
|
||||
Group: Development/Libraries/Java
|
||||
BuildArch: noarch
|
||||
|
||||
%description javascript
|
||||
Javascript run-time support for ANTLR-generated parsers
|
||||
|
||||
%if %{with bootstrap}
|
||||
%package -n libantlr3c-bootstrap
|
||||
%else
|
||||
%package -n libantlr3c
|
||||
%endif
|
||||
Version: %{c_runtime_version}
|
||||
Release: 0
|
||||
Summary: C run-time support for ANTLR-generated parsers
|
||||
Group: Development/Libraries/Java
|
||||
Provides: %{name}-C = %{version}-%{release}
|
||||
|
||||
%if %{with bootstrap}
|
||||
%description -n libantlr3c-bootstrap
|
||||
%else
|
||||
%description -n libantlr3c
|
||||
%endif
|
||||
C run-time support for ANTLR-generated parsers
|
||||
|
||||
%package C-devel
|
||||
Version: %{c_runtime_version}
|
||||
Release: 0
|
||||
Summary: Header files for the C bindings for ANTLR-generated parsers
|
||||
Group: Development/Libraries/Java
|
||||
Requires: libantlr3c = %{c_runtime_version}-%{release}
|
||||
|
||||
%description C-devel
|
||||
Header files for the C bindings for ANTLR-generated parsers
|
||||
|
||||
%package C-docs
|
||||
Version: %{c_runtime_version}
|
||||
Release: 0
|
||||
Summary: API documentation for the C run-time support for ANTLR-generated parsers
|
||||
Group: Development/Libraries/Java
|
||||
BuildRequires: doxygen
|
||||
BuildRequires: graphviz
|
||||
Requires: libantlr3c = %{c_runtime_version}-%{release}
|
||||
BuildArch: noarch
|
||||
|
||||
%description C-docs
|
||||
This package contains doxygen documentation with instruction
|
||||
on how to use the C target in ANTLR and complete API description of the
|
||||
C run-time support for ANTLR-generated parsers.
|
||||
|
||||
%package C++-devel
|
||||
Summary: C++ runtime support for ANTLR-generated parsers
|
||||
Group: Development/Libraries/Java
|
||||
|
||||
%description C++-devel
|
||||
C++ runtime support for ANTLR-generated parsers.
|
||||
|
||||
%prep
|
||||
%setup -q -n antlr3-%{antlr_version} -a 1
|
||||
%if %{with bootstrap}
|
||||
%patch100
|
||||
%pom_remove_plugin :antlr3-maven-plugin tool
|
||||
%endif
|
||||
|
||||
sed -i "s,\${buildNumber},`cat %{_sysconfdir}/fedora-release` `date`," tool/src/main/resources/org/antlr/antlr.properties
|
||||
%patch0 -p1
|
||||
%patch1
|
||||
|
||||
%if %{without bootstrap}
|
||||
# remove pre-built artifacts
|
||||
find -type f -a -name *.jar -delete
|
||||
find -type f -a -name *.class -delete
|
||||
%endif
|
||||
|
||||
%pom_disable_module antlr3-maven-archetype
|
||||
%pom_disable_module gunit
|
||||
%pom_disable_module gunit-maven-plugin
|
||||
%pom_disable_module antlr-complete
|
||||
%pom_disable_module runtime/Java
|
||||
|
||||
%pom_remove_plugin :maven-source-plugin
|
||||
%pom_remove_plugin :maven-javadoc-plugin
|
||||
|
||||
# compile for target 1.6, see BZ#842572
|
||||
sed -i 's/jsr14/1.6/' antlr3-maven-archetype/src/main/resources/archetype-resources/pom.xml \
|
||||
antlr3-maven-plugin/pom.xml \
|
||||
gunit/pom.xml \
|
||||
gunit-maven-plugin/pom.xml \
|
||||
pom.xml \
|
||||
runtime/Java/pom.xml \
|
||||
tool/pom.xml
|
||||
|
||||
# workarounds bug in filtering (Mark invalid)
|
||||
%pom_xpath_remove pom:resource/pom:filtering
|
||||
|
||||
%{mvn_package} : tool
|
||||
|
||||
%{mvn_file} :antlr antlr3
|
||||
%{mvn_file} :antlr-maven-plugin antlr3-maven-plugin
|
||||
|
||||
%build
|
||||
%if %{with bootstrap}
|
||||
%{mvn_build} -f -j
|
||||
%else
|
||||
%{mvn_build} -f
|
||||
|
||||
# Build the C runtime
|
||||
pushd runtime/C
|
||||
autoreconf -i
|
||||
%configure --disable-abiflags --enable-debuginfo \
|
||||
%if 0%{?__isa_bits} == 64
|
||||
--enable-64bit
|
||||
%else
|
||||
%{nil}
|
||||
%endif
|
||||
|
||||
sed -i "s#CFLAGS = .*#CFLAGS = %{optflags}#" Makefile
|
||||
make %{?_smp_mflags}
|
||||
doxygen -u # update doxygen configuration file
|
||||
doxygen # build doxygen documentation
|
||||
popd
|
||||
|
||||
# build ant task
|
||||
pushd antlr-ant/main/antlr3-task/
|
||||
export CLASSPATH=$(build-classpath ant)
|
||||
javac -encoding ISO-8859-1 antlr3-src/org/apache/tools/ant/antlr/ANTLR3.java
|
||||
jar cvf ant-antlr3.jar \
|
||||
-C antlr3-src org/apache/tools/ant/antlr/antlib.xml \
|
||||
-C antlr3-src org/apache/tools/ant/antlr/ANTLR3.class
|
||||
popd
|
||||
|
||||
%endif
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}/%{_mandir}
|
||||
mkdir -p %{buildroot}/%{_datadir}/antlr
|
||||
|
||||
%mvn_install
|
||||
%if %{without bootstrap}
|
||||
%fdupes -s %{buildroot}%{_javadocdir}
|
||||
|
||||
# install ant task
|
||||
install -m 644 antlr-ant/main/antlr3-task/ant-antlr3.jar -D %{buildroot}%{_javadir}/ant/ant-antlr3.jar
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/ant.d
|
||||
cat > %{buildroot}%{_sysconfdir}/ant.d/ant-antlr3 << EOF
|
||||
ant/ant-antlr3 antlr3
|
||||
EOF
|
||||
|
||||
# install C runtime
|
||||
pushd runtime/C
|
||||
%make_install
|
||||
rm %{buildroot}%{_libdir}/libantlr3c.{a,la}
|
||||
pushd api/man/man3
|
||||
for file in `ls -1 * | grep -vi "^antlr3"`; do
|
||||
mv $file antlr3-$file
|
||||
done
|
||||
sed -i -e 's,^\.so man3/pANTLR3,.so man3/antlr3-pANTLR3,' `grep -rl 'man3/pANTLR3' .`
|
||||
gzip *
|
||||
popd
|
||||
mv api/man/man3 %{buildroot}%{_mandir}/
|
||||
rmdir api/man
|
||||
popd
|
||||
|
||||
# install javascript runtime
|
||||
pushd antlr-javascript-runtime-%{javascript_runtime_version}
|
||||
install -pm 644 *.js %{buildroot}%{_datadir}/antlr/
|
||||
popd
|
||||
|
||||
# install C++ runtime (header only)
|
||||
mkdir -p %{buildroot}/%{_includedir}/%{name}
|
||||
install -pm 644 runtime/Cpp/include/* %{buildroot}/%{_includedir}/
|
||||
|
||||
%fdupes -s runtime/C/api
|
||||
%fdupes -s %{buildroot}%{_mandir}
|
||||
|
||||
%endif
|
||||
|
||||
# install wrapper script
|
||||
%jpackage_script org.antlr.Tool '' '' 'stringtemplate4/ST4.jar:antlr3.jar:antlr3-runtime.jar' antlr3 true
|
||||
|
||||
%files tool -f .mfiles-tool
|
||||
%license tool/{LICENSE.txt,CHANGES.txt}
|
||||
%doc README.txt
|
||||
%{_bindir}/antlr3
|
||||
%if %{without bootstrap}
|
||||
%{_javadir}/ant/ant-antlr3.jar
|
||||
%config(noreplace) %{_sysconfdir}/ant.d/ant-antlr3
|
||||
|
||||
%files -n libantlr3c
|
||||
%license tool/LICENSE.txt
|
||||
%{_libdir}/libantlr3c.so
|
||||
|
||||
%files C-devel
|
||||
%{_mandir}/man3/*
|
||||
%{_includedir}/*.h
|
||||
|
||||
%files C-docs
|
||||
%doc runtime/C/api
|
||||
|
||||
%files C++-devel
|
||||
%license tool/LICENSE.txt
|
||||
%{_includedir}/*.hpp
|
||||
%{_includedir}/*.inl
|
||||
|
||||
%files javascript
|
||||
%license tool/LICENSE.txt
|
||||
%{_datadir}/antlr/
|
||||
|
||||
%files javadoc -f .mfiles-javadoc
|
||||
%license tool/LICENSE.txt
|
||||
|
||||
%endif
|
||||
|
||||
%changelog
|
60084
antlr3-generated_sources.patch
Normal file
60084
antlr3-generated_sources.patch
Normal file
File diff suppressed because it is too large
Load Diff
103
antlr3-java.spec
Normal file
103
antlr3-java.spec
Normal file
@ -0,0 +1,103 @@
|
||||
#
|
||||
# spec file for package antlr3-java
|
||||
#
|
||||
# Copyright (c) 2019 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
|
||||
# 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 antlr_version 3.5.2
|
||||
Name: antlr3-java
|
||||
Version: %{antlr_version}
|
||||
Release: 0
|
||||
Summary: Java run-time support for ANTLR-generated parsers
|
||||
License: BSD
|
||||
Group: Development/Libraries/Java
|
||||
URL: https://www.antlr3.org/
|
||||
Source0: https://github.com/antlr/antlr3/archive/%{antlr_version}.tar.gz
|
||||
Patch0: 0001-java8-fix.patch
|
||||
# Generate OSGi metadata
|
||||
Patch1: osgi-manifest.patch
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: maven-local
|
||||
BuildRequires: mvn(antlr:antlr)
|
||||
BuildRequires: mvn(org.antlr:stringtemplate)
|
||||
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
|
||||
BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:)
|
||||
BuildRequires: unzip
|
||||
BuildArch: noarch
|
||||
|
||||
%description
|
||||
Java run-time support for ANTLR-generated parsers
|
||||
|
||||
%package javadoc
|
||||
Summary: API documentation for %{name}
|
||||
Group: Documentation/HTML
|
||||
BuildArch: noarch
|
||||
|
||||
%description javadoc
|
||||
%{summary}.
|
||||
|
||||
%prep
|
||||
%setup -q -n antlr3-%{antlr_version}
|
||||
|
||||
sed -i "s,\${buildNumber},`cat %{_sysconfdir}/fedora-release` `date`," tool/src/main/resources/org/antlr/antlr.properties
|
||||
%patch0 -p1
|
||||
%patch1
|
||||
|
||||
%if %{without bootstrap}
|
||||
# remove pre-built artifacts
|
||||
find -type f -a -name *.jar -delete
|
||||
find -type f -a -name *.class -delete
|
||||
%endif
|
||||
|
||||
%pom_disable_module antlr3-maven-archetype
|
||||
%pom_disable_module gunit
|
||||
%pom_disable_module gunit-maven-plugin
|
||||
%pom_disable_module antlr-complete
|
||||
%pom_disable_module runtime/Java
|
||||
|
||||
%pom_remove_plugin :maven-source-plugin
|
||||
%pom_remove_plugin :maven-javadoc-plugin
|
||||
|
||||
# compile for target 1.6, see BZ#842572
|
||||
sed -i 's/jsr14/1.6/' antlr3-maven-archetype/src/main/resources/archetype-resources/pom.xml \
|
||||
antlr3-maven-plugin/pom.xml \
|
||||
gunit/pom.xml \
|
||||
gunit-maven-plugin/pom.xml \
|
||||
pom.xml \
|
||||
runtime/Java/pom.xml \
|
||||
tool/pom.xml
|
||||
|
||||
# workarounds bug in filtering (Mark invalid)
|
||||
%pom_xpath_remove pom:resource/pom:filtering
|
||||
|
||||
%build
|
||||
pushd runtime/Java
|
||||
%{mvn_file} :antlr-runtime antlr3-runtime
|
||||
%{mvn_build} -f
|
||||
popd
|
||||
|
||||
%install
|
||||
pushd runtime/Java
|
||||
%mvn_install
|
||||
%fdupes -s %{buildroot}%{_javadocdir}
|
||||
popd
|
||||
|
||||
%files -f runtime/Java/.mfiles
|
||||
%license tool/LICENSE.txt
|
||||
|
||||
%files javadoc -f runtime/Java/.mfiles-javadoc
|
||||
%license tool/LICENSE.txt
|
||||
|
||||
%changelog
|
308
antlr3.spec
Normal file
308
antlr3.spec
Normal file
@ -0,0 +1,308 @@
|
||||
#
|
||||
# spec file for package antlr3
|
||||
#
|
||||
# Copyright (c) 2019 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
|
||||
# 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/
|
||||
#
|
||||
|
||||
|
||||
%bcond_with bootstrap
|
||||
Version: %{antlr_version}
|
||||
Release: 0
|
||||
Summary: ANother Tool for Language Recognition
|
||||
License: BSD
|
||||
Group: Development/Libraries/Java
|
||||
URL: https://www.antlr3.org/
|
||||
Source0: https://github.com/antlr/antlr3/archive/%{antlr_version}.tar.gz
|
||||
Source1: http://www.antlr3.org/download/antlr-javascript-runtime-%{javascript_runtime_version}.zip
|
||||
Patch0: 0001-java8-fix.patch
|
||||
# Generate OSGi metadata
|
||||
Patch1: osgi-manifest.patch
|
||||
BuildRequires: maven-local
|
||||
BuildRequires: mvn(antlr:antlr)
|
||||
BuildRequires: mvn(org.antlr:ST4)
|
||||
BuildRequires: mvn(org.antlr:antlr-runtime)
|
||||
BuildRequires: mvn(org.antlr:stringtemplate)
|
||||
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
|
||||
BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin)
|
||||
BuildRequires: mvn(org.apache.maven:maven-plugin-api)
|
||||
BuildRequires: mvn(org.apache.maven:maven-project)
|
||||
BuildRequires: mvn(org.codehaus.plexus:plexus-compiler-api)
|
||||
BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:)
|
||||
BuildRequires: mvn(xerces:dom3-xml-apis)
|
||||
BuildRequires: unzip
|
||||
%if %{with bootstrap}
|
||||
Name: antlr3-bootstrap
|
||||
Source100: %{name}-rpmlintrc
|
||||
Patch100: antlr3-generated_sources.patch
|
||||
BuildRequires: xz
|
||||
#!BuildRequires: stringtemplate4-bootstrap
|
||||
%else
|
||||
Name: antlr3
|
||||
BuildRequires: ant
|
||||
BuildRequires: antlr
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: libtool
|
||||
BuildRequires: mvn(org.antlr:antlr)
|
||||
BuildRequires: mvn(org.antlr:antlr3-maven-plugin)
|
||||
#!BuildRequires: stringtemplate4
|
||||
#!BuildRequires: antlr3-bootstrap-tool
|
||||
%endif
|
||||
|
||||
%description
|
||||
ANother Tool for Language Recognition, is a language tool
|
||||
that provides a framework for constructing recognizers,
|
||||
interpreters, compilers, and translators from grammatical
|
||||
descriptions containing actions in a variety of target languages.
|
||||
|
||||
%package tool
|
||||
Summary: ANother Tool for Language Recognition
|
||||
Group: Development/Libraries/Java
|
||||
Requires: mvn(org.antlr:antlr-runtime) = %{antlr_version}
|
||||
# Explicit requires for javapackages-tools since antlr3-script
|
||||
# uses /usr/share/java-utils/java-functions
|
||||
BuildArch: noarch
|
||||
|
||||
%description tool
|
||||
ANother Tool for Language Recognition, is a language tool
|
||||
that provides a framework for constructing recognizers,
|
||||
interpreters, compilers, and translators from grammatical
|
||||
descriptions containing actions in a variety of target languages.
|
||||
|
||||
%package javadoc
|
||||
Summary: API documentation for %{name}
|
||||
Group: Documentation/HTML
|
||||
BuildArch: noarch
|
||||
|
||||
%description javadoc
|
||||
%{summary}.
|
||||
|
||||
%package javascript
|
||||
Version: %{javascript_runtime_version}
|
||||
Release: 0
|
||||
Summary: Javascript run-time support for ANTLR-generated parsers
|
||||
Group: Development/Libraries/Java
|
||||
BuildArch: noarch
|
||||
|
||||
%description javascript
|
||||
Javascript run-time support for ANTLR-generated parsers
|
||||
|
||||
%if %{with bootstrap}
|
||||
%package -n libantlr3c-bootstrap
|
||||
%else
|
||||
%package -n libantlr3c
|
||||
%endif
|
||||
Version: %{c_runtime_version}
|
||||
Release: 0
|
||||
Summary: C run-time support for ANTLR-generated parsers
|
||||
Group: Development/Libraries/Java
|
||||
Provides: %{name}-C = %{version}-%{release}
|
||||
|
||||
%if %{with bootstrap}
|
||||
%description -n libantlr3c-bootstrap
|
||||
%else
|
||||
%description -n libantlr3c
|
||||
%endif
|
||||
C run-time support for ANTLR-generated parsers
|
||||
|
||||
%package C-devel
|
||||
Version: %{c_runtime_version}
|
||||
Release: 0
|
||||
Summary: Header files for the C bindings for ANTLR-generated parsers
|
||||
Group: Development/Libraries/Java
|
||||
Requires: libantlr3c = %{c_runtime_version}-%{release}
|
||||
|
||||
%description C-devel
|
||||
Header files for the C bindings for ANTLR-generated parsers
|
||||
|
||||
%package C-docs
|
||||
Version: %{c_runtime_version}
|
||||
Release: 0
|
||||
Summary: API documentation for the C run-time support for ANTLR-generated parsers
|
||||
Group: Development/Libraries/Java
|
||||
BuildRequires: doxygen
|
||||
BuildRequires: graphviz
|
||||
Requires: libantlr3c = %{c_runtime_version}-%{release}
|
||||
BuildArch: noarch
|
||||
|
||||
%description C-docs
|
||||
This package contains doxygen documentation with instruction
|
||||
on how to use the C target in ANTLR and complete API description of the
|
||||
C run-time support for ANTLR-generated parsers.
|
||||
|
||||
%package C++-devel
|
||||
Summary: C++ runtime support for ANTLR-generated parsers
|
||||
Group: Development/Libraries/Java
|
||||
|
||||
%description C++-devel
|
||||
C++ runtime support for ANTLR-generated parsers.
|
||||
|
||||
%prep
|
||||
%setup -q -n antlr3-%{antlr_version} -a 1
|
||||
%if %{with bootstrap}
|
||||
%patch100
|
||||
%pom_remove_plugin :antlr3-maven-plugin tool
|
||||
%endif
|
||||
|
||||
sed -i "s,\${buildNumber},`cat %{_sysconfdir}/fedora-release` `date`," tool/src/main/resources/org/antlr/antlr.properties
|
||||
%patch0 -p1
|
||||
%patch1
|
||||
|
||||
%if %{without bootstrap}
|
||||
# remove pre-built artifacts
|
||||
find -type f -a -name *.jar -delete
|
||||
find -type f -a -name *.class -delete
|
||||
%endif
|
||||
|
||||
%pom_disable_module antlr3-maven-archetype
|
||||
%pom_disable_module gunit
|
||||
%pom_disable_module gunit-maven-plugin
|
||||
%pom_disable_module antlr-complete
|
||||
%pom_disable_module runtime/Java
|
||||
|
||||
%pom_remove_plugin :maven-source-plugin
|
||||
%pom_remove_plugin :maven-javadoc-plugin
|
||||
|
||||
# compile for target 1.6, see BZ#842572
|
||||
sed -i 's/jsr14/1.6/' antlr3-maven-archetype/src/main/resources/archetype-resources/pom.xml \
|
||||
antlr3-maven-plugin/pom.xml \
|
||||
gunit/pom.xml \
|
||||
gunit-maven-plugin/pom.xml \
|
||||
pom.xml \
|
||||
runtime/Java/pom.xml \
|
||||
tool/pom.xml
|
||||
|
||||
# workarounds bug in filtering (Mark invalid)
|
||||
%pom_xpath_remove pom:resource/pom:filtering
|
||||
|
||||
%{mvn_package} : tool
|
||||
|
||||
%{mvn_file} :antlr antlr3
|
||||
%{mvn_file} :antlr-maven-plugin antlr3-maven-plugin
|
||||
|
||||
%build
|
||||
%if %{with bootstrap}
|
||||
%{mvn_build} -f -j
|
||||
%else
|
||||
%{mvn_build} -f
|
||||
|
||||
# Build the C runtime
|
||||
pushd runtime/C
|
||||
autoreconf -i
|
||||
%configure --disable-abiflags --enable-debuginfo \
|
||||
%if 0%{?__isa_bits} == 64
|
||||
--enable-64bit
|
||||
%else
|
||||
%{nil}
|
||||
%endif
|
||||
|
||||
sed -i "s#CFLAGS = .*#CFLAGS = %{optflags}#" Makefile
|
||||
make %{?_smp_mflags}
|
||||
doxygen -u # update doxygen configuration file
|
||||
doxygen # build doxygen documentation
|
||||
popd
|
||||
|
||||
# build ant task
|
||||
pushd antlr-ant/main/antlr3-task/
|
||||
export CLASSPATH=$(build-classpath ant)
|
||||
javac -encoding ISO-8859-1 antlr3-src/org/apache/tools/ant/antlr/ANTLR3.java
|
||||
jar cvf ant-antlr3.jar \
|
||||
-C antlr3-src org/apache/tools/ant/antlr/antlib.xml \
|
||||
-C antlr3-src org/apache/tools/ant/antlr/ANTLR3.class
|
||||
popd
|
||||
|
||||
%endif
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}/%{_mandir}
|
||||
mkdir -p %{buildroot}/%{_datadir}/antlr
|
||||
|
||||
%mvn_install
|
||||
%if %{without bootstrap}
|
||||
%fdupes -s %{buildroot}%{_javadocdir}
|
||||
|
||||
# install ant task
|
||||
install -m 644 antlr-ant/main/antlr3-task/ant-antlr3.jar -D %{buildroot}%{_javadir}/ant/ant-antlr3.jar
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/ant.d
|
||||
cat > %{buildroot}%{_sysconfdir}/ant.d/ant-antlr3 << EOF
|
||||
ant/ant-antlr3 antlr3
|
||||
EOF
|
||||
|
||||
# install C runtime
|
||||
pushd runtime/C
|
||||
%make_install
|
||||
rm %{buildroot}%{_libdir}/libantlr3c.{a,la}
|
||||
pushd api/man/man3
|
||||
for file in `ls -1 * | grep -vi "^antlr3"`; do
|
||||
mv $file antlr3-$file
|
||||
done
|
||||
sed -i -e 's,^\.so man3/pANTLR3,.so man3/antlr3-pANTLR3,' `grep -rl 'man3/pANTLR3' .`
|
||||
gzip *
|
||||
popd
|
||||
mv api/man/man3 %{buildroot}%{_mandir}/
|
||||
rmdir api/man
|
||||
popd
|
||||
|
||||
# install javascript runtime
|
||||
pushd antlr-javascript-runtime-%{javascript_runtime_version}
|
||||
install -pm 644 *.js %{buildroot}%{_datadir}/antlr/
|
||||
popd
|
||||
|
||||
# install C++ runtime (header only)
|
||||
mkdir -p %{buildroot}/%{_includedir}/%{name}
|
||||
install -pm 644 runtime/Cpp/include/* %{buildroot}/%{_includedir}/
|
||||
|
||||
%fdupes -s runtime/C/api
|
||||
%fdupes -s %{buildroot}%{_mandir}
|
||||
|
||||
%endif
|
||||
|
||||
# install wrapper script
|
||||
%jpackage_script org.antlr.Tool '' '' 'stringtemplate4/ST4.jar:antlr3.jar:antlr3-runtime.jar' antlr3 true
|
||||
|
||||
%files tool -f .mfiles-tool
|
||||
%license tool/{LICENSE.txt,CHANGES.txt}
|
||||
%doc README.txt
|
||||
%{_bindir}/antlr3
|
||||
%if %{without bootstrap}
|
||||
%{_javadir}/ant/ant-antlr3.jar
|
||||
%config(noreplace) %{_sysconfdir}/ant.d/ant-antlr3
|
||||
|
||||
%files -n libantlr3c
|
||||
%license tool/LICENSE.txt
|
||||
%{_libdir}/libantlr3c.so
|
||||
|
||||
%files C-devel
|
||||
%{_mandir}/man3/*
|
||||
%{_includedir}/*.h
|
||||
|
||||
%files C-docs
|
||||
%doc runtime/C/api
|
||||
|
||||
%files C++-devel
|
||||
%license tool/LICENSE.txt
|
||||
%{_includedir}/*.hpp
|
||||
%{_includedir}/*.inl
|
||||
|
||||
%files javascript
|
||||
%license tool/LICENSE.txt
|
||||
%{_datadir}/antlr/
|
||||
|
||||
%files javadoc -f .mfiles-javadoc
|
||||
%license tool/LICENSE.txt
|
||||
|
||||
%endif
|
||||
|
||||
%changelog
|
25
osgi-manifest.patch
Normal file
25
osgi-manifest.patch
Normal file
@ -0,0 +1,25 @@
|
||||
--- runtime/Java/pom.xml.orig 2015-11-24 22:48:17.908747868 +0000
|
||||
+++ runtime/Java/pom.xml 2015-11-24 22:48:37.201489113 +0000
|
||||
@@ -64,4 +64,22 @@
|
||||
|
||||
</dependencies>
|
||||
|
||||
+<build>
|
||||
+ <plugins>
|
||||
+ <plugin>
|
||||
+ <groupId>org.apache.felix</groupId><artifactId>maven-bundle-plugin</artifactId>
|
||||
+ <executions><execution><id>bundle-manifest</id><phase>process-classes</phase><goals><goal>manifest</goal></goals></execution></executions>
|
||||
+ <configuration>
|
||||
+ <manifestLocation>${project.build.directory}/osgi</manifestLocation>
|
||||
+ <instructions><Bundle-SymbolicName>org.antlr.runtime</Bundle-SymbolicName><Import-Package>!org.antlr.stringtemplate,*</Import-Package></instructions>
|
||||
+ </configuration>
|
||||
+ </plugin>
|
||||
+ <plugin>
|
||||
+ <groupId>org.apache.maven.plugins</groupId><artifactId>maven-jar-plugin</artifactId>
|
||||
+ <configuration>
|
||||
+ <archive><manifestFile>${project.build.directory}/osgi/MANIFEST.MF</manifestFile></archive>
|
||||
+ </configuration>
|
||||
+ </plugin>
|
||||
+ </plugins>
|
||||
+</build>
|
||||
</project>
|
Loading…
x
Reference in New Issue
Block a user