antlr/antlr.spec

214 lines
6.6 KiB
RPMSpec
Raw Normal View History

#
# spec file for package antlr (Version 2.7.6)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: antlr
BuildRequires: ant gcc-c++ java2-devel-packages xml-commons-apis
%define section free
%define native 0
Summary: Another Tool for Language Recognition
Version: 2.7.6
Release: 21
License: GNU General Public License (GPL), Public Domain, Freeware
URL: http://www.antlr.org/
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
Patch0: %{name}-jedit.patch
Patch150: java150_build.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if %{native}
%else
BuildArch: noarch
Requires: jpackage-utils
PreReq: %{_sbindir}/update-alternatives
Requires(postun): %{_sbindir}/update-alternatives
# add conflict with pccts package which we had up to 9.1:
Conflicts: pccts
%endif
Provides: %{name}-bootstrap
Obsoletes: %{name}-bootstrap
%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).
%package manual
Group: Development/Tools/Other
Summary: ANother Tool for Language Recognition (Manual)
%description manual
Manual for antlr.
%package javadoc
PreReq: coreutils
Group: Development/Tools/Other
Summary: ANother Tool for Language Recognition (Java Documentation)
%description javadoc
Javadoc for antlr.
%prep
%setup -q
# remove all binary libs
find . -name "*.jar" -exec rm -f {} \;
%if !%{native}
%patch0 -p0
cp -p %{SOURCE1} build.xml
## fixup paths to manual
#%{__perl} -pi -e 's|"doc/|"%{_docdir}/%{name}-manual-%{version}/|g' \
# install.html
%patch150 -p1
%endif
# check for license problematic files:
find | grep "\(ShowString.java$\|StreamConverter.java$\)" && exit 42
%build
%if %{native}
%{__make} -f %{SOURCE3} COMPOPTS="$RPM_OPT_FLAGS"
%else
ant -Dj2se.apidoc=%{_javadocdir}/java
%endif
%install
install -dm 755 $RPM_BUILD_ROOT%{_bindir}
touch $RPM_BUILD_ROOT%{_bindir}/antlr # for %%ghost
%if %{native}
install -pm 755 cantlr $RPM_BUILD_ROOT%{_bindir}/antlr-native
%else
# jars
mkdir -p $RPM_BUILD_ROOT%{_javadir}
cp -p work/lib/%{name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
# script
cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/antlr-java
# javadoc
mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr work/api/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%post
%{_sbindir}/update-alternatives --install %{_bindir}/antlr \
%{name} %{_bindir}/antlr-java 10
%postun
if [ $1 -eq 0 ] ; then
%{_sbindir}/update-alternatives --remove %{name} %{_bindir}/antlr-java
fi
%if %{native}
%post native
%{_sbindir}/update-alternatives --install %{_bindir}/antlr \
%{name} %{_bindir}/antlr-native 20
%postun native
if [ $1 -eq 0 ] ; then
%{_sbindir}/update-alternatives --remove %{name} %{_bindir}/antlr-native
fi
%endif
%post javadoc
rm -f %{_javadocdir}/%{name}
ln -s %{name}-%{version} %{_javadocdir}/%{name}
%if %{native}
%files native
%defattr(0644,root,root,0755)
%doc install.html LICENSE.txt
%defattr(0755,root,root,0755)
%ghost %{_bindir}/antlr
%{_bindir}/antlr-native
%else
%files
%defattr(0644,root,root,0755)
%doc LICENSE.txt
%{_javadir}/%{name}*.jar
%defattr(0755,root,root,0755)
%ghost %{_bindir}/antlr
%{_bindir}/antlr-java
%files manual
%defattr(0644,root,root,0755)
%doc doc/*
%files javadoc
%defattr(0644,root,root,0755)
%doc %{_javadocdir}/%{name}-%{version}
%ghost %doc %{_javadocdir}/%{name}
%endif
%changelog -n antlr
* Sat Oct 07 2006 - dbornkessel@suse.de
- added check that checks whether deleted files ShowString.java and StreamConverter.java are really not in place
* Thu Oct 05 2006 - dbornkessel@suse.de
- deleted
antlr-2.7.6/examples/java/unicode.IDENTs/ShowString.java
antlr-2.7.6/examples/java/unicode.IDENTs/StreamConverter.java
from tar ball due to licensing issues (Bug #207621)
* Mon Sep 25 2006 - dbornkessel@suse.de
- fixes necessary to compile with Java 1.5.0
- set source="1.4" and target="1.4" for ant "javac" tasks
- set source="1.4" for ant "javadoc" tasks
* Wed Sep 20 2006 - dbornkessel@suse.de
- Provide: antlr-bootstrap
Obsoletes: antlr-bootstrap
* Mon Sep 18 2006 - dbornkessel@suse.de
- update to 2.7.6
- added size, index methods to TokenStreamRewriteEngine.java
- bug in syn preds for tree parsers. Submitted by Ole Kniemeyer.
- all Class.forName yanked out; uses thread context loader
- option to prevent System.exit termination
- added recover() method to lexers
- fixed code gen bug for syn preds in tree parsers. Thanks to Marc Horowitz.
- BaseAST was not checking for null text in toString()
- Scott added java line ouput in code gen
- Prashant tweaked a few things for ANTLRStudio; a few new classes in ASdebug package
- Give errors if the user attempts to set k>1 in a TreeWalker
- Added missing Makefile.in for C++ heteroAST example and enabled it
in configure.in
- Many small C++ support code and codegen tweaks fixes to increase
portability. (Compaq Tru64 UNIX V5.1, VC's)
- Prevent '\' entering the bitset dump comments, might occur at end of
line. Some compilers continue the comment to the next line (not sure
if this is a compiler bug, should look it up)
* Wed Jan 25 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
* Tue Oct 25 2005 - jsmeix@suse.de
- removed sub-package antlr-jedit because since jedit version 4.2
/usr/share/jedit/modes/antlr.xml is included in jedit.
* Wed Jul 27 2005 - jsmeix@suse.de
- Adjustments in the spec file.
* Tue Jul 19 2005 - jsmeix@suse.de
- Current version 2.7.4 from JPackage.org
* Wed Mar 02 2005 - skh@suse.de
- added support for C++ output (#67164)
* Thu Sep 16 2004 - skh@suse.de
- Fix prerequires of javadoc subpackage
- conflict with pccts
* Thu Sep 02 2004 - skh@suse.de
- Initial package created with version 2.7.4 (JPackage 1.5)