From b67f63779ccda0590ec3474237f5a7ee6d89d7dd Mon Sep 17 00:00:00 2001 From: Deepak Bhole Date: Jul 19 2006 19:41:20 +0000 Subject: Added conditional native compilation. --- diff --git a/antlr.spec b/antlr.spec index 37d788b..16174e4 100644 --- a/antlr.spec +++ b/antlr.spec @@ -1,26 +1,63 @@ +# Copyright (c) 2000-2005, JPackage Project +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the +# distribution. +# 3. Neither the name of the JPackage Project nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +%define _with_gcj_support 1 + +%define gcj_support %{?_with_gcj_support:1}%{!?_with_gcj_support:%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support:%{_gcj_support}}%{!?_gcj_support:0}}} + %define section free %define native %{?_with_native:1}%{!?_without_native:0} -%define build_jedit %{?_with_jedit:1}%{!?_without_jedit:0} Summary: ANother Tool for Language Recognition Name: antlr -Version: 2.7.4 -Release: 2jpp_7fc +Version: 2.7.6 +Release: 3jpp_1fc Epoch: 0 License: Public Domain URL: http://www.antlr.org/ Group: Development/Code Generators -Source0: antlr-2.7.4-RHCLEAN.tar.bz2 +#http://www.antlr.org/download/antlr-%{version}.tar.gz +Source0: antlr-%{version}-RHCLEAN.tar.gz Source1: %{name}-build.xml Source2: %{name}-script -Source3: http://www.antlr.org/share/1069557132934/makefile.gcj +#http://www.antlr.org/share/1069557132934/makefile.gcj +Source3: makefile.gcj Patch0: %{name}-jedit.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot %if %{native} BuildRequires: %{_bindir}/gcj, %{__make} %else +%if ! %{gcj_support} BuildArch: noarch +%endif BuildRequires: ant BuildRequires: %{__perl}, java-javadoc Requires: jpackage-utils @@ -28,6 +65,12 @@ Requires(post): %{_sbindir}/update-alternatives Requires(postun): %{_sbindir}/update-alternatives %endif +%if %{gcj_support} +BuildRequires: java-gcj-compat-devel +Requires(post): java-gcj-compat +Requires(postun): java-gcj-compat +%endif + %description ANTLR, ANother Tool for Language Recognition, (formerly PCCTS) is a language tool that provides a framework for constructing recognizers, @@ -41,6 +84,12 @@ Summary: ANother Tool for Language Recognition (native version) Requires(post): %{_sbindir}/update-alternatives Requires(postun): %{_sbindir}/update-alternatives +%if %{gcj_support} +BuildRequires: java-gcj-compat-devel +Requires(post): java-gcj-compat +Requires(postun): java-gcj-compat +%endif + %description native ANTLR, ANother Tool for Language Recognition, (formerly PCCTS) is a language tool that provides a framework for constructing recognizers, @@ -58,12 +107,10 @@ Documentation for %{name}. %package javadoc Group: Development/Documentation Summary: Javadoc for %{name} -Prereq: coreutils %description javadoc Javadoc for %{name}. -%if %{build_jedit} %package jedit Group: Text Editors Summary: ANTLR mode for jEdit @@ -74,7 +121,6 @@ ANTLR mode for jEdit. To enable this mode, insert the following into your %{_datadir}/jedit/modes/catalog: -%endif %prep @@ -124,13 +170,15 @@ cp -pr work/api/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version} ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} # jedit mode -%if %{build_jedit} mkdir -p $RPM_BUILD_ROOT%{_datadir}/jedit/modes cp -p extras/antlr-jedit.xml $RPM_BUILD_ROOT%{_datadir}/jedit/modes/antlr.xml %endif -%endif +%if %{gcj_support} +%{_bindir}/aot-compile-rpm +%endif + %clean rm -rf $RPM_BUILD_ROOT @@ -139,22 +187,50 @@ rm -rf $RPM_BUILD_ROOT %{_sbindir}/update-alternatives --install %{_bindir}/antlr \ %{name} %{_bindir}/antlr-java 10 +%if %{gcj_support} +if [ -x %{_bindir}/rebuild-gcj-db ] +then + %{_bindir}/rebuild-gcj-db +fi +%endif + %postun if [ $1 -eq 0 ] ; then %{_sbindir}/update-alternatives --remove %{name} %{_bindir}/antlr-java fi %if %{native} +%if %{gcj_support} +if [ -x %{_bindir}/rebuild-gcj-db ] +then + %{_bindir}/rebuild-gcj-db +fi +%endif + %post native %{_sbindir}/update-alternatives --install %{_bindir}/antlr \ %{name} %{_bindir}/antlr-native 20 +%if %{gcj_support} +if [ -x %{_bindir}/rebuild-gcj-db ] +then + %{_bindir}/rebuild-gcj-db +fi +%endif + %postun native if [ $1 -eq 0 ] ; then %{_sbindir}/update-alternatives --remove %{name} %{_bindir}/antlr-native fi %endif +%if %{gcj_support} +if [ -x %{_bindir}/rebuild-gcj-db ] +then + %{_bindir}/rebuild-gcj-db +fi +%endif + %post javadoc rm -f %{_javadocdir}/%{name} ln -s %{name}-%{version} %{_javadocdir}/%{name} @@ -163,7 +239,7 @@ ln -s %{name}-%{version} %{_javadocdir}/%{name} %if %{native} %files native %defattr(0644,root,root,0755) -%doc install.html LICENSE.txt +%doc INSTALL.txt LICENSE.txt %defattr(0755,root,root,0755) %ghost %{_bindir}/antlr %{_bindir}/antlr-native @@ -171,12 +247,16 @@ ln -s %{name}-%{version} %{_javadocdir}/%{name} %else %files %defattr(0644,root,root,0755) -%doc install.html LICENSE.txt +%doc INSTALL.txt LICENSE.txt %{_javadir}/%{name}*.jar %defattr(0755,root,root,0755) %ghost %{_bindir}/antlr %{_bindir}/antlr-java +%if %{gcj_support} +%attr(-,root,root) %{_libdir}/gcj/%{name} +%endif + %files manual %defattr(0644,root,root,0755) %doc doc/* @@ -186,51 +266,21 @@ ln -s %{name}-%{version} %{_javadocdir}/%{name} %doc %{_javadocdir}/%{name}-%{version} %ghost %doc %{_javadocdir}/%{name} -%if %{build_jedit} %files jedit %defattr(0644,root,root,0755) %{_datadir}/jedit/modes/* %endif -%endif %changelog -* Wed Jul 12 2006 Jesse Keating - 0:2.7.4-2jpp_7fc -- rebuild - -* Mon Mar 6 2006 Jeremy Katz - 0:2.7.4-2jpp_6fc -- stop scriptlet spew - -* Wed Dec 21 2005 Jesse Keating - 0:2.7.4-2jpp_5fc -- rebuilt for new gcj +* Wed Jul 19 2006 Deepak Bhole = 0:2.7.6-3jpp_1fc +- Added conditional native compilation. -* Tue Dec 13 2005 Jesse Keating -- rebuilt for new gcj +* Fri Jan 13 2006 Fernando Nasser - 0:2.7.6-2jpp +- First JPP 1.7 build -* Fri Dec 09 2005 Jesse Keating -- rebuilt - -* Mon Nov 28 2005 Vadim Nasardinov - 0:2.7.4-2jpp_4fc -- Reverted the previous change. - -* Mon Nov 7 2005 Vadim Nasardinov - 0:2.7.4-2jpp_3fc -- BZ 172456: Added /usr/lib/libantlr.a and /usr/include/antlr/*.hpp - -* Tue Jun 21 2005 Gary Benson - 0:2.7.4-2jpp_2fc -- Remove jarfile from the tarball. -- Remove now-unnecessary workaround for #144775. - -* Tue Jan 11 2005 Gary Benson - 0:2.7.4-2jpp_1fc -- Sync with RHAPS. - -* Mon Nov 15 2004 Fernando Nasser - 0:2.7.4-2jpp_1rh -- Merge with upstream for upgrade - -* Fri Nov 12 2004 Gary Benson - 0:2.7.2-3jpp_3fc -- Omit the jedit subpackage to fix dependencies. - -* Thu Nov 4 2004 Gary Benson - 0:2.7.2-3jpp_2fc -- Build into Fedora. +* Fri Jan 13 2006 Fernando Nasser - 0:2.7.6-1jpp +- Update to 2.7.6. * Fri Aug 20 2004 Ralph Apel - 0:2.7.4-2jpp - Build with ant-1.6.2. @@ -248,9 +298,6 @@ ln -s %{name}-%{version} %{_javadocdir}/%{name} "--with native" to get that. - Add %{_bindir}/antlr alternative. -* Thu Mar 4 2004 Frank Ch. Eigler - 0:2.7.2-3jpp - Add non-versioned javadoc dir symlink. - Crosslink with local J2SE javadocs.