869fb16
# Copyright (c) 2000-2007, JPackage Project
Matt Wringe 4c56714
# All rights reserved.
Matt Wringe 4c56714
#
Matt Wringe 4c56714
# Redistribution and use in source and binary forms, with or without
Matt Wringe 4c56714
# modification, are permitted provided that the following conditions
Matt Wringe 4c56714
# are met:
Matt Wringe 4c56714
#
Matt Wringe 4c56714
# 1. Redistributions of source code must retain the above copyright
Matt Wringe 4c56714
#    notice, this list of conditions and the following disclaimer.
Matt Wringe 4c56714
# 2. Redistributions in binary form must reproduce the above copyright
Matt Wringe 4c56714
#    notice, this list of conditions and the following disclaimer in the
Matt Wringe 4c56714
#    documentation and/or other materials provided with the
Matt Wringe 4c56714
#    distribution.
Matt Wringe 4c56714
# 3. Neither the name of the JPackage Project nor the names of its
Matt Wringe 4c56714
#    contributors may be used to endorse or promote products derived
Matt Wringe 4c56714
#    from this software without specific prior written permission.
Matt Wringe 4c56714
#
Matt Wringe 4c56714
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
Matt Wringe 4c56714
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Matt Wringe 4c56714
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
Matt Wringe 4c56714
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
Matt Wringe 4c56714
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
Matt Wringe 4c56714
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
Matt Wringe 4c56714
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
Matt Wringe 4c56714
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
Matt Wringe 4c56714
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
Matt Wringe 4c56714
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Matt Wringe 4c56714
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Matt Wringe 4c56714
#
Matt Wringe 4c56714
fd5b6b1
%define _without_gcj_support 1
fd5b6b1
869fb16
%define gcj_support %{?_with_gcj_support:1}%{!?_with_gcj_support:%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support:%{_gcj_support}}%{!?_gcj_support:0}}}
869fb16
869fb16
# If you don't want to build with maven, and use straight ant instead,
869fb16
# give rpmbuild option '--without maven'
869fb16
869fb16
%define with_maven %{!?_without_maven:1}%{?_without_maven:0}
869fb16
%define without_maven %{?_without_maven:1}%{!?_without_maven:0}
869fb16
869fb16
%define section     free
869fb16
%define parent plexus
869fb16
%define subname utils
Matt Wringe 4c56714
Matt Wringe 4c56714
Name:           plexus-utils
869fb16
Version:        1.4.5
3b0f2b4
Release:        3jpp.1%{?dist}
Matt Wringe 4c56714
Epoch:          0
Matt Wringe 4c56714
Summary:        Plexus Common Utilities
869fb16
License:        Apache Software License 2.0
Matt Wringe 4c56714
Group:          Development/Java
869fb16
Vendor: %{?_vendorinfo:%{_vendorinfo}}%{!?_vendorinfo:%{_vendor}}
869fb16
Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}
Matt Wringe 4c56714
URL:            http://plexus.codehaus.org/
869fb16
Source0:        plexus-utils-1.4.5.tar.gz
869fb16
# svn export http://svn.codehaus.org/plexus/plexus-utils/tags/plexus-utils-1.4.5/
869fb16
Source1:        plexus-utils-1.4.5-build.xml
Matt Wringe 4c56714
869fb16
# build it with maven2-generated ant build.xml
Matt Wringe 4c56714
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Matt Wringe 4c56714
869fb16
%if %{gcj_support}
869fb16
BuildRequires:    java-gcj-compat-devel
869fb16
Requires(post):   java-gcj-compat
869fb16
Requires(postun): java-gcj-compat
869fb16
%endif
869fb16
869fb16
869fb16
%if ! %{gcj_support}
Matt Wringe 4c56714
BuildArch:      noarch
869fb16
%endif
869fb16
Matt Wringe 4c56714
BuildRequires:  ant
869fb16
BuildRequires:  jpackage-utils >= 0:1.7.2
869fb16
Matt Wringe 4c56714
%if %{with_maven}
dd9800a
BuildRequires:  maven2 >= 2.0.4
3b0f2b4
BuildRequires:	maven2-plugin-compiler
3b0f2b4
BuildRequires:	maven2-plugin-install
3b0f2b4
BuildRequires:	maven2-plugin-jar
3b0f2b4
BuildRequires:	maven2-plugin-javadoc
3b0f2b4
BuildRequires:	maven2-plugin-resources
3b0f2b4
BuildRequires:	maven2-plugin-surefire
3b0f2b4
BuildRequires:	maven2-common-poms >= 1.0
dd9800a
#BuildRequires:	maven-release
Matt Wringe 4c56714
%endif
Matt Wringe 4c56714
869fb16
Requires(post):    jpackage-utils >= 0:1.7.2
869fb16
Requires(postun):  jpackage-utils >= 0:1.7.2
869fb16
Matt Wringe 4c56714
%description
Matt Wringe 4c56714
The Plexus project seeks to create end-to-end developer tools for 
Matt Wringe 4c56714
writing applications. At the core is the container, which can be 
Matt Wringe 4c56714
embedded or for a full scale application server. There are many 
Matt Wringe 4c56714
reusable components for hibernate, form processing, jndi, i18n, 
Matt Wringe 4c56714
velocity, etc. Plexus also includes an application server which 
Matt Wringe 4c56714
is like a J2EE application server, without all the baggage.
Matt Wringe 4c56714
Matt Wringe 4c56714
%package javadoc
869fb16
Summary:        Javadoc for %{name}
869fb16
Group:          Development/Documentation
869fb16
Requires(post):   /bin/rm,/bin/ln
869fb16
Requires(postun): /bin/rm
Matt Wringe 4c56714
Matt Wringe 4c56714
%description javadoc
Matt Wringe 4c56714
Javadoc for %{name}.
Matt Wringe 4c56714
Matt Wringe 4c56714
Matt Wringe 4c56714
%prep
869fb16
%setup -q -n %{name}-%{version}
Matt Wringe 4c56714
cp %{SOURCE1} build.xml
Matt Wringe 4c56714
Matt Wringe 4c56714
%build
Matt Wringe 4c56714
%if %{with_maven}
869fb16
export MAVEN_REPO_LOCAL=`pwd`/.m2/repository
Matt Wringe 4c56714
869fb16
mvn-jpp -e \
869fb16
    -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
