2007-01-15 23:51:10 +01:00
|
|
|
#
|
2012-10-31 11:25:47 +01:00
|
|
|
# spec file for package antlr
|
2007-01-15 23:51:10 +01:00
|
|
|
#
|
2017-05-19 15:28:09 +02:00
|
|
|
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
2007-01-15 23:51:10 +01:00
|
|
|
#
|
2009-06-19 00:51:30 +02:00
|
|
|
# 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.
|
|
|
|
|
2007-01-15 23:51:10 +01:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
Name: antlr
|
2008-04-25 14:50:33 +02:00
|
|
|
Version: 2.7.7
|
2012-10-31 11:25:47 +01:00
|
|
|
Release: 0
|
2011-07-25 10:38:34 +02:00
|
|
|
Summary: Another Tool for Language Recognition
|
2017-09-20 19:43:08 +02:00
|
|
|
License: GPL-2.0+ AND SUSE-Public-Domain AND MIT
|
2007-01-15 23:51:10 +01:00
|
|
|
Group: Development/Tools/Other
|
2012-10-31 11:25:47 +01:00
|
|
|
Url: http://www.antlr.org/
|
2014-07-04 13:18:25 +02:00
|
|
|
Source0: antlr-%{version}.tar.bz2
|
2007-01-15 23:51:10 +01:00
|
|
|
Source1: %{name}-build.xml
|
|
|
|
Source2: %{name}-script
|
2014-07-04 13:18:25 +02:00
|
|
|
Source3: makefile.gcj
|
2010-08-27 21:40:20 +02:00
|
|
|
Source1000: antlr-rpmlintrc
|
2007-01-15 23:51:10 +01:00
|
|
|
Patch0: %{name}-jedit.patch
|
2010-08-27 21:40:20 +02:00
|
|
|
Patch1: gcc45fix.diff
|
|
|
|
Patch2: fix-docpath.diff
|
|
|
|
BuildRequires: ant
|
2011-07-25 10:38:34 +02:00
|
|
|
BuildRequires: fdupes
|
2010-08-27 21:40:20 +02:00
|
|
|
BuildRequires: gcc-c++
|
2017-09-29 15:24:44 +02:00
|
|
|
BuildRequires: java-devel >= 1.6
|
2017-05-19 15:28:09 +02:00
|
|
|
BuildRequires: javapackages-tools
|
2017-05-19 15:51:12 +02:00
|
|
|
BuildRequires: python
|
2011-07-25 10:38:34 +02:00
|
|
|
BuildRequires: xml-commons-apis
|
2010-08-27 21:40:20 +02:00
|
|
|
Requires: %{name}-java
|
2011-07-25 10:38:34 +02:00
|
|
|
Provides: %{name}-bootstrap = %{version}
|
|
|
|
Obsoletes: %{name}-bootstrap < %{version}
|
2017-06-09 11:42:14 +02:00
|
|
|
Obsoletes: %{name}-javadoc
|
2014-04-30 17:26:10 +02:00
|
|
|
|
2007-01-15 23:51:10 +01:00
|
|
|
%description
|
|
|
|
ANTLR, Another Tool for Language Recognition, (formerly PCCTS) is a
|
|
|
|
language tool that provides a framework for constructing recognizers,
|
|
|
|
compilers, and translators from grammatical descriptions containing C++
|
|
|
|
or Java actions (you can use PCCTS 1.xx to generate C-based parsers).
|
|
|
|
|
2010-08-27 21:40:20 +02:00
|
|
|
%package java
|
|
|
|
Summary: ANother Tool for Language Recognition (Manual)
|
2011-07-25 10:38:34 +02:00
|
|
|
Group: Development/Tools/Other
|
2017-09-29 15:24:44 +02:00
|
|
|
Requires: java >= 1.6
|
2011-07-25 10:38:34 +02:00
|
|
|
BuildArch: noarch
|
2007-01-15 23:51:10 +01:00
|
|
|
|
2010-08-27 21:40:20 +02:00
|
|
|
%description java
|
2011-07-25 10:38:34 +02:00
|
|
|
ANTLR, Another Tool for Language Recognition, (formerly PCCTS) is a
|
|
|
|
language tool that provides a framework for constructing recognizers,
|
|
|
|
compilers, and translators from grammatical descriptions containing C++
|
|
|
|
or Java actions (you can use PCCTS 1.xx to generate C-based parsers).
|
|
|
|
|
|
|
|
This package provides the Java runtime for antlr
|
2007-01-15 23:51:10 +01:00
|
|
|
|
|
|
|
%package manual
|
|
|
|
Summary: ANother Tool for Language Recognition (Manual)
|
2011-07-25 10:38:34 +02:00
|
|
|
Group: Development/Tools/Other
|
2010-08-27 21:40:20 +02:00
|
|
|
BuildArch: noarch
|
2007-01-15 23:51:10 +01:00
|
|
|
|
|
|
|
%description manual
|
2011-07-25 10:38:34 +02:00
|
|
|
ANTLR, Another Tool for Language Recognition, (formerly PCCTS) is a
|
|
|
|
language tool that provides a framework for constructing recognizers,
|
|
|
|
compilers, and translators from grammatical descriptions containing C++
|
|
|
|
or Java actions (you can use PCCTS 1.xx to generate C-based parsers).
|
|
|
|
|
|
|
|
This package provides the manual and examples for antlr.
|
2007-01-15 23:51:10 +01:00
|
|
|
|
2010-08-27 21:40:20 +02:00
|
|
|
%package devel
|
|
|
|
Summary: ANother Tool for Language Recognition (c++ runtime)
|
2011-07-25 10:38:34 +02:00
|
|
|
Group: Development/Tools/Other
|
2010-08-27 21:40:20 +02:00
|
|
|
Requires: antlr
|
2007-01-15 23:51:10 +01:00
|
|
|
|
2010-08-27 21:40:20 +02:00
|
|
|
%description devel
|
2011-07-25 10:38:34 +02:00
|
|
|
ANTLR, Another Tool for Language Recognition, (formerly PCCTS) is a
|
|
|
|
language tool that provides a framework for constructing recognizers,
|
|
|
|
compilers, and translators from grammatical descriptions containing C++
|
|
|
|
or Java actions (you can use PCCTS 1.xx to generate C-based parsers).
|
|
|
|
|
2014-07-04 13:18:25 +02:00
|
|
|
This package provides the C++ runtime (libantlr.a) and a headers files
|
2011-07-25 10:38:34 +02:00
|
|
|
of antlr
|
2010-08-27 21:40:20 +02:00
|
|
|
|
|
|
|
%package -n python-%{name}
|
|
|
|
Summary: ANother Tool for Language Recognition (python runtime)
|
2011-07-25 10:38:34 +02:00
|
|
|
Group: Development/Tools/Other
|
2010-08-27 21:40:20 +02:00
|
|
|
Requires: antlr
|
|
|
|
|
|
|
|
%description -n python-%{name}
|
|
|
|
Python support for generating your Lexers, Parsers and TreeParsers in Python.
|
|
|
|
This feature extends the benefits of ANTLR's predicated-LL(k) parsing
|
|
|
|
technology to the Python language and platform.
|
|
|
|
|
|
|
|
ANTLR Python support was contributed (and is to be maintained) by Wolfgang
|
|
|
|
Haefelinger and Marq Kole.
|
|
|
|
|
2007-01-15 23:51:10 +01:00
|
|
|
%prep
|
|
|
|
%setup -q
|
|
|
|
# remove all binary libs
|
|
|
|
find . -name "*.jar" -exec rm -f {} \;
|
2017-09-21 12:59:26 +02:00
|
|
|
find . -name Makefile.in | xargs chmod 0644
|
2014-07-04 13:18:25 +02:00
|
|
|
%patch0
|
2007-01-15 23:51:10 +01:00
|
|
|
cp -p %{SOURCE1} build.xml
|
2010-08-27 21:40:20 +02:00
|
|
|
#Fix the source so that it compiles with GCC 4.5
|
|
|
|
%patch1 -p1
|
|
|
|
#Ensure that the manuals are installed in the correct openSUSE docpath
|
2014-07-04 13:18:25 +02:00
|
|
|
%patch2
|
2007-01-15 23:51:10 +01:00
|
|
|
# check for license problematic files:
|
|
|
|
find | grep "\(ShowString.java$\|StreamConverter.java$\)" && exit 42
|
|
|
|
|
|
|
|
%build
|
2014-07-04 13:18:25 +02:00
|
|
|
ant \
|
|
|
|
-Dj2se.apidoc=%{_javadocdir}/java \
|
2017-09-06 20:06:08 +02:00
|
|
|
-Dant.build.javac.source=1.6 -Dant.build.javac.target=1.6 \
|
2017-06-09 11:42:14 +02:00
|
|
|
jar
|
2010-08-27 21:40:20 +02:00
|
|
|
%configure
|
2014-07-04 13:18:25 +02:00
|
|
|
make -j1
|
2010-08-27 21:40:20 +02:00
|
|
|
%py_compile lib/python/antlr
|
2007-01-15 23:51:10 +01:00
|
|
|
|
|
|
|
%install
|
2010-08-27 21:40:20 +02:00
|
|
|
#### jars ###
|
2011-07-25 10:38:34 +02:00
|
|
|
install -d -m 0755 %{buildroot}%{_javadir}
|
|
|
|
cp -a work/lib/%{name}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
|
|
|
|
(cd %{buildroot}%{_javadir} && for jar in *-%{version}.jar; do ln -s -f ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
|
2010-08-27 21:40:20 +02:00
|
|
|
# compat symlink
|
2011-07-25 10:38:34 +02:00
|
|
|
install -d -m 0755 %{buildroot}%{_datadir}/%{name}-%{version}/
|
|
|
|
ln -s -f %{_javadir}/%{name}-%{version}.jar %{buildroot}%{_datadir}/%{name}-%{version}/%{name}.jar
|
2010-08-27 21:40:20 +02:00
|
|
|
|
|
|
|
### scripts ###
|
2011-07-25 10:38:34 +02:00
|
|
|
install -d -m 0755 %{buildroot}%{_bindir}/
|
|
|
|
install -m 0755 %{SOURCE2} %{buildroot}%{_bindir}/%{name}
|
|
|
|
install -m 0755 scripts/%{name}-config %{buildroot}%{_bindir}/
|
2010-08-27 21:40:20 +02:00
|
|
|
|
|
|
|
### python runtime ###
|
2011-07-25 10:38:34 +02:00
|
|
|
install -d -m 0755 %{buildroot}%{py_sitedir}/%{name}
|
|
|
|
cp -a lib/python/antlr/* %{buildroot}%{py_sitedir}/%{name}
|
2010-08-27 21:40:20 +02:00
|
|
|
# compat symlink
|
2011-07-25 10:38:34 +02:00
|
|
|
ln -s -f %{py_sitedir}/%{name}/*.py %{buildroot}%{_datadir}/%{name}-%{version}/
|
|
|
|
ln -s -f %{py_sitedir}/%{name}/*.pyc %{buildroot}%{_datadir}/%{name}-%{version}/
|
2010-08-27 21:40:20 +02:00
|
|
|
|
|
|
|
### cpp runtime ###
|
2011-07-25 10:38:34 +02:00
|
|
|
install -m 0644 lib/cpp/src/lib%{name}.a %{buildroot}%{_libdir}
|
|
|
|
install -d -m 0755 %{buildroot}%{_includedir}/%{name}
|
|
|
|
install -m 0644 lib/cpp/%{name}/*hpp %{buildroot}%{_includedir}/%{name}
|
|
|
|
|
|
|
|
### find duplicates ###
|
2014-07-04 13:18:25 +02:00
|
|
|
find examples -type f | xargs chmod 0644
|
2011-07-25 10:38:34 +02:00
|
|
|
%fdupes -s examples
|
2017-09-21 12:59:26 +02:00
|
|
|
find doc -type f | xargs chmod 0644
|
|
|
|
%fdupes -s doc
|
2007-01-15 23:51:10 +01:00
|
|
|
|
2010-08-27 21:40:20 +02:00
|
|
|
%files
|
2014-07-04 13:18:25 +02:00
|
|
|
%doc LICENSE.txt README.txt CHANGES.txt
|
2010-08-27 21:40:20 +02:00
|
|
|
%dir %{_datadir}/%{name}-%{version}
|
|
|
|
%{_bindir}/antlr
|
|
|
|
%{_bindir}/antlr-config
|
2007-01-15 23:51:10 +01:00
|
|
|
|
2010-08-27 21:40:20 +02:00
|
|
|
%files java
|
|
|
|
%dir %{_datadir}/%{name}-%{version}
|
|
|
|
%{_datadir}/%{name}-%{version}/*jar
|
2007-01-15 23:51:10 +01:00
|
|
|
%{_javadir}/%{name}*.jar
|
|
|
|
|
|
|
|
%files manual
|
2010-08-27 21:40:20 +02:00
|
|
|
%doc doc examples
|
2007-01-15 23:51:10 +01:00
|
|
|
|
2010-08-27 21:40:20 +02:00
|
|
|
%files devel
|
2012-10-31 11:25:47 +01:00
|
|
|
%attr(755,root,root) %{_libdir}/libantlr.a
|
2010-08-27 21:40:20 +02:00
|
|
|
%{_includedir}/%{name}
|
|
|
|
|
|
|
|
%files -n python-%{name}
|
|
|
|
%dir %{_datadir}/%{name}-%{version}
|
|
|
|
%{_datadir}/%{name}-%{version}/*py
|
|
|
|
%{_datadir}/%{name}-%{version}/*pyc
|
2014-07-04 13:18:25 +02:00
|
|
|
%{py_sitedir}/%{name}
|
2010-08-27 21:40:20 +02:00
|
|
|
|
2007-05-04 11:03:51 +02:00
|
|
|
%changelog
|