2dec754
# Copyright (c) 2000-2005, JPackage Project
2dec754
# All rights reserved.
2dec754
#
2dec754
# Redistribution and use in source and binary forms, with or without
2dec754
# modification, are permitted provided that the following conditions
2dec754
# are met:
2dec754
#
2dec754
# 1. Redistributions of source code must retain the above copyright
2dec754
#    notice, this list of conditions and the following disclaimer.
2dec754
# 2. Redistributions in binary form must reproduce the above copyright
2dec754
#    notice, this list of conditions and the following disclaimer in the
2dec754
#    documentation and/or other materials provided with the
2dec754
#    distribution.
2dec754
# 3. Neither the name of the JPackage Project nor the names of its
2dec754
#    contributors may be used to endorse or promote products derived
2dec754
#    from this software without specific prior written permission.
2dec754
#
2dec754
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2dec754
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2dec754
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2dec754
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2dec754
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2dec754
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2dec754
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2dec754
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2dec754
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2dec754
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2dec754
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2dec754
#
2dec754
2dec754
%define _with_gcj_support 1
2dec754
%define gcj_support %{?_with_gcj_support:1}%{!?_with_gcj_support:%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support:%{_gcj_support}}%{!?_gcj_support:0}}}
2dec754
2dec754
%define with_maven %{!?_without_maven:1}%{?_without_maven:0}
2dec754
%define without_maven %{?_without_maven:1}%{!?_without_maven:0}
2dec754
2dec754
%define parent plexus
2dec754
%define subname bsh-factory
2dec754
2dec754
Name:           %{parent}-%{subname}
2dec754
Version:        1.0
af9ffeb
Release:        0.2.a7s.1jpp.6%{?dist}
2dec754
Epoch:          0
2dec754
Summary:        Plexus Bsh component factory
2dec754
License:        MIT-Style
2dec754
Group:          Development/Java
2dec754
URL:            http://plexus.codehaus.org/
2dec754
Source0:        %{name}-src.tar.gz
2dec754
# svn export svn://svn.plexus.codehaus.org/plexus/tags/plexus-bsh-factory-1.0-alpha-7-SNAPSHOT plexus-bsh-factory/
2dec754
# tar czf plexus-bsh-factory-src.tar.gz plexus-bsh-factory/
2dec754
Source1:        %{name}-jpp-depmap.xml
2dec754
Source2:        %{name}-build.xml
2dec754
2dec754
Patch1:         %{name}-encodingfix.patch
2dec754
2dec754
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
2dec754
2dec754
%if ! %{gcj_support}
2dec754
BuildArch:      noarch
9307789
%else
9307789
ExcludeArch:    ppc64
2dec754
%endif
2dec754
2dec754
BuildRequires:     jpackage-utils >= 0:1.7.2
2dec754
%if %{with_maven}
2dec754
BuildRequires:     maven2 >= 2.0.4-9
2dec754
BuildRequires:     maven2-plugin-compiler
2dec754
BuildRequires:     maven2-plugin-install
2dec754
BuildRequires:     maven2-plugin-jar
2dec754
BuildRequires:     maven2-plugin-javadoc
2dec754
BuildRequires:     maven2-plugin-release
2dec754
BuildRequires:     maven2-plugin-resources
2dec754
BuildRequires:     maven2-plugin-surefire
2dec754
BuildRequires:     maven2-common-poms >= 1.0-2
2dec754
%else
2dec754
BuildRequires:     ant
2dec754
%endif
2dec754
BuildRequires:     bsh
2dec754
BuildRequires:     classworlds
2dec754
BuildRequires:     plexus-container-default
2dec754
BuildRequires:     plexus-utils
2dec754
2dec754
Requires:          bsh
2dec754
Requires:          classworlds
2dec754
Requires:          plexus-container-default
2dec754
Requires:          plexus-utils
2dec754
2dec754
Requires(post):    jpackage-utils >= 0:1.7.2
2dec754
Requires(postun):  jpackage-utils >= 0:1.7.2
2dec754
2dec754
%if %{gcj_support}
2dec754
BuildRequires:     java-gcj-compat-devel
2dec754
Requires(post):    java-gcj-compat
2dec754
Requires(postun):  java-gcj-compat
2dec754
%endif
2dec754
2dec754
%description
2dec754
Bsh component class creator for Plexus.
2dec754
2dec754
%if %{with_maven}
2dec754
%package javadoc
2dec754
Summary:        Javadoc for %{name}
2dec754
Group:          Documentation
2dec754
2dec754
%description javadoc
2dec754
Javadoc for %{name}.
2dec754
%endif
2dec754
2dec754
%prep
2dec754
%setup -q -n %{name}
2dec754
2dec754
%patch1 -b .sav
2dec754
2dec754
%if %{without_maven}
2dec754
    cp -p %{SOURCE2} build.xml
2dec754
%endif
2dec754
2dec754
2dec754
%build
2dec754
2dec754
%if %{with_maven}
2dec754
    export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
2dec754
    mkdir -p $MAVEN_REPO_LOCAL
2dec754
2dec754
    mvn-jpp \
2dec754
        -e \
2dec754
        -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
