packages java-plexus-containers.spec
      Pages: < 1 >  DOWNLOAD      
%define        maven                0
Name:          java-plexus-containers
Version:       1.0
Release:       4mamba
Summary:       Default Plexus Container
Group:         Development/Libraries/Java
Vendor:        openmamba
Distribution:  openmamba
Packager:      gil <puntogil@...>
URL:           http://plexus.codehaus.org/
# svn export http://svn.codehaus.org/plexus/plexus-containers/tags/plexus-containers-1.0-alpha-34/
# tar czf plexus-containers-1.0-alpha-34-src-svn.tar.gz plexus-containers-1.0-alpha-34
Source0:       plexus-containers-%{version}-alpha-34-src-svn.tar.gz
Source1:       maven2-2.2.0-settings.xml
Source2:       java-plexus-containers-1.0-alpha-34-autogeneratedfiles.tar.gz
Patch0:        java-plexus-containers-1.0-javadoc-junit-link.patch
Patch1:        java-plexus-containers-1.0-no-mojo-shade-plugin.patch
Patch2:        java-plexus-containers-1.0-default-maven-build_xml.patch
License:       Apache Software License Version 2.0
BuildRequires: apache-ant
BuildRequires: apache-ant-junit
%if %maven
BuildRequires: apache-maven2
BuildRequires: apache-maven2-plugin-ant
BuildRequires: apache-maven2-plugin-compiler
BuildRequires: apache-maven2-plugin-javadoc
BuildRequires: apache-maven2-plugin-shade
BuildRequires: apache-maven2-plugin-source
BuildRequires: apache-maven2-plugin-surefire
%endif
BuildRequires: java-jmock1
BuildRequires: java-junit3
BuildRequires: java-plexus-classworlds
BuildRequires: java-plexus-utils
BuildRequires: apache-log4j-javadoc
BuildRequires: jakarta-commons-collections-javadoc
BuildRequires: jakarta-commons-dbcp121-javadoc
BuildRequires: jakarta-commons-fileupload-javadoc
BuildRequires: jakarta-commons-httpclient-javadoc
BuildRequires: jakarta-commons-logging-javadoc
BuildRequires: jakarta-commons-pool-javadoc
BuildRequires: jakarta-regexp-javadoc
BuildRequires: java-junit3-javadoc
BuildRequires: java-velocity-javadoc
BuildRequires: sun-java-javadoc
BuildRequires: jpackage-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  default
Summary:        Default Container from Plexus
Group:          Development/Libraries/Java
Requires:       java-plexus-classworlds
Requires:       java-plexus-containers-component-annotations
Requires:       java-plexus-utils
Provides:       %{name}-api = %{version}

%description  default
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.

This package contains the default container from Plexus

%package component-annotations
Group:          Development/Libraries/Java
Summary:        Component API from %{name}
Requires:       java-plexus-classworlds

%description component-annotations
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.

This package contains component API from %{name}

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

%description javadoc
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.

This package contains javadoc for %{name}-api

%prep

%setup -q -n plexus-containers-%{version}-alpha-34

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

%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
%patch1 -p1
%else
	tar -xzf %{SOURCE2}

%patch2

%endif

%build

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

%if %maven
	mkdir -p $MAVEN_REPO_LOCAL/junit/junit/3.8.2
	ln -sf $(build-classpath junit-3.8.2) $MAVEN_REPO_LOCAL/junit/junit/3.8.2/junit-3.8.2.jar
	mkdir -p $MAVEN_REPO_LOCAL/org/codehaus/plexus/plexus-classworlds/1.2-alpha-9
	ln -sf $(build-classpath plexus/classworlds) $MAVEN_REPO_LOCAL/org/codehaus/plexus/plexus-classworlds/1.2-alpha-9/plexus-classworlds-1.2-alpha-9.jar
	mkdir -p $MAVEN_REPO_LOCAL/org/codehaus/plexus/plexus-utils/1.4.5
	ln -sf $(build-classpath plexus/utils) $MAVEN_REPO_LOCAL/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.jar
	mkdir -p $MAVEN_REPO_LOCAL/jmock/jmock/1.0.1
	ln -sf $(build-classpath jmock1) $MAVEN_REPO_LOCAL/jmock/jmock/1.0.1/jmock-1.0.1.jar

	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

	cd plexus-component-annotations
	export CLASSPATH=""
	CLASSPATH=$CLASSPATH:$(build-classpath plexus/classworlds)
	CLASSPATH=$CLASSPATH:$(build-classpath junit-3.8.2 ant/ant-junit):target/classes:target/test-classes
	ant \
		-Duser.home=$PWD \
		-Dmaven.repo.local=$MAVEN_REPO_LOCAL \
		-Dmaven.settings.offline=true \
		-Dmaven.settings.interactiveMode=false \
		-Dj2se4.api=%{_javadocdir}/java \
		-Dj2se5.api=%{_javadocdir}/java \
		-Dcollections.api=%{_javadocdir}/commons-collections \
		-Ddbcp.api=%{_javadocdir}/commons-dbcp121 \
		-Dfileupload.api=%{_javadocdir}/jakarta-commons-fileupload \
		-Dhttpclient.api=%{_javadocdir}/jakarta-commons-httpclient-3.1 \
		-Dlogging.api=%{_javadocdir}/jakarta-commons-logging \
		-Dpool.api=%{_javadocdir}/jakarta-commons-pool \
		-Djunit.api=%{_javadocdir}/junit \
		-Dlog4j.api=%{_javadocdir}/log4j \
		-Dregexp.api=%{_javadocdir}/regexp \
		-Dvelocity.api=%{_javadocdir}/velocity-1.4 \
		-Dbuild.sysclasspath=first \
		jar javadoc
	cd ..

	cd plexus-container-default
	export CLASSPATH=""
	CLASSPATH=$CLASSPATH:$(build-classpath plexus/classworlds plexus/utils jmock1)
	CLASSPATH=$CLASSPATH:../plexus-component-annotations/target/plexus-component-annotations-1.0-alpha-34.jar
	CLASSPATH=$CLASSPATH:$(build-classpath junit-3.8.2 ant/ant-junit):target/classes:target/test-classes
	ant \
		-Duser.home=$PWD \
		-Dmaven.repo.local=$MAVEN_REPO_LOCAL \
		-Dmaven.settings.offline=true \
		-Dmaven.settings.interactiveMode=false \
		-Dj2se4.api=%{_javadocdir}/java \
		-Dj2se5.api=%{_javadocdir}/java \
		-Dcollections.api=%{_javadocdir}/commons-collections \
		-Ddbcp.api=%{_javadocdir}/commons-dbcp121 \
		-Dfileupload.api=%{_javadocdir}/jakarta-commons-fileupload \
		-Dhttpclient.api=%{_javadocdir}/jakarta-commons-httpclient-3.1 \
		-Dlogging.api=%{_javadocdir}/jakarta-commons-logging \
		-Dpool.api=%{_javadocdir}/jakarta-commons-pool \
		-Djunit.api=%{_javadocdir}/junit \
		-Dlog4j.api=%{_javadocdir}/log4j \
		-Dregexp.api=%{_javadocdir}/regexp \
		-Dvelocity.api=%{_javadocdir}/velocity-1.4 \
		-Dbuild.sysclasspath=first \
		jar javadoc

