Andrew Overholt f2b6b10
# Copyright (c) 2000-2007, JPackage Project
Andrew Overholt f2b6b10
# All rights reserved.
Andrew Overholt f2b6b10
#
Andrew Overholt f2b6b10
# Redistribution and use in source and binary forms, with or without
Andrew Overholt f2b6b10
# modification, are permitted provided that the following conditions
Andrew Overholt f2b6b10
# are met:
Andrew Overholt f2b6b10
#
Andrew Overholt f2b6b10
# 1. Redistributions of source code must retain the above copyright
Andrew Overholt f2b6b10
#    notice, this list of conditions and the following disclaimer.
Andrew Overholt f2b6b10
# 2. Redistributions in binary form must reproduce the above copyright
Andrew Overholt f2b6b10
#    notice, this list of conditions and the following disclaimer in the
Andrew Overholt f2b6b10
#    documentation and/or other materials provided with the
Andrew Overholt f2b6b10
#    distribution.
Andrew Overholt f2b6b10
# 3. Neither the name of the JPackage Project nor the names of its
Andrew Overholt f2b6b10
#    contributors may be used to endorse or promote products derived
Andrew Overholt f2b6b10
#    from this software without specific prior written permission.
Andrew Overholt f2b6b10
#
Andrew Overholt f2b6b10
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
Andrew Overholt f2b6b10
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Andrew Overholt f2b6b10
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
Andrew Overholt f2b6b10
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
Andrew Overholt f2b6b10
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
Andrew Overholt f2b6b10
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
Andrew Overholt f2b6b10
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
Andrew Overholt f2b6b10
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
Andrew Overholt f2b6b10
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
Andrew Overholt f2b6b10
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Andrew Overholt f2b6b10
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Andrew Overholt f2b6b10
#
Andrew Overholt f2b6b10
Andrew Overholt 51b12a3
%define with_maven 0
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
%define parent plexus
Andrew Overholt f2b6b10
%define subname classworlds
Andrew Overholt f2b6b10
%define namedversion 1.2-alpha-9
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
Name:           %{parent}-%{subname}
Andrew Overholt f2b6b10
Version:        1.2
Andrew Overholt 2c83735
Release:        0.a9.8%{?dist}
Andrew Overholt f2b6b10
Epoch:          0
Andrew Overholt f2b6b10
Summary:        Plexus Classworlds Classloader Framework
Andrew Overholt f2b6b10
License:        ASL 2.0 and Plexus
Andrew Overholt 51b12a3
Group:          Development/Libraries
Andrew Overholt f2b6b10
URL:            http://plexus.codehaus.org/
Andrew Overholt 51b12a3
# svn export http://svn.codehaus.org/plexus/plexus-classworlds/tags/plexus-classworlds-1.2-alpha-9/ plexus-classworlds-1.2-alpha-9
Andrew Overholt 51b12a3
# tar czf plexus-classworlds-1.2-alpha-9.tar.gz plexus-classworlds-1.2-alpha-9
Andrew Overholt f2b6b10
Source0:        %{name}-%{namedversion}-src.tar.gz
Andrew Overholt f2b6b10
Andrew Overholt 51b12a3
# Generated with mvn ant:ant
Andrew Overholt f2b6b10
Source1:        plexus-classworlds-1.2-build.xml
Andrew Overholt 51b12a3
# Fedora-specific maven bits
Andrew Overholt f2b6b10
Source3:        plexus-classworlds-settings.xml
Andrew Overholt f2b6b10
Source4:        plexus-classworlds-1.2-jpp-depmap.xml
Andrew Overholt f2b6b10
Andrew Overholt 51b12a3
# Add plexus-utils dependency
Andrew Overholt f2b6b10
Patch0:         plexus-classworlds-1.2-pom_xml.patch
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Andrew Overholt f2b6b10
BuildArch:      noarch
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
BuildRequires:  jpackage-utils >= 0:1.7.3
Andrew Overholt f2b6b10
BuildRequires:  ant >= 0:1.6.5
Andrew Overholt f2b6b10
BuildRequires:  jakarta-commons-logging
Andrew Overholt f2b6b10
BuildRequires:  xml-commons-jaxp-1.3-apis
Andrew Overholt f2b6b10
%if %{with_maven}
Andrew Overholt f2b6b10
BuildRequires:  maven2 >= 2.0.4-10jpp
Andrew Overholt f2b6b10
BuildRequires:  maven2-plugin-compiler
Andrew Overholt f2b6b10
BuildRequires:  maven2-plugin-install
Andrew Overholt f2b6b10
BuildRequires:  maven2-plugin-jar
Andrew Overholt f2b6b10
BuildRequires:  maven2-plugin-javadoc
Andrew Overholt f2b6b10
BuildRequires:  maven2-plugin-resources
Andrew Overholt f2b6b10
BuildRequires:  maven2-plugin-surefire = 2.3
Andrew Overholt f2b6b10
BuildRequires:  maven-surefire-provider-junit = 2.3
Andrew Overholt 51b12a3
BuildRequires:  maven-doxia
Andrew Overholt f2b6b10
BuildRequires:  maven-doxia-sitetools
Andrew Overholt 51b12a3
BuildRequires:  maven-release
Andrew Overholt f2b6b10
%endif
Andrew Overholt 51b12a3
BuildRequires:  plexus-utils
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
Requires(post):    jpackage-utils >= 0:1.7.2
Andrew Overholt f2b6b10
Requires(postun):  jpackage-utils >= 0:1.7.2
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
%description
Andrew Overholt f2b6b10
Classworlds is a framework for container developers
Andrew Overholt f2b6b10
who require complex manipulation of Java's ClassLoaders.
Andrew Overholt f2b6b10
Java's native ClassLoader mechanims and classes can cause
Andrew Overholt f2b6b10
much headache and confusion for certain types of
Andrew Overholt f2b6b10
application developers. Projects which involve dynamic
Andrew Overholt f2b6b10
loading of components or otherwise represent a 'container'
Andrew Overholt f2b6b10
can benefit from the classloading control provided by
Andrew Overholt f2b6b10
classworlds.
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
%package javadoc
Andrew Overholt f2b6b10
Summary:        Javadoc for %{name}
Andrew Overholt 51b12a3
Group:          Documentation
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
%description javadoc
Andrew Overholt f2b6b10
Javadoc for %{name}.
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
%prep
Andrew Overholt f2b6b10
%setup -q -n %{name}-%{namedversion}
Andrew Overholt f2b6b10
for j in $(find . -name "*.jar" | grep -v /test-data/ | grep -v /test-jars/); do
Andrew Overholt 51b12a3
  mv $j $j.no
