packages java-plexus-io.spec
      Pages: < 1 >  DOWNLOAD      
%define        api_version   1.0
%define        maven         0
Name:          java-plexus-io
Version:       1.0a4
Release:       1mamba
Summary:       Plexus IO Components
Group:         Development/Libraries/Java
Vendor:        openmamba
Distribution:  openmamba
Packager:      gil <puntogil@...>
URL:           http://plexus.codehaus.org/
# svn export http://svn.codehaus.org/plexus/plexus-components/tags/plexus-io-1.0-alpha-4
Source0:       plexus-io-1.0-alpha-4-src-svn.tar.gz
Source1:       maven2-2.2.1-settings.xml
Source2:       java-plexus-io-1.0-alpha-4-build.xml
Source3:       java-plexus-io-1.0-alpha-4-maven-build.properties
Source4:       java-plexus-io-1.0-alpha-4-maven-build.xml
Source5:       java-plexus-io-1.0-alpha-4-autogeneratedfiles.tar.gz
License:       Apache Software License 2.0
BuildRequires: apache-ant
%if %maven
#BuildRequires: apache-maven
#BuildRequires: apache-maven-plugin-compiler
#BuildRequires: apache-maven-plugin-install
#BuildRequires: apache-maven-plugin-jar
#BuildRequires: apache-maven-plugin-javadoc
#BuildRequires: apache-maven-plugin-resources
#BuildRequires: apache-maven-plugin-surefire
%endif
BuildRequires: java-classworlds
BuildRequires: java-junit3
BuildRequires: java-plexus-classworlds
BuildRequires: java-plexus-containers-api
BuildRequires: java-plexus-containers-default
BuildRequires: java-plexus-utils
BuildRequires: jpackage-utils
Requires:      java-classworlds
Requires:      java-plexus-container-default
Requires:      java-plexus-utils
Requires:      jpackage-utils 
BuildRoot:     %{_tmppath}/%{name}-%{version}-root

%description
The Plexus project seeks to create end-to-end developer tools for 
writing applications. At the core is the container, which can be 
embedded or for a full scale application server. There are many 
reusable components for hibernate, form processing, jndi, i18n, 
velocity, etc. Plexus also includes an application server which 
is like a J2EE application server, without all the baggage.

%package javadoc
Group:          Documentation
Summary:        Javadoc for %{name}

%description javadoc
Plexus IO Components.

This package contains javadoc for %{name}

%prep

%setup -q -n plexus-io-1.0-alpha-4

for j in $(find . -name "*.jar" -o -name "CVS"); do
	rm -rf $j
done

%if %maven
	cp %{SOURCE1} settings.xml
	
	mkdir -p .m2/repository/JPP/maven2
	
	sed -i -e "s|<localRepository>__INTERNAL_REPO_PLACEHOLDER__</localRepository>|<localRepository>file://`pwd`/external_repo</localRepository>|g" settings.xml
	sed -i -e "s|<url>__EXTERNAL_REPO_PLACEHOLDER__</url>|<url>file://`pwd`/.m2/repository</url>|g" settings.xml

%else
	cp %{SOURCE2} build.xml
	cp %{SOURCE3} maven-build.properties
	cp %{SOURCE4} maven-build.xml
	tar xf %{SOURCE5}
%endif

%build

export JAVA_HOME=/usr/lib/jvm/jdk-sun
export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
mkdir -p $MAVEN_REPO_LOCAL

%if %maven
	export MAVEN_SETTINGS=$(pwd)/settings.xml
	mkdir external_repo
	ln -s %{_javadir} external_repo/JPP
	
	mvn-jpp \
		-e \
		-s $MAVEN_SETTINGS \
		-Dmaven.test.failure.ignore=true \
		-Dmaven.repo.local=$MAVEN_REPO_LOCAL \
		ant:ant install javadoc:javadoc
%else

	export CLASSPATH=""
	CLASSPATH=$CLASSPATH:$(build-classpath classworlds plexus/component-api plexus/container-default plexus/utils)
	CLASSPATH=$CLASSPATH:$(build-classpath plexus/classworlds junit-3.8.2):target/classes:target/test-classes
	ant \
		-Duser.home=$PWD \
		-Dmaven.repo.local=$MAVEN_REPO_LOCAL \
		-Dmaven.settings.offline=true \
		-Dmaven.settings.interactiveMode=false \
		-Dbuild.sysclasspath=first \
		-Dj2se.api=%{_javadocdir}/java \
		jar javadoc

%endif

%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"

mkdir -p %{buildroot}%{_javadir}/plexus
install -pm 644 target/plexus-io-%{api_version}-alpha-4.jar \
	%{buildroot}%{_javadir}/plexus/io-%{api_version}.jar

%add_to_maven_depmap org.codehaus.plexus plexus-io %{api_version} JPP/plexus io

(
	cd %{buildroot}%{_javadir}/plexus
	for jar in *-%{api_version}*; do
		ln -sf ${jar} `echo $jar| sed  "s|-%{api_version}||g"`
	done
)

mkdir -p %{buildroot}%{_datadir}/maven2/poms
install -pm 644 pom.xml \
   	%{buildroot}%{_datadir}/maven2/poms/JPP.plexus-io.pom

mkdir -p %{buildroot}%{_javadocdir}/plexus-io-%{version}
cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/plexus-io-%{version}
ln -s plexus-io-%{version} %{buildroot}%{_javadocdir}/plexus-io

#%{_bindir}/aot-compile-rpm

%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"

%post
%update_maven_depmap

%postun
%update_maven_depmap

%files
%defattr(-,root,root)
%{_javadir}/plexus/io-%{api_version}.jar
%{_javadir}/plexus/io.jar
%{_datadir}/maven2/poms
%{_mavendepmapfragdir}

%files javadoc
%defattr(-,root,root)
%{_javadocdir}/plexus-io-%{version}
%{_javadocdir}/plexus-io

%changelog
* Fri May 07 2010 gil <puntogil@...> 1.0a4-1mamba
- update to 1.0a4

* Sat Jul 18 2009 gil <puntogil@...> 1.0a3-1mamba
- update to 1.0a3

* Mon Jul 13 2009 gil <puntogil@...> 1.0a1-1mamba
- package created by autospec