%endif

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

mkdir -p %{buildroot}%{_javadir}/plexus
%if %maven
install -pm 644 plexus-component-annotations/target/plexus-component-annotations-%{version}-alpha-2.jar \
	%{buildroot}%{_javadir}/plexus/containers-component-annotations-%{version}.jar
%else
install -pm 644 plexus-component-annotations/target/plexus-component-annotations-%{version}-alpha-34.jar \
	%{buildroot}%{_javadir}/plexus/containers-component-annotations-%{version}.jar
%endif

install -pm 644 plexus-container-default/target/plexus-container-default-%{version}-alpha-34.jar \
	%{buildroot}%{_javadir}/plexus/containers-default-%{version}.jar

mkdir -p %{buildroot}%{_datadir}/maven2/poms
%add_to_maven_depmap org.codehaus.plexus plexus-containers 1.0-alpha-34 JPP/plexus containers
install -pm 644 pom.xml %{buildroot}%{_datadir}/maven2/poms/JPP.plexus-containers-containers.pom
%add_to_maven_depmap org.codehaus.plexus plexus-container-default 1.0-alpha-34 JPP/plexus containers-default
install -pm 644 plexus-container-default/pom.xml %{buildroot}%{_datadir}/maven2/poms/JPP.plexus-containers-default.pom
%add_to_maven_depmap org.codehaus.plexus plexus-component-annotations 1.0-alpha-34 JPP/plexus containers-component-annotations
install -pm 644 plexus-component-annotations/pom.xml %{buildroot}%{_datadir}/maven2/poms/JPP.plexus-containers-component-annotations.pom

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

mkdir -p  %{buildroot}%{_javadocdir}/plexus-containers-%{version}/component-annotations
cp -pr plexus-component-annotations/target/site/apidocs/* %{buildroot}%{_javadocdir}/plexus-containers-%{version}/component-annotations
mkdir -p  %{buildroot}%{_javadocdir}/plexus-containers-%{version}/default
cp -pr plexus-container-default/target/site/apidocs/* %{buildroot}%{_javadocdir}/plexus-containers-%{version}/default
ln -s plexus-containers-%{version} %{buildroot}%{_javadocdir}/plexus-containers

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

%post default
%update_maven_depmap

%postun default
%update_maven_depmap

%post component-annotations
%update_maven_depmap

%postun component-annotations
%update_maven_depmap

%files default
%defattr(-,root,root)
%{_javadir}/plexus/containers-default-%{version}.jar
%{_javadir}/plexus/containers-default.jar
%{_datadir}/maven2/poms/
%{_mavendepmapfragdir}

%files component-annotations
%defattr(-,root,root)
%{_javadir}/plexus/containers-component-annotations-%{version}.jar
%{_javadir}/plexus/containers-component-annotations.jar

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

%changelog
* Sat May 08 2010 gil <puntogil@...> 1.0-4mamba
- update to 1.0-alpha-34

* Fri May 07 2010 gil <puntogil@...> 1.0-3mamba
- edit spec file
- rebuilt with jdk 6u20 support

* Mon Jan 25 2010 gil <puntogil@...> 1.0-2mamba
- rebuilt
- added maven poms

* Tue Mar 31 2009 gil <puntogil@...> 1.0-1mamba
- package created by autospec