Andrew Overholt f2b6b10
done
Andrew Overholt f2b6b10
cp %{SOURCE1} build.xml
Andrew Overholt f2b6b10
cp %{SOURCE3} settings.xml
Andrew Overholt f2b6b10
%patch0 -b .sav
Andrew Overholt f2b6b10
ln -sf $(build-classpath xml-commons-jaxp-1.3-apis) lib/xml-apis-1.3.02.jar
Andrew Overholt f2b6b10
ln -sf $(build-classpath ant) lib/ant-1.6.5.jar
Andrew Overholt f2b6b10
ln -sf $(build-classpath commons-logging) lib/commons-logging-1.0.3.jar
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
%build
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
Andrew Overholt f2b6b10
mkdir -p $MAVEN_REPO_LOCAL
Andrew Overholt f2b6b10
Andrew Overholt 51b12a3
# org.codehaus.plexus.classworlds.strategy.StrategyTest fails
Andrew Overholt f2b6b10
# upstream, so ignore failures for now
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
%if %{with_maven}
Andrew Overholt f2b6b10
mvn-jpp \
Andrew Overholt 51b12a3
  -e \
Andrew Overholt 51b12a3
  -Dmaven.test.failure.ignore=true \
Andrew Overholt 51b12a3
  -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
Andrew Overholt 51b12a3
  install javadoc:javadoc
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
%else
Andrew Overholt f2b6b10
export CLASSPATH=
Andrew Overholt f2b6b10
CLASSPATH=$CLASSPATH:target/classes:target/test-classes
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
ant -Dbuild.sysclasspath=only jar javadoc
Andrew Overholt f2b6b10
%endif
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
%install
Andrew Overholt f2b6b10
rm -rf $RPM_BUILD_ROOT
Andrew Overholt f2b6b10
# jars
Andrew Overholt f2b6b10
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}/plexus
Andrew Overholt f2b6b10
install -pm 644 target/%{name}-%{namedversion}.jar \
Andrew Overholt f2b6b10
  $RPM_BUILD_ROOT%{_javadir}/plexus/%{subname}-%{version}.jar