869fb16
    install javadoc:javadoc
Matt Wringe 4c56714
Matt Wringe 4c56714
%else
869fb16
export CLASSPATH=target/classes:target/test-classes
869fb16
ant -Dbuild.sysclasspath=only jar javadoc
Matt Wringe 4c56714
%endif
Matt Wringe 4c56714
869fb16
Matt Wringe 4c56714
%install
Matt Wringe 4c56714
rm -rf $RPM_BUILD_ROOT
Matt Wringe 4c56714
# jars
Matt Wringe 4c56714
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}/plexus
Matt Wringe 4c56714
install -pm 644 target/%{name}-%{version}.jar \
Matt Wringe 4c56714
  $RPM_BUILD_ROOT%{_javadir}/plexus/utils-%{version}.jar
869fb16
%add_to_maven_depmap org.codehaus.plexus %{name} %{version} JPP/%{parent} %{subname}
Matt Wringe 4c56714
(cd $RPM_BUILD_ROOT%{_javadir}/plexus && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed  "s|-%{version}||g"`; done)
869fb16
869fb16
# pom
869fb16
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms
869fb16
install -pm 644 pom.xml $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{parent}-%{subname}.pom
869fb16
Matt Wringe 4c56714
# javadoc
Matt Wringe 4c56714
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
869fb16
cp -pr target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
869fb16
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} # ghost symlink
869fb16
869fb16
%if %{gcj_support}
869fb16
export CLASSPATH=$(build-classpath gnu-crypto)
869fb16
%{_bindir}/aot-compile-rpm
869fb16
%endif
Matt Wringe 4c56714
Matt Wringe 4c56714
%clean
Matt Wringe 4c56714
rm -rf $RPM_BUILD_ROOT
Matt Wringe 4c56714
869fb16
%post javadoc
869fb16
rm -f %{_javadocdir}/%{name}
869fb16
ln -s %{name}-%{version} %{_javadocdir}/%{name}
869fb16
869fb16
%postun javadoc
869fb16
if [ "$1" = "0" ]; then
869fb16
  rm -f %{_javadocdir}/%{name}
869fb16
fi
869fb16
869fb16
%post
869fb16
%update_maven_depmap
869fb16
%if %{gcj_support}
869fb16
if [ -x %{_bindir}/rebuild-gcj-db ]
869fb16
then
869fb16
  %{_bindir}/rebuild-gcj-db
869fb16
fi
869fb16
%endif
869fb16
869fb16
%postun
869fb16
%update_maven_depmap
869fb16
%if %{gcj_support}
869fb16
if [ -x %{_bindir}/rebuild-gcj-db ]
869fb16
then
869fb16
  %{_bindir}/rebuild-gcj-db
869fb16
fi
869fb16
%endif
869fb16
Matt Wringe 4c56714
%files
Matt Wringe 4c56714
%defattr(-,root,root,-)
Matt Wringe 4c56714
%{_javadir}/*
869fb16
%{_datadir}/maven2
869fb16
%{_mavendepmapfragdir}
869fb16
%if %{gcj_support}
869fb16
%dir %attr(-,root,root) %{_libdir}/gcj/%{name}
869fb16
%attr(-,root,root) %{_libdir}/gcj/%{name}/%{subname}-%{version}.jar.*
869fb16
%endif
Matt Wringe 4c56714
Matt Wringe 4c56714
%files javadoc
Matt Wringe 4c56714
%defattr(-,root,root,-)
Matt Wringe 4c56714
%doc %{_javadocdir}/%{name}-%{version}
869fb16
%ghost %doc %{_javadocdir}/%{name}
Matt Wringe 4c56714
Matt Wringe 4c56714
%changelog
3b0f2b4
* Tue Jan 13 2009 Yong Yang <yyang@redhat.com> - 0:1.4.5-3jpp.1
3b0f2b4
- re-build with maven
3b0f2b4
3b0f2b4
* Tue Jan 06 2009 Yong Yang <yyang@redhat.com> - 0:1.4.5-2jpp.1
3b0f2b4
- Imported into devel from dbhole's maven 2.0.8 packages
3b0f2b4
869fb16
* Thu Aug 23 2007 Ralph Apel <r.apel@r-apel.de> - 0:1.4.5-1jpp
869fb16
- Upgrade to 1.4.5
869fb16
- Now build with maven2 by default
869fb16
869fb16
* Wed Mar 21 2007 Ralph Apel <r.apel@r-apel.de> - 0:1.2-2jpp
869fb16
- Fix build classpath
869fb16
- Optionally build with maven2
869fb16
- Add gcj_support option
Matt Wringe 4c56714
Matt Wringe 4c56714
* Fri Jun 16 2006 Ralph Apel <r.apel@r-apel.de> - 0:1.2-1jpp
Matt Wringe 4c56714
- Upgrade to 1.2
Matt Wringe 4c56714
Matt Wringe 4c56714
* Wed Jan 04 2006 Fernando Nasser <fnasser@redhat.com> - 0:1.0.4-2jpp
Matt Wringe 4c56714
- First JPP 1.7 build
Matt Wringe 4c56714
Matt Wringe 4c56714
* Mon Nov 07 2005 Ralph Apel <r.apel at r-apel.de> - 0:1.0.4-1jpp
Matt Wringe 4c56714
- First JPackage build
Matt Wringe 4c56714