2007-01-15 22:51:10 +00:00
|
|
|
#
|
2008-04-25 12:50:33 +00:00
|
|
|
# spec file for package antlr (Version 2.7.7)
|
2007-01-15 22:51:10 +00:00
|
|
|
#
|
2010-08-27 19:40:20 +00:00
|
|
|
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2007-01-15 22:51:10 +00:00
|
|
|
#
|
2009-06-18 22:51:30 +00: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 22:51:10 +00:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2010-08-27 19:40:20 +00:00
|
|
|
%define section free
|
2008-02-22 00:17:11 +00:00
|
|
|
|
2007-01-15 22:51:10 +00:00
|
|
|
Name: antlr
|
2008-04-25 12:50:33 +00:00
|
|
|
Version: 2.7.7
|
2011-07-25 08:38:34 +00:00
|
|
|
Release: 79
|
2010-08-27 19:40:20 +00:00
|
|
|
License: GPLv2+ ; Public Domain, Freeware ; MIT
|
2011-07-25 08:38:34 +00:00
|
|
|
Summary: Another Tool for Language Recognition
|
2008-01-30 16:39:47 +00:00
|
|
|
Url: http://www.antlr.org/
|
2007-01-15 22:51:10 +00:00
|
|
|
Group: Development/Tools/Other
|
|
|
|
#Source0: http://www.antlr.org/download/antlr-2.7.4.tar.gz
|
|
|
|
Source0: %{name}-%{version}.tar.bz2
|
|
|
|
Source1: %{name}-build.xml
|
|
|
|
Source2: %{name}-script
|
|
|
|
Source3: http://www.antlr.org/share/1069557132934/makefile.gcj
|
2010-08-27 19:40:20 +00:00
|
|
|
Source1000: antlr-rpmlintrc
|
2007-01-15 22:51:10 +00:00
|
|
|
Patch0: %{name}-jedit.patch
|
2010-08-27 19:40:20 +00:00
|
|
|
Patch1: gcc45fix.diff
|
|
|
|
Patch2: fix-docpath.diff
|
|
|
|
BuildRequires: ant
|
2011-07-25 08:38:34 +00:00
|
|
|
BuildRequires: fdupes
|
2010-08-27 19:40:20 +00:00
|
|
|
BuildRequires: gcc-c++
|
2011-07-25 08:38:34 +00:00
|
|
|
BuildRequires: java-devel
|
2010-08-27 19:40:20 +00:00
|
|
|
BuildRequires: libstdc++-devel
|
|
|
|
BuildRequires: mono-core
|
|
|
|
BuildRequires: mono-data
|
|
|
|
BuildRequires: mono-devel
|
2011-07-25 08:38:34 +00:00
|
|
|
BuildRequires: python-devel
|
2010-08-27 19:40:20 +00:00
|
|
|
BuildRequires: unzip
|
2011-07-25 08:38:34 +00:00
|
|
|
BuildRequires: xml-commons-apis
|
2010-08-27 19:40:20 +00:00
|
|
|
Requires: %{name}-java
|
2011-07-25 08:38:34 +00:00
|
|
|
Requires: jpackage-utils
|
|
|
|
Provides: %{name}-bootstrap = %{version}
|
|
|
|
Obsoletes: %{name}-bootstrap < %{version}
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
%py_requires
|
2007-01-15 22:51:10 +00: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 19:40:20 +00:00
|
|
|
# To not introduce arch dependent java package, lets have this in separate subpackage
|
|
|
|
%package java
|
|
|
|
License: GPLv2+ ; Public Domain, Freeware ; MIT
|
|
|
|
Summary: ANother Tool for Language Recognition (Manual)
|
2011-07-25 08:38:34 +00:00
|
|
|
Group: Development/Tools/Other
|
2010-08-27 19:40:20 +00:00
|
|
|
Requires: java >= 1.6.0
|
|
|
|
Provides: file:/%{_javadir}/%{name}.jar
|
2011-07-25 08:38:34 +00:00
|
|
|
BuildArch: noarch
|
2007-01-15 22:51:10 +00:00
|
|
|
|
2010-08-27 19:40:20 +00:00
|
|
|
%description java
|
2011-07-25 08:38:34 +00: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 22:51:10 +00:00
|
|
|
|
|
|
|
%package manual
|
2010-08-27 19:40:20 +00:00
|
|
|
License: GPLv2+ ; Public Domain, Freeware ; MIT
|
2007-01-15 22:51:10 +00:00
|
|
|
Summary: ANother Tool for Language Recognition (Manual)
|
2011-07-25 08:38:34 +00:00
|
|
|
Group: Development/Tools/Other
|
2010-08-27 19:40:20 +00:00
|
|
|
BuildArch: noarch
|
2007-01-15 22:51:10 +00:00
|
|
|
|
|
|
|
%description manual
|
2011-07-25 08:38:34 +00: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 22:51:10 +00:00
|
|
|
|
|
|
|
%package javadoc
|
2010-08-27 19:40:20 +00:00
|
|
|
License: GPLv2+ ; Public Domain, Freeware ; MIT
|
2007-01-15 22:51:10 +00:00
|
|
|
Summary: ANother Tool for Language Recognition (Java Documentation)
|
2011-07-25 08:38:34 +00:00
|
|
|
Group: Development/Tools/Other
|
|
|
|
PreReq: coreutils
|
2010-08-27 19:40:20 +00:00
|
|
|
BuildArch: noarch
|
2007-01-15 22:51:10 +00:00
|
|
|
|
|
|
|
%description javadoc
|
2011-07-25 08:38:34 +00: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 Javadoc for antlr.
|
2007-01-15 22:51:10 +00:00
|
|
|
|
2010-08-27 19:40:20 +00:00
|
|
|
%package devel
|
|
|
|
License: GPLv2+ ; Public Domain, Freeware ; MIT
|
|
|
|
Summary: ANother Tool for Language Recognition (c++ runtime)
|
2011-07-25 08:38:34 +00:00
|
|
|
Group: Development/Tools/Other
|
2010-08-27 19:40:20 +00:00
|
|
|
Requires: antlr
|
2007-01-15 22:51:10 +00:00
|
|
|
|
2010-08-27 19:40:20 +00:00
|
|
|
%description devel
|
2011-07-25 08:38:34 +00: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 C++ runtime (libantlr.a) and a headers files
|
|
|
|
of antlr
|
2010-08-27 19:40:20 +00:00
|
|
|
|
|
|
|
%package -n python-%{name}
|
|
|
|
|
|
|
|
License: GPLv2+ ; Public Domain, Freeware ; MIT
|
|
|
|
Summary: ANother Tool for Language Recognition (python runtime)
|
2011-07-25 08:38:34 +00:00
|
|
|
Group: Development/Tools/Other
|
2010-08-27 19:40:20 +00:00
|
|
|
Requires: antlr
|
|
|
|
%py_requires
|
|
|
|
|
|
|
|
%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.
|
|
|
|
|
|
|
|
%package csharp
|
|
|
|
License: GPLv2+ ; Public Domain, Freeware ; MIT
|
|
|
|
Summary: ANother Tool for Language Recognition (python runtime)
|
2011-07-25 08:38:34 +00:00
|
|
|
Group: Development/Tools/Other
|
2010-08-27 19:40:20 +00:00
|
|
|
Requires: antlr
|
2011-07-25 08:38:34 +00:00
|
|
|
Requires: mono-core
|
2010-08-27 19:40:20 +00:00
|
|
|
|
|
|
|
%description csharp
|
|
|
|
To be able to build and use the C# language Lexers, Parsers and TreeParsers,
|
|
|
|
you will need to link to the ANTLR C# runtime library. The C# runtime model is
|
|
|
|
based on the existing runtime models for Java and C++ and is thus immediately
|
|
|
|
familiar. The C# runtime and the Java runtime in particular are very similar
|
|
|
|
although there a number of subtle (and not so subtle) differences. Some of
|
|
|
|
these result from differences in the respective runtime environments.
|
|
|
|
|
|
|
|
ANTLR C# support was contributed (and is maintained) by Kunle Odutola, Micheal
|
|
|
|
Jordan and Anthony Oguntimehin.
|
2007-01-15 22:51:10 +00:00
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q
|
|
|
|
# remove all binary libs
|
|
|
|
find . -name "*.jar" -exec rm -f {} \;
|
|
|
|
%patch0 -p0
|
|
|
|
cp -p %{SOURCE1} build.xml
|
2010-08-27 19:40:20 +00: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
|
|
|
|
%patch2 -p0
|
2007-01-15 22:51:10 +00:00
|
|
|
# check for license problematic files:
|
|
|
|
find | grep "\(ShowString.java$\|StreamConverter.java$\)" && exit 42
|
|
|
|
|
|
|
|
%build
|
|
|
|
ant -Dj2se.apidoc=%{_javadocdir}/java
|
2010-08-27 19:40:20 +00:00
|
|
|
%configure
|
2011-07-25 08:38:34 +00:00
|
|
|
make
|
2010-08-27 19:40:20 +00:00
|
|
|
%py_compile lib/python/antlr
|
2007-01-15 22:51:10 +00:00
|
|
|
|
|
|
|
%install
|
2010-08-27 19:40:20 +00:00
|
|
|
# % {makeinstall}
|
|
|
|
# The upstream make install just installs a files to more or less random location
|
|
|
|
# instead of fixing it, let's install it in %%install section
|
|
|
|
|
|
|
|
#### jars ###
|
2011-07-25 08:38:34 +00: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 19:40:20 +00:00
|
|
|
# compat symlink
|
2011-07-25 08:38:34 +00: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 19:40:20 +00:00
|
|
|
|
|
|
|
### scripts ###
|
2011-07-25 08:38:34 +00: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 19:40:20 +00:00
|
|
|
|
|
|
|
### javadoc ###
|
2011-07-25 08:38:34 +00:00
|
|
|
install -d -m 0755 %{buildroot}%{_javadocdir}/%{name}
|
|
|
|
cp -ar work/api/* %{buildroot}%{_javadocdir}/%{name}
|
2010-08-27 19:40:20 +00:00
|
|
|
|
|
|
|
### python runtime ###
|
2011-07-25 08:38:34 +00:00
|
|
|
install -d -m 0755 %{buildroot}%{py_sitedir}/%{name}
|
|
|
|
cp -a lib/python/antlr/* %{buildroot}%{py_sitedir}/%{name}
|
2010-08-27 19:40:20 +00:00
|
|
|
# compat symlink
|
2011-07-25 08:38:34 +00: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 19:40:20 +00:00
|
|
|
|
|
|
|
### csharp runtime ###
|
2011-07-25 08:38:34 +00:00
|
|
|
install -d -m 0755 %{buildroot}%{_libdir}
|
|
|
|
install -m 0755 lib/*dll %{buildroot}%{_libdir}
|
2010-08-27 19:40:20 +00:00
|
|
|
# compat symlink
|
2011-07-25 08:38:34 +00:00
|
|
|
ln -s -f %{_libdir}/%{name}.astframe.dll %{buildroot}%{_datadir}/%{name}-%{version}/
|
|
|
|
ln -s -f %{_libdir}/%{name}.runtime.dll %{buildroot}%{_datadir}/%{name}-%{version}/
|
2010-08-27 19:40:20 +00:00
|
|
|
|
|
|
|
### cpp runtime ###
|
2011-07-25 08:38:34 +00: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 ###
|
|
|
|
%fdupes -s examples
|
2007-01-15 22:51:10 +00:00
|
|
|
|
|
|
|
%clean
|
2010-08-27 19:40:20 +00:00
|
|
|
rm -rf %{buildroot}
|
|
|
|
|
|
|
|
%check
|
|
|
|
# % {__make} check
|
|
|
|
|
|
|
|
# % post -p /sbin/ldconfig
|
|
|
|
|
|
|
|
# % postun -p /sbin/ldconfig
|
|
|
|
|
|
|
|
%files
|
2007-01-15 22:51:10 +00:00
|
|
|
%defattr(0644,root,root,0755)
|
2010-08-27 19:40:20 +00:00
|
|
|
%doc LICENSE.txt README.txt CHANGES.txt
|
|
|
|
%dir %{_datadir}/%{name}-%{version}
|
2007-01-15 22:51:10 +00:00
|
|
|
%defattr(0755,root,root,0755)
|
2010-08-27 19:40:20 +00:00
|
|
|
%{_bindir}/antlr
|
|
|
|
%{_bindir}/antlr-config
|
2007-01-15 22:51:10 +00:00
|
|
|
|
2010-08-27 19:40:20 +00:00
|
|
|
%files java
|
2007-01-15 22:51:10 +00:00
|
|
|
%defattr(0644,root,root,0755)
|
2010-08-27 19:40:20 +00:00
|
|
|
%dir %{_datadir}/%{name}-%{version}
|
|
|
|
%{_datadir}/%{name}-%{version}/*jar
|
2007-01-15 22:51:10 +00:00
|
|
|
%{_javadir}/%{name}*.jar
|
|
|
|
|
|
|
|
%files manual
|
|
|
|
%defattr(0644,root,root,0755)
|
2010-08-27 19:40:20 +00:00
|
|
|
%doc doc examples
|
2007-01-15 22:51:10 +00:00
|
|
|
|
|
|
|
%files javadoc
|
|
|
|
%defattr(0644,root,root,0755)
|
2010-08-27 19:40:20 +00:00
|
|
|
%doc %{_javadocdir}/%{name}
|
|
|
|
|
|
|
|
%files devel
|
|
|
|
%defattr(-,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
|
|
|
|
%py_sitedir/%{name}
|
|
|
|
|
|
|
|
%files csharp
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%dir %{_datadir}/%{name}-%{version}
|
|
|
|
%{_datadir}/%{name}-%{version}/*dll
|
|
|
|
%{_libdir}/*.dll
|
2007-01-15 22:51:10 +00:00
|
|
|
|
2007-05-04 09:03:51 +00:00
|
|
|
%changelog
|