2dec754
        install javadoc:javadoc
2dec754
2dec754
%else
2dec754
2dec754
    mkdir lib
2dec754
    build-jar-repository \
2dec754
                             -s -p \
2dec754
                             lib bsh classworlds \
2dec754
                             plexus/container-default \
2dec754
                             plexus/utils
2dec754
    ant -Dmaven.mode.offline=true
2dec754
2dec754
%endif
2dec754
2dec754
%install
2dec754
rm -rf $RPM_BUILD_ROOT
2dec754
# jars
2dec754
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}/plexus
2dec754
install -pm 644 target/*.jar \
2dec754
      $RPM_BUILD_ROOT%{_javadir}/%{parent}/%{subname}-%{version}.jar
2dec754
%add_to_maven_depmap org.codehaus.plexus %{name} 1.0-alpha-7 JPP/%{parent} %{subname}
2dec754
2dec754
(cd $RPM_BUILD_ROOT%{_javadir}/%{parent} && for jar in *-%{version}*; \
2dec754
  do ln -sf ${jar} `echo $jar| sed  "s|-%{version}||g"`; done)
2dec754
2dec754
# pom
2dec754
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms
2dec754
install -pm 644 \
2dec754
  pom.xml $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{parent}-%{subname}.pom
2dec754
2dec754
# javadoc
2dec754
%if %{with_maven}
2dec754
    install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
2dec754
2dec754
    cp -pr target/site/apidocs/* \
2dec754
        $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/
2dec754
2dec754
    ln -s %{name}-%{version} \
2dec754
                $RPM_BUILD_ROOT%{_javadocdir}/%{name} # ghost symlink
2dec754
%endif
2dec754
2dec754
%if %{gcj_support}
2dec754
%{_bindir}/aot-compile-rpm
2dec754
%endif
2dec754
2dec754
%clean
2dec754
rm -rf $RPM_BUILD_ROOT
2dec754
2dec754
%post
2dec754
%if %{gcj_support}
2dec754
if [ -x %{_bindir}/rebuild-gcj-db ]
2dec754
then
2dec754
  %{_bindir}/rebuild-gcj-db
2dec754
fi
2dec754
%endif
2dec754
%update_maven_depmap
2dec754
2dec754
%postun
2dec754
%if %{gcj_support}
2dec754
if [ -x %{_bindir}/rebuild-gcj-db ]
2dec754
then
2dec754
  %{_bindir}/rebuild-gcj-db
2dec754
fi
2dec754
%endif
2dec754
%update_maven_depmap
2dec754
2dec754
%files
2dec754
%defattr(-,root,root,-)
2dec754
%dir %{_javadir}/plexus
2dec754
%{_javadir}/plexus
2dec754
%{_datadir}/maven2
2dec754
%{_mavendepmapfragdir}
2dec754
2dec754
%if %{gcj_support}
2dec754
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
2dec754
%attr(-,root,root) %{_libdir}/gcj/%{name}/bsh-factory-1.0.jar.*
2dec754
%endif
2dec754
2dec754
%if %{with_maven}
2dec754
%files javadoc
2dec754
%defattr(-,root,root,-)
2dec754
%doc %{_javadocdir}/*
2dec754
%endif
2dec754
2dec754
%changelog
af9ffeb
* Thu Feb 28 2008 Deepak Bhole <dbhole@redhat.com> 1.0-0.2.a7s.1jpp.6
af9ffeb
- Rebuild
0b70be4
9307789
* Fri Sep 21 2007 Deepak Bhole <dbhole@redhat.com> 1.0-0.1.a7s.2jpp.5
9307789
- ExcludeArch ppc64
9307789
1ae22de
* Mon Sep 10 2007 Deepak Bhole <dbhole@redhat.com> 1.0-0.1.a7s.2jpp.4
1ae22de
- Build with maven
1ae22de
ae69143
* Fri Aug 31 2007 Deepak Bhole <dbhole@redhat.com> 1.0-0.1.a7s.2jpp.3
ae69143
- Build without maven (to build on ppc)
ae69143
a367bcf
* Tue Mar 20 2007 Deepak Bhole <dbhole@redhat.com> 1.0-0.1.a7s.2jpp.2
a367bcf
- Build with maven
a367bcf
2dec754
* Fri Feb 23 2007 Tania Bento <tbento@redhat.com> 0:1.0-0.1.a7s.2jpp.1
2dec754
- Fixed %%Release.
2dec754
- Fixed %%BuildRoot.
2dec754
- Fixed %%Vendor.
2dec754
- Fixed %%Distribution.
2dec754
- Fixed instructions on how to generate source drop.
2dec754
- Removed %%post and %%postun sections for javadoc.
2dec754
- Made sure lines had less than 80 characters.
2dec754
- Changed to use cp -p to preserve timestamps.
2dec754
2dec754
* Tue Oct 17 2006 Deepak Bhole <dbhole@redhat.com> 1.0-0.a7s.2jpp
2dec754
- Update for maven2 9jpp
2dec754
2dec754
* Thu Sep 07 2006 Deepak Bhole <dbhole@redhat.com> 1.0-0.a7s.1jpp
2dec754
- Initial build