Andrew Overholt f2b6b10
%add_to_maven_depmap org.codehaus.plexus %{name} %{namedversion} JPP/%{parent} %{subname}
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
(cd $RPM_BUILD_ROOT%{_javadir}/%{parent} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed  "s|-%{version}||g"`; done)
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
# pom
Andrew Overholt f2b6b10
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms
Andrew Overholt f2b6b10
install -pm 644 pom.xml $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{parent}-%{subname}.pom
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
# javadoc
Andrew Overholt f2b6b10
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
Andrew Overholt f2b6b10
cp -pr target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
Andrew Overholt 51b12a3
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
%clean
Andrew Overholt f2b6b10
rm -rf $RPM_BUILD_ROOT
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
%post
Andrew Overholt f2b6b10
%update_maven_depmap
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
%postun
Andrew Overholt f2b6b10
%update_maven_depmap
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
%files
Andrew Overholt f2b6b10
%defattr(-,root,root,-)
Andrew Overholt f2b6b10
%{_javadir}/%{parent}
Andrew Overholt f2b6b10
%{_datadir}/maven2
Andrew Overholt f2b6b10
%{_mavendepmapfragdir}
Andrew Overholt 51b12a3
%doc LICENSE.txt
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
%files javadoc
Andrew Overholt f2b6b10
%defattr(-,root,root,-)
Andrew Overholt f2b6b10
%doc %{_javadocdir}/*
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
%changelog
Andrew Overholt 2c83735
* Thu Aug 20 2009 Andrew Overholt <overholt@redhat.com> 0:1.2-0.a9.8
Andrew Overholt 2c83735
- Bump release.
Andrew Overholt 2c83735
Andrew Overholt 51b12a3
* Wed Aug 19 2009 Andrew Overholt <overholt@redhat.com> 0:1.2-0.a9.7
Andrew Overholt 51b12a3
- Document sources and patches
Andrew Overholt 51b12a3
Andrew Overholt 51b12a3
* Wed Aug 19 2009 Andrew Overholt <overholt@redhat.com> 0:1.2-0.a9.6
Andrew Overholt 51b12a3
- Update tarball-building instructions
Andrew Overholt 51b12a3
- Remove gcj support
Andrew Overholt 51b12a3
- Remove unnecessary post requirements
Andrew Overholt 51b12a3
Andrew Overholt f2b6b10
* Thu May 14 2009 Fernando Nasser <fnasser@redhat.com> 0:1.2-0.a9.6
Andrew Overholt f2b6b10
- Fix license specification
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
* Tue Apr 28 2009 Yong Yang <yyang@redhat.com> 0:1.2-0.a9.5
Andrew Overholt f2b6b10
- Add BRs maven2-plugin-surfire*, maven-doxia*
Andrew Overholt f2b6b10
- Rebuild with maven2-2.0.8 built in non-bootstrap mode
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
* Mon Mar 16 2009 Yong Yang <yyang@redhat.com> 0:1.2-0.a9.4
Andrew Overholt f2b6b10
- rebuild with new maven2 2.0.8 built in bootstrap mode
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
* Tue Jan 13 2009 Yong Yang <yyang@redhat.com> 0:1.2-0.a9.3jpp.1
Andrew Overholt 51b12a3
- re-build with maven
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
* Tue Jan 06 2009 Yong Yang <yyang@redhat.com> 0:1.2-0.a9.2jpp.1
Andrew Overholt f2b6b10
- Imported into devel from dbhole's maven 2.0.8 packages
Andrew Overholt f2b6b10
Andrew Overholt f2b6b10
* Wed Jan 30 2008 Deepak Bhole <dbhole@redhat.com> 0:1.2-0.a9.1jpp.1
Andrew Overholt f2b6b10
- Initial build -- merged from JPackage