From 1e013f5b8d8385494353b409eab9403f7da5aeaf Mon Sep 17 00:00:00 2001 From: Deepak Bhole Date: Thu, 20 Jul 2006 15:43:31 +0000 Subject: [PATCH] - Added conditional native compilation. - From gbenson@redhat: - Build without Jython or Rhino for now. - Build with servletapi5. - Avoid Sun-specific classes. --- bsf.spec | 169 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 109 insertions(+), 60 deletions(-) diff --git a/bsf.spec b/bsf.spec index d3889fb..6369d23 100644 --- a/bsf.spec +++ b/bsf.spec @@ -1,28 +1,70 @@ -%define name bsf -%define version 2.3.0 -%define release 6jpp_4fc +# 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 -Name: %{name} -Version: %{version} -Release: %{release} +Name: bsf +Version: 2.3.0 +Release: 10jpp_1fc Epoch: 0 Summary: Bean Scripting Framework License: Apache License Url: http://jakarta.apache.org/bsf/ Group: Development/Libraries/Java +Vendor: JPackage Project +Distribution: JPackage +#http://jakarta.apache.org/builds/jakarta-%{name}/dev/v%{version}/src/%{name}-src-%{version}.tar.gz Source0: %{name}-src-%{version}-RHCLEAN.tar.bz2 -Patch1: bsf-javac.patch +Patch1: %{name}-javac.patch BuildRequires: jpackage-utils >= 1.6 BuildRequires: ant -BuildRequires: servletapi5 -BuildRequires: xalan-j2 +BuildRequires: servlet BuildRequires: tomcat5-jsp-2.0-api -Requires: servletapi5 -Requires: xalan-j2 -Requires: tomcat5-jsp-2.0-api +BuildRequires: xalan-j2 +Requires: servletapi5 +Requires: xalan-j2 +Requires: tomcat5-jsp-2.0-api +%if ! %{gcj_support} BuildArch: noarch -BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot +%endif +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +%if %{gcj_support} +BuildRequires: java-gcj-compat-devel +Requires(post): java-gcj-compat +Requires(postun): java-gcj-compat +%endif %description Bean Scripting Framework (BSF) is a set of Java classes which provides @@ -53,61 +95,81 @@ engines: %package javadoc Summary: Javadoc for %{name} Group: Development/Documentation -Prereq: coreutils %description javadoc Javadoc for %{name}. %prep +%{__rm} -fr %{buildroot} %setup -q -%patch1 -p1 # remove all binary libs -find . -name "*.jar" -exec rm -f {} \; -find . -name "*.zip" -exec rm -f {} \; -find . -name "*.class" -exec rm -f {} \; -find . -name "*.tar.gz" -exec rm -f {} \; -rmdir $RPM_BUILD_DIR/bsf +find . -name "*.jar" -exec %{__rm} -f {} \; +%{__rm} -fr bsf + +%patch1 -p1 %build -export CLASSPATH=`build-classpath xalan-j2 servletapi5 jspapi` +[ -z "$JAVA_HOME" ] && export JAVA_HOME=%{_jvmdir}/java +export CLASSPATH=$(build-classpath xalan-j2 servlet jspapi) cd src ant realclean ant compile -rm -rf bsf/src/org/apache/bsf/engines/java +%{__rm} -rf bsf/src/org/apache/bsf/engines/java ant javadocs %install # jar -install -d -m 755 $RPM_BUILD_ROOT%{_javadir} -install -m 644 src/build/lib/%{name}.jar \ -$RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar -(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do \ +%{__install} -d -m 755 %{buildroot}%{_javadir} +%{__install} -m 644 src/build/lib/%{name}.jar \ +%{buildroot}%{_javadir}/%{name}-%{version}.jar +(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do \ ln -sf ${jar} ${jar/-%{version}/}; done) # javadoc -install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version} -cp -pr src/build/javadocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version} -(cd $RPM_BUILD_ROOT%{_javadocdir} && ln -sf %{name}-%{version} %{name}) +%{__install} -d -m 755 %{buildroot}%{_javadocdir}/%{name}-%{version} +%{__cp} -pr src/build/javadocs/* %{buildroot}%{_javadocdir}/%{name}-%{version} +(cd %{buildroot}%{_javadocdir} && ln -sf %{name}-%{version} %{name}) -# docs -cp -f src/{AUTHORS,BUILDING,CHANGES,CHANGES.old,INSTALL,README,TODO} . +%if %{gcj_support} +%{_bindir}/aot-compile-rpm +%endif %clean -rm -rf $RPM_BUILD_ROOT +%{__rm} -rf %{buildroot} %post javadoc -rm -f %{_javadocdir}/%{name} +%{__rm} -f %{_javadocdir}/%{name} ln -s %{name}-%{version} %{_javadocdir}/%{name} %postun javadoc if [ $1 -eq 0 ]; then - rm -f %{_javadocdir}/%{name} + %{__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(-,root,root) -%doc license.txt AUTHORS BUILDING CHANGES CHANGES.old INSTALL README TODO +%doc license.txt src/AUTHORS src/BUILDING src/CHANGES src/CHANGES.old src/INSTALL src/README src/TODO %{_javadir}/* +%if %{gcj_support} +%attr(-,root,root) %{_libdir}/gcj/%{name} +%endif + %files javadoc %defattr(-,root,root) %dir %{_javadocdir}/%{name}-%{version} @@ -115,34 +177,21 @@ fi %ghost %{_javadocdir}/%{name} %changelog -* Mon Jun 5 2006 Deepak Bhole - 0:2.3.0-6jpp_4fc -- Add missing Requires/BuildRequires for tomcat5-jsp-2.0-api and others. +* Thu Jul 20 2006 Deepak Bhole 0:2.3.0-10jpp_1fc +- Added conditional native compilation. +- From gbenson@redhat: +- Build without Jython or Rhino for now. +- Build with servletapi5. +- Avoid Sun-specific classes. -* Mon Mar 6 2006 Jeremy Katz - 0:2.3.0-6jpp_3fc -- stop scriptlet spew +* Wed Apr 26 2006 Fernando Nasser 0:2.3.0-9jpp +- First JPP 1.7 build -* Thu Feb 2 2006 Thomas Fitzsimmons - 0:2.3.0-6jpp_2fc.2 -- Bump release number. +* Wed Nov 3 2004 Nicolas Mailhot 0:2.3.0-8jpp +- Clean up specfile a bit -* Fri Dec 09 2005 Jesse Keating -- rebuilt - -* Tue Jun 21 2005 Gary Benson 0:2.3.0-6jpp_2fc -- Remove classes and tarballs from the tarball too. - -* Wed Jun 15 2005 Gary Benson 0:2.3.0-6jpp_1fc -- Build into Fedora. - -* Wed Jun 8 2005 Gary Benson -- Remove jarfiles and zipfiles from the tarball. - -* Thu Jun 2 2005 Gary Benson -- Build without Jython or Rhino for now. -- Build with servletapi5. -- Avoid Sun-specific classes. - -* Thu Mar 4 2004 Frank Ch. Eigler 0:2.3.0-6jpp_1rh -- RH vacuuming +* Fri Aug 20 2004 Ralph Apel 0:2.3.0-7jpp +- Build with ant-1.6.2 * Thu Oct 09 2003 David Walluck 0:2.3.0-6jpp - add javadoc symlinks