From cac783fbd2c1d9f59be9be3ac5e5110ce63d8264 Mon Sep 17 00:00:00 2001 From: Vivek Lakshmanan Date: Wed, 19 Jul 2006 16:05:12 +0000 Subject: [PATCH] - Add conditional native compilation with GCJ. - Merge with 3jpp version of spec file. --- java_cup.spec | 95 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 79 insertions(+), 16 deletions(-) diff --git a/java_cup.spec b/java_cup.spec index 89948da..8f2b43c 100644 --- a/java_cup.spec +++ b/java_cup.spec @@ -1,28 +1,66 @@ +# 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 name java_cup %define version 0.10 %define pkg_version v10k -%define release 0.k.1jpp_10fc +%define release 0.k.4jpp_1fc %define section free Name: %{name} Version: %{version} -Release: %{release} +Release: %{release} Epoch: 1 Summary: Java source interpreter License: BSD-style Url: http://www.cs.princeton.edu/%7Eappel/modern/java/CUP/ Source0: java_cup_v10k-RHCLEAN.tar.bz2 +#Source0: java_cup_v10k.tar.gz Source1: %{name}-build.xml BuildRequires: ant BuildRequires: jpackage-utils >= 0:1.5 Group: Development/Java +%if ! %{gcj_support} +Buildarch: noarch +%endif Buildroot: %{_tmppath}/%{name}-%{version}-buildroot -# RHEL3 and FC2 -Obsoletes: cup <= 0:v10k -# libgcj aot-compiled native libraries -BuildRequires: java-gcj-compat-devel >= 1.0.31 -Requires(post): java-gcj-compat >= 1.0.31 -Requires(postun): java-gcj-compat >= 1.0.31 + +%if %{gcj_support} +BuildRequires: java-gcj-compat-devel +Requires(post): java-gcj-compat +Requires(postun): java-gcj-compat +%endif %description java_cup is a LALR Parser Generator for Java @@ -30,7 +68,6 @@ java_cup is a LALR Parser Generator for Java %package javadoc Summary: Javadoc for java_cup Group: Development/Java -Prereq: coreutils %description javadoc Javadoc for java_cup @@ -66,17 +103,13 @@ install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version} cp -pr dist/javadoc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version} (cd $RPM_BUILD_ROOT%{_javadocdir} && ln -sf %{name}-%{version} %{name}) -aot-compile-rpm +%if %{gcj_support} +%{_bindir}/aot-compile-rpm +%endif %clean rm -rf $RPM_BUILD_ROOT -%post -%{_bindir}/rebuild-gcj-db - -%postun -%{_bindir}/rebuild-gcj-db - %post javadoc rm -f %{_javadocdir}/%{name} ln -s %{name}-%{version} %{_javadocdir}/%{name} @@ -86,11 +119,32 @@ if [ $1 -eq 0 ]; then rm -f %{_javadocdir}/%{name} fi +%post +%if %{gcj_support} +if [ -x %{_bindir}/rebuild-gcj-db ] +then + %{_bindir}/rebuild-gcj-db +fi +%endif + +%postun +%if %{gcj_support} +if [ -x %{_bindir}/rebuild-gcj-db ] +then + %{_bindir}/rebuild-gcj-db +fi +%endif + %files %defattr(0644,root,root,0755) %doc README LICENSE CHANGELOG %{_javadir}/* + +%if %{gcj_support} %attr(-,root,root) %{_libdir}/gcj/%{name} +%attr(-,root,root) %{_libdir}/gcj/%{name}/java_cup-0.10.jar.* +%attr(-,root,root) %{_libdir}/gcj/%{name}/java_cup-runtime-0.10.jar.* +%endif %files manual %defattr(0644,root,root,0755) @@ -102,6 +156,12 @@ fi %ghost %doc %{_javadocdir}/%{name} %changelog +* Wed Jul 19 2006 Vivek Lakshmanan - 1:0.10-0.k.4jpp_1fc +- Conditional native compilation for GCJ. + +* Tue Jul 18 2006 Fernando Nasser - 1:0.10-0.k.3jpp +- First JPP 1.7 build + * Wed Jul 12 2006 Jesse Keating - 1:0.10-0.k.1jpp_10fc - rebuild @@ -133,6 +193,9 @@ fi * Thu Nov 4 2004 Gary Benson 1:0.10-0.k.1jpp_2fc - Build into Fedora. +* Sun Aug 23 2004 Randy Watler - 1:0.10-0.k.2jpp +- Rebuild with ant-1.6.2 + * Thu Mar 4 2004 Frank Ch. Eigler 1:0.10-0.k.1jpp_1rh - RH vacuuming