4ef589
%global debug_package %{nil}
4ef589
# since we have only a static library
4ef589
4ef589
Summary:		ANother Tool for Language Recognition
4ef589
Name:			antlr
4ef589
Version:		2.7.7
67b6c0
Release:		30%{?dist}
4ef589
Epoch:			0
4ef589
License:		Public Domain
4ef589
URL:			http://www.antlr.org/
4ef589
Group:			Development/Tools
4ef589
Source0:		http://www.antlr2.org/download/antlr-%{version}.tar.gz
4ef589
Source1:		%{name}-build.xml
4ef589
Source2:		%{name}-script
4ef589
Source3:                http://repo2.maven.org/maven2/%{name}/%{name}/%{version}/%{name}-%{version}.pom
4ef589
Patch1:			%{name}-%{version}-newgcc.patch
4ef589
# see BZ#848662
4ef589
Patch2:			antlr-examples-license.patch
4ef589
BuildRoot:		%{_tmppath}/%{name}-%{version}-%{release}-buildroot
4ef589
4ef589
%ifarch %ix86 x86_64 ia64 armv4l sparcv9 alpha s390x ppc ppc64
4ef589
%if ! 0%{?rhel} >= 6
4ef589
BuildRequires:	mono-core
4ef589
BuildRequires:	mono-winforms
4ef589
%endif
4ef589
%endif
4ef589
BuildRequires:	ant
4ef589
BuildRequires:	java-javadoc
4ef589
BuildRequires:	jpackage-utils
4ef589
BuildRequires:	java-devel >= 1:1.7.0
4ef589
4ef589
Requires:		jpackage-utils
4ef589
Requires:		java >= 1:1.7.0
4ef589
4ef589
%description
4ef589
ANTLR, ANother Tool for Language Recognition, (formerly PCCTS) is a
4ef589
language tool that provides a framework for constructing recognizers,
4ef589
compilers, and translators from grammatical descriptions containing
4ef589
C++ or Java actions [You can use PCCTS 1.xx to generate C-based
4ef589
parsers].
4ef589
4ef589
%package			tool
4ef589
Group:				Development/Tools
4ef589
Summary:			ANother Tool for Language Recognition
4ef589
Provides:			%{name} = %{version}-%{release}
4ef589
Obsoletes:			%{name} < %{version}-%{release}
4ef589
Requires:			jpackage-utils
4ef589
Requires:			java >= 1:1.7.0
4ef589
BuildArch:			noarch
4ef589
4ef589
%description	tool
4ef589
ANTLR, ANother Tool for Language Recognition, (formerly PCCTS) is a
4ef589
language tool that provides a framework for constructing recognizers,
4ef589
compilers, and translators from grammatical descriptions containing
4ef589
C++ or Java actions [You can use PCCTS 1.xx to generate C-based
4ef589
parsers].
4ef589
4ef589
%package		manual
4ef589
Group:			Development/Tools
4ef589
Summary:		Manual for %{name}
4ef589
BuildArch:		noarch
4ef589
4ef589
%description	manual
4ef589
Documentation for %{name}.
4ef589
4ef589
%package		javadoc
4ef589
Group:			Documentation
4ef589
Summary:		Javadoc for %{name}
4ef589
BuildArch:		noarch
4ef589
4ef589
%description	javadoc
4ef589
Javadoc for %{name}.
4ef589
4ef589
%package		C++
4ef589
Group:			Development/Libraries
4ef589
Summary:		C++ bindings for antlr2 generated parsers
4ef589
Provides:		antlr-static = %{version}-%{release}
4ef589
4ef589
%description	C++
4ef589
This package provides a static C++ library for parsers generated by ANTLR2.
4ef589
4ef589
%package		C++-doc
4ef589
Group:			Documentation
4ef589
Summary:		Documentation for C++ bindings for antlr2 generated parsers
4ef589
BuildRequires:	doxygen
4ef589
BuildArch:		noarch
4ef589
4ef589
%description	C++-doc
4ef589
This package contains the documentation for the C++ bindings for parsers
4ef589
generated by ANTLR2.
4ef589
4ef589
%package		python
4ef589
Group:			Development/Libraries
4ef589
Summary:		Python runtime support for ANTLR-generated parsers
4ef589
BuildRequires:	python2-devel
4ef589
BuildRequires:	python-setuptools-devel
4ef589
BuildArch:		noarch
4ef589
4ef589
%description	python
4ef589
Python runtime support for ANTLR-generated parsers
4ef589
4ef589
%prep
4ef589
%setup -q
4ef589
# remove all binary libs
4ef589
find . -name "*.jar" -exec rm -f {} \;
4ef589
cp -p %{SOURCE1} build.xml
4ef589
%patch1
4ef589
%patch2 -p1
4ef589
# CRLF->LF
4ef589
sed -i 's/\r//' LICENSE.txt
4ef589
4ef589
%build
4ef589
ant -Dj2se.apidoc=%{_javadocdir}/java
4ef589
cp work/lib/antlr.jar .  # make expects to find it here
4ef589
export CLASSPATH=.
4ef589
%configure --without-examples
4ef589
make CXXFLAGS="${CXXFLAGS} -fPIC" DEBUG=1 verbose=1
4ef589
rm antlr.jar			 # no longer needed
4ef589
4ef589
# fix doc permissions and remove Makefiles
4ef589
rm doc/{Makefile,Makefile.in}
4ef589
chmod 0644 doc/*
4ef589
4ef589
# generate doxygen docs for C++ bindings
4ef589
pushd lib/cpp
4ef589
	doxygen doxygen.cfg
4ef589
	find gen_doc -type f -exec chmod 0644 {} \;
4ef589
popd
4ef589
4ef589
# build python
4ef589
cd lib/python
4ef589
%{__python} setup.py build
4ef589
cd ../../
4ef589
4ef589
%install
4ef589
rm -rf $RPM_BUILD_ROOT
4ef589
mkdir -p $RPM_BUILD_ROOT{%{_includedir}/%{name},%{_libdir},%{_bindir}}
4ef589
4ef589
# jars
4ef589
mkdir -p $RPM_BUILD_ROOT%{_javadir}
4ef589
cp -p work/lib/%{name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
4ef589
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
4ef589
4ef589
# script
4ef589
install -p -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/antlr
4ef589
67b6c0
# C++ lib and headers
4ef589
4ef589
install -p -m 644 lib/cpp/antlr/*.hpp $RPM_BUILD_ROOT%{_includedir}/%{name}
4ef589
install -p -m 644 lib/cpp/src/libantlr.a $RPM_BUILD_ROOT%{_libdir}
4ef589
4ef589
# javadoc
4ef589
mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
4ef589
cp -pr work/api/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
4ef589
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}
4ef589
4ef589
# python
4ef589
cd lib/python
4ef589
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
4ef589
cd ../..
4ef589
4ef589
# POM and depmap
4ef589
install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
4ef589
install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}.pom
4ef589
%add_maven_depmap -a antlr:antlrall
4ef589
4ef589
%clean
4ef589
rm -rf $RPM_BUILD_ROOT
4ef589
4ef589
%files tool
4ef589
%defattr(-,root,root,-)
4ef589
%doc LICENSE.txt
4ef589
%{_javadir}/%{name}*.jar
4ef589
%{_bindir}/antlr
4ef589
%{_mavenpomdir}/JPP-%{name}.pom
4ef589
%{_mavendepmapfragdir}/%{name}
4ef589
4ef589
# this is actually a development package for the C++ target
4ef589
# as we ship only a static library, it doesn't make sense
4ef589
# to have a separate -devel package for the headers
4ef589
%files C++
4ef589
%defattr(-,root,root,-)
4ef589
%{_includedir}/%{name}
4ef589
%{_libdir}/libantlr.a
4ef589
4ef589
%files C++-doc
4ef589
%defattr(-,root,root,-)
4ef589
%doc lib/cpp/gen_doc/html/
4ef589
4ef589
%files manual
4ef589
%defattr(-,root,root,-)
4ef589
%doc doc/*
4ef589
4ef589
%files javadoc
4ef589
%defattr(-,root,root,-)
4ef589
%doc %{_javadocdir}/%{name}-%{version}
4ef589
%doc %{_javadocdir}/%{name}
4ef589
4ef589
%files python
4ef589
%defattr(-,root,root,-)
4ef589
%{python_sitelib}/antlr/*
4ef589
%{python_sitelib}/antlr-*
4ef589
4ef589
%changelog
67b6c0
* Fri Mar 14 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:2.7.7-30
67b6c0
- Don't install antlr-config script
67b6c0
- Resolves: rhbz#1076406
67b6c0
67b6c0
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 02.7.7-29
67b6c0
- Mass rebuild 2014-01-24
67b6c0
67b6c0
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 02.7.7-28
67b6c0
- Mass rebuild 2013-12-27
67b6c0
4ef589
* Fri Jun 28 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:2.7.7-27
4ef589
- Rebuild to regenerate API documentation
4ef589
- Resolves: CVE-2013-1571
4ef589
4ef589
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:2.7.7-26
4ef589
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
4ef589
4ef589
* Sun Nov 25 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:2.7.7-25
4ef589
- Move maven files from C++ to tool subpackage, resolves: rhbz#879885
4ef589
4ef589
* Thu Nov  1 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:2.7.7-24
4ef589
- Add maven POM
4ef589
4ef589
* Sat Aug 18 2012 Miloš Jakubíček <xjakub@fi.muni.cz> - 0:2.7.7-23
4ef589
- Add patch updating license on ShowString.java and StreamConverter.java
4ef589
  examples (thanks to Tom Callaway, see BZ#848662)
4ef589
4ef589
* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:2.7.7-22
4ef589
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
4ef589
4ef589
* Wed Feb 01 2012 Jaroslav Reznik <jreznik@redhat.com> 0:2.7.7-21
4ef589
- wrong version for jpackage-utils
4ef589
4ef589
* Wed Feb 01 2012 Jaroslav Reznik <jreznik@redhat.com> 0:2.7.7-20
4ef589
- Versioned Java (build)/requires for -tool too
4ef589
4ef589
* Mon Jan 30 2012 Jaroslav Reznik <jreznik@redhat.com> 0:2.7.7-19
4ef589
- Versioned Java (build)/requires
4ef589
4ef589
* Fri Jan 27 2012 Alexander Kurtakov <akurtako@redhat.com> 0:2.7.7-18
4ef589
- Disable c# part for rhel builds.
4ef589
4ef589
* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:2.7.7-17
4ef589
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
4ef589
4ef589
* Fri Mar 25 2011 Miloš Jakubíček <xjakub@fi.muni.cz> - 0:2.7.7-16
4ef589
- Fixed wrong Obsoletes: antlr on antlr-tool (fix #689703)
4ef589
4ef589
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:2.7.7-15
4ef589
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
4ef589
4ef589
* Mon Feb 07 2011 Miloš Jakubíček <xjakub@fi.muni.cz> - 0:2.7.7-14
4ef589
- Remove INSTALL.txt (fix BZ#661626)
4ef589
- add python subpackage (fix BZ#505312)
4ef589
4ef589
* Mon Feb 07 2011 Miloš Jakubíček <xjakub@fi.muni.cz> - 0:2.7.7-13
4ef589
- Added missing Obsoletes: antlr on antlr-tool (fix BZ#603466)
4ef589
4ef589
* Mon Dec 13 2010 Dan Horák <dan[at]danny.cz> - 0:2.7.7-12
4ef589
- sync the architecture list in BR with the mono package
4ef589
4ef589
* Tue Nov 23 2010 Rex Dieter <rdieter@fedoraproject.org> - 0:2.7.7-11
4ef589
- -tool: +Requires: java jpackage-utils (#595504)
4ef589
4ef589
* Thu Apr 29 2010 Miloš Jakubíček <xjakub@fi.muni.cz> - 0:2.7.7-10
4ef589
- Use original upstream tarball, prebuilt jars are anyway removed in %%prep
4ef589
- Don't overuse macros
4ef589
- Added explanation about headers in the C++ subpackage
4ef589
- Remove unnecessary Makefile and Makefile.in from %%docs, permissions fixed
4ef589
- Added doxygen docs for C++ as a -C++-doc subpackage
4ef589
- antlr-config moved into the C++ subpackage
4ef589
- Removed %%post and %%postun javadoc relicts from JPackage
4ef589
4ef589
* Tue Apr 27 2010 Miloš Jakubíček <xjakub@fi.muni.cz> - 0:2.7.7-9
4ef589
- Drop native build, alternatives, jedit, gcj bits and other jpackage crap
4ef589
- Disable debuginfo since we have only a static library.
4ef589
- Use %%global everywhere
4ef589
- Split the C++ bindings into a separate -C++ subpackage
4ef589
- Use -tool subpackage with Provide: antlr to make it possible to be noarch
4ef589
- Use sed instead of perl => drop BR: perl
4ef589
4ef589
* Tue Apr 20 2010 Orion Poplawski <orion@cora.nwra.com> 0:2.7.7-8
4ef589
- Cannot be noarch
4ef589
4ef589
* Wed Apr 7 2010 Alexander Kurtakov <akurtako@redhat.com> 0:2.7.7-7
4ef589
- Disable gcj.
4ef589
- Use %%global.
4ef589
4ef589
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:2.7.7-6
4ef589
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
4ef589
4ef589
* Fri Mar 20 2009 Deepak Bhole <dbhole@redhat.com> - 0:2.7.7-5
4ef589
- Include cstdio in CharScanner.hpp (needed to build with GCC 4.4)
4ef589
- Merge changes from includestrings patch into the above one
4ef589
4ef589
* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0:2.7.7-4
4ef589
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
4ef589
4ef589
* Fri Jan 09 2009 Dennis Gilmore <dennis@ausil.us> 2.7.7-3
4ef589
- exlcude using mono on sparc64
4ef589
4ef589
* Wed Jul  9 2008 Tom "spot" Callaway <tcallawa@redhat.com> 2.7.7-2
4ef589
- drop repotag
4ef589
4ef589
* Wed Feb 27 2008 Deepak Bhole <dbhole@redhat.com> - 0:2.7.7-1jpp.7
4ef589
- Add strings inclusion (for GCC 4.3)
4ef589
4ef589
* Mon Sep 24 2007 Deepak Bhole <dbhole@redhat.com> - 0:2.7.7-1jpp.6
4ef589
- Resolve bz# 242305: Remove libantlr-pic.a, and compile libantlr.a with fPIC
4ef589
4ef589
* Wed Aug 29 2007 Fedora Release Engineering <rel-eng at fedoraproject dot org> - 2.7.7-1jpp.5
4ef589
- Rebuild for selinux ppc32 issue.
4ef589
4ef589
* Tue Jun 12 2007 Deepak Bhole <dbhole@redhat.com> 2.7.7-1jpp.4.fc8
4ef589
- Added a PIC compiled archive (bz# 242305)
4ef589
4ef589
* Thu Jun 07 2007 Deepak Bhole <dbhole@redhat.com> 2.7.7-1jpp.3
4ef589
- Applied patch to fix conditionals (from skasal at redhat dot com)
4ef589
4ef589
* Mon Mar 26 2007 Deepak Bhole <dbhole@redhat.com> 2.7.7-1jpp.2
4ef589
- Added unowned dir to files list
4ef589
4ef589
* Fri Jan 19 2007 Deepak Bhole <dbhole@redhat.com> 0:2.7.7-1jpp.1
4ef589
- Upgrade to 2.7.7
4ef589
- Resolve 172456 with patches from Vadim Nasardinov and Radu Greab
4ef589
4ef589
* Thu Aug 03 2006 Deepak Bhole <dbhole@redhat.com> = 0:2.7.6-4jpp.2
4ef589
- Add missing postun for javadoc.
4ef589
4ef589
* Thu Aug 03 2006 Deepak Bhole <dbhole@redhat.com> = 0:2.7.6-4jpp.1
4ef589
- Add missing requirements.
4ef589
4ef589
* Sat Jul 22 2006 Thomas Fitzsimmons <fitzsim@redhat.com> - 0:2.7.6-3jpp_5fc
4ef589
- Unstub docs.
4ef589
4ef589
* Sat Jul 22 2006 Jakub Jelinek <jakub@redhat.com> - 0:2.7.6-3jpp_4fc
4ef589
- Remove hack-libgcj requirement.
4ef589
4ef589
* Fri Jul 21 2006 Thomas Fitzsimmons <fitzsim@redhat.com> - 0:2.7.6-3jpp_3fc
4ef589
- Stub docs. (dist-fc6-java)
4ef589
- Require hack-libgcj for build. (dist-fc6-java)
4ef589
- Bump release number.
4ef589
4ef589
* Wed Jul 19 2006 Deepak Bhole <dbhole@redhat.com> = 0:2.7.6-3jpp_2fc
4ef589
- From gbenson@redhat:
4ef589
- Omit the jedit subpackage to fix dependencies. 
4ef589
4ef589
* Wed Jul 19 2006 Deepak Bhole <dbhole@redhat.com> = 0:2.7.6-3jpp_1fc
4ef589
- Added conditional native compilation.
4ef589
4ef589
* Fri Jan 13 2006 Fernando Nasser <fnasser@redhat.com> - 0:2.7.6-2jpp
4ef589
- First JPP 1.7 build
4ef589
4ef589
* Fri Jan 13 2006 Fernando Nasser <fnasser@redhat.com> - 0:2.7.6-1jpp
4ef589
- Update to 2.7.6.
4ef589
4ef589
* Fri Aug 20 2004 Ralph Apel <r.apel at r-apel.de> - 0:2.7.4-2jpp
4ef589
- Build with ant-1.6.2.
4ef589
- Made native scripts conditional
4ef589
4ef589
* Tue May 18 2004 Ville Skyttä <ville.skytta at iki.fi> - 0:2.7.4-1jpp
4ef589
- Update to 2.7.4.
4ef589
4ef589
* Fri Apr  2 2004 Ville Skyttä <ville.skytta at iki.fi> - 0:2.7.3-2jpp
4ef589
- Create alternatives also on upgrades.
4ef589
4ef589
* Wed Mar 31 2004 Ville Skyttä <ville.skytta at iki.fi> - 0:2.7.3-1jpp
4ef589
- Update to 2.7.3.
4ef589
- Include gcj build option and a native subpackage, build using
4ef589
  "--with native" to get that.
4ef589
- Add %%{_bindir}/antlr alternative.
4ef589
4ef589
* Mon Dec 15 2003 Ville Skyttä <ville.skytta at iki.fi> - 0:2.7.2-3jpp
4ef589
- Add non-versioned javadoc dir symlink.
4ef589
- Crosslink with local J2SE javadocs.
4ef589
- Spec cleanups, change to UTF-8.
4ef589
4ef589
* Sun Mar 30 2003 Ville Skyttä <ville.skytta at iki.fi> - 0:2.7.2-2jpp
4ef589
- Rebuild for JPackage 1.5.
4ef589
4ef589
* Sat Mar  1 2003 Ville Skyttä <ville.skytta at iki.fi> - 2.7.2-1jpp
4ef589
- Update to 2.7.2.
4ef589
- Include antlr script and jEdit mode (see antlr-jedit RPM description).
4ef589
- Use sed instead of bash 2 extension when symlinking jars during build.
4ef589
4ef589
* Tue May 07 2002 Guillaume Rousse <guillomovitch@users.sourceforge.net> 2.7.1-8jpp
4ef589
- really section macro
4ef589
- hardcoded distribution and vendor tag
4ef589
- group tag again
4ef589
4ef589
* Thu May 2 2002 Guillaume Rousse <guillomovitch@users.sourceforge.net> 2.7.1-7jpp
4ef589
- distribution tag
4ef589
- group tag
4ef589
- section macro
4ef589
4ef589
* Fri Jan 18 2002 Guillaume Rousse <guillomovitch@users.sourceforge.net> 2.7.1-6jpp
4ef589
- versioned dir for javadoc
4ef589
- no dependencies for manual and javadoc packages
4ef589
- additional sources in individual archives
4ef589
4ef589
* Sat Dec 1 2001 Guillaume Rousse <guillomovitch@users.sourceforge.net> 2.7.1-5jpp
4ef589
- javadoc in javadoc package
4ef589
4ef589
* Wed Nov 21 2001 Christian Zoffoli <czoffoli@littlepenguin.org> 2.7.1-4jpp
4ef589
- removed packager tag
4ef589
- new jpp extension
4ef589
4ef589
* Sat Oct 6 2001 Guillaume Rousse <guillomovitch@users.sourceforge.net> 2.7.1-3jpp
4ef589
- used a build file instead of makefile
4ef589
- build classes instead of blindly jared them !
4ef589
- used original tarball
4ef589
- corrected license spelling
4ef589
4ef589
* Sun Sep 30 2001 Guillaume Rousse <guillomovitch@users.sourceforge.net> 2.7.1-2jpp
4ef589
- first unified release
4ef589
- s/jPackage/JPackage
4ef589
4ef589
* Tue Aug 28 2001 Guillaume Rousse <guillomovitch@users.sourceforge.net> 2.7.1-1mdk
4ef589
- first Mandrake release