packages java-plexus-build-api.spec
      Pages: < 1 >  DOWNLOAD      
%define        maven               0
Name:          java-plexus-build-api
Version:       0.0.6
Release:       2mamba
Summary:       Incremental build API for Plexus components
Group:         Development/Libraries/Java
Vendor:        openmamba
Distribution:  openmamba
Packager:      gil <puntogil@...>
URL:           http://www.sonatype.org/
# jsvn export http://svn.sonatype.org/spice/tags/plexus-build-api-0.0.4
# tar czf plexus-build-api-0.0.4-src-svn.tar.gz plexus-build-api-0.0.4
Source0:       plexus-build-api-%{version}-src-svn.tar.gz
Source1:       maven2-2.2.0-settings.xml
Source2:       java-plexus-build-api-0.0.6-autogeneratedfiles.tar.gz
License:       Apache Software License Version 2.0
BuildRequires: apache-ant
BuildRequires: apache-ant-junit
%if %maven
BuildRequires: apache-maven
BuildRequires: apache-maven-ant-plugin
BuildRequires: apache-maven-compiler-plugin
BuildRequires: apache-maven-dependency-plugin
BuildRequires: apache-maven-jar-plugin
BuildRequires: apache-maven-javadoc-plugin
BuildRequires: apache-maven-plugin-plugin
#BuildRequires: java-plexus-maven-plugin
#BuildRequires: maven-surefire-plugin
BuildRequires: maven-doxia-sitetools
%endif
BuildRequires: java-junit48
BuildRequires: java-plexus-container-default
BuildRequires: java-plexus-utils
BuildRequires: jpackage-utils
#Requires:      apache-maven
Requires:      java-plexus-container-default
Requires:      java-plexus-utils
Requires:      jpackage-utils
BuildRoot:     %{_tmppath}/%{name}-%{version}-root

%description
The Plexus project provides a full software stack for creating and
executing software projects. Based on the Plexus container, the
applications can utilise component-oriented programming to build modular,
reusable components that can easily be assembled and reused.

This package provides an incremental build API for Plexus components.

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

%description javadoc
Incremental build API for Plexus components.

This package contains javadoc for %{name}

%prep

%setup -q -n plexus-build-api-%{version}

for j in $(find . -name "*.jar"); do
       mv $j $j.no
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
  tar xf %{SOURCE2}
%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 external_repo
  ln -s %{_javadir} external_repo/JPP
  
  mvn-jpp \
    -e \
    -s $(pwd)/settings.xml \
    -Dmaven.test.failure.ignore=true \
    -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
    ant:ant install javadoc:javadoc

%else

  export CLASSPATH=""
  CLASSPATH=$CLASSPATH:$(build-classpath plexus/containers-default plexus/utils):target/classes
# test require maven turn on CLASSPATH=$CLASSPATH:$(build-classpath junit48 ant/ant-junit):target/test-classes
  ant \
    -Duser.home=$PWD \
    -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
    -Dmaven.settings.offline=true \
    -Dmaven.settings.interactiveMode=false \
    -Dbuild.sysclasspath=first \
    -Dmaven.test.skip=true \
    jar javadoc

  CLASSPATH=$CLASSPATH:target/test-classes
  ant \
    -Duser.home=$PWD \
    -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
    -Dmaven.settings.offline=true \
    -Dmaven.settings.interactiveMode=false \
    -Dbuild.sysclasspath=first \
    compile-tests
%endif

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

mkdir -p %{buildroot}%{_javadir}/plexus
mkdir -p %{buildroot}%{_datadir}/maven2/poms

install -pm 644 target/plexus-build-api-%{version}.jar \
  %{buildroot}%{_javadir}/plexus/build-api-%{version}.jar

install -pm 644 target/plexus-build-api-%{version}-tests.jar \
  %{buildroot}%{_javadir}/plexus/build-api-tests-%{version}.jar


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

%add_to_maven_depmap org.sonatype.plexus plexus-build-api %{version} JPP/plexus build-api
install -pm 644 pom.xml %{buildroot}%{_datadir}/maven2/poms/JPP.plexus-build-api.pom

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

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

%post
%update_maven_depmap

%postun
%update_maven_depmap

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

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

%changelog
* Mon Dec 13 2010 gil <puntogil@...> 0.0.6-2mamba
- rebuilt devel

* Sun Jun 20 2010 gil <puntogil@...> 0.0.6-1mamba
- update to 0.0.6

* Thu Oct 01 2009 gil <puntogil@...> 0.0.4-1mamba
- update to 0.0.4

* Tue Jun 30 2009 gil <puntogil@...> 0.0.3-1mamba
- package created by autospec