packages java-plexus-sec-dispatcher.spec
      Pages: < 1 >  DOWNLOAD      
%define        maven                    0
Name:          java-plexus-sec-dispatcher
Version:       1.4
Release:       1mamba
Summary:       Plexus Security Dispatcher Component
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-sec-dispatcher-1.4
Source:        plexus-sec-dispatcher-%{version}-src-svn.tar.gz
Source1:       maven2-2.2.0-settings.xml
# files generated by maven ant plugin
Source2:       java-plexus-sec-dispatcher-%{version}-build.xml
Source3:       java-plexus-sec-dispatcher-%{version}-maven-build.properties
Source4:       java-plexus-sec-dispatcher-%{version}-maven-build.xml
Source5:       java-plexus-sec-dispatcher-%{version}-components.xml
# sources generated by modello maven plugin
Source6:       java-plexus-sec-dispatcher-%{version}-autogeneratedsource.tar.gz

License:       Apache Software License 2.0
BuildRequires: apache-ant
%if %maven
#BuildRequires: apache-maven
#BuildRequires: apache-maven-plugin-ant
#BuildRequires: apache-maven-plugin-compiler
#BuildRequires: apache-maven-plugin-jar
#BuildRequires: apache-maven-plugin-javadoc
#BuildRequires: java-plexus-maven-plugin
#BuildRequires: java-modello-maven-plugin
%endif
BuildRequires: java-classworlds
BuildRequires: java-junit3
BuildRequires: java-plexus-cipher
BuildRequires: java-plexus-classworlds
BuildRequires: java-plexus-containers-api
BuildRequires: java-plexus-containers-default
BuildRequires: java-plexus-utils
BuildRequires: jpackage-utils
Requires:      java-plexus-cipher
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 a sececurity dispatcher component for Plexus.

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

%description javadoc
Plexus Security Dispatcher Component.

This package contains javadoc for %{name}

%prep

%setup -q -n plexus-sec-dispatcher-%{version}

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
	cp %{SOURCE5} components.xml
	tar -C src/main/java -xf %{SOURCE6}
%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 \
		-s $(pwd)/settings.xml \
		-Dmaven.repo.local=$MAVEN_REPO_LOCAL \
		install:install-file \
		-DgroupId=org.apache.maven.plugins \
		-DartifactId=maven-javadoc-plugin \
		-Dversion=2.4 \
		-Dpackaging=jar \
		-Dfile=$(build-classpath maven2/plugins/javadoc-plugin)

	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/container-default plexus/component-api)
	CLASSPATH=$CLASSPATH:$(build-classpath plexus/classworlds plexus/utils classworlds)
	CLASSPATH=$CLASSPATH:$(build-classpath plexus/cipher 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 \
		-Dmaven.test.skip=true \
		jar javadoc

%endif

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

mkdir -p %{buildroot}%{_javadir}/plexus
install -pm 644 target/plexus-sec-dispatcher-%{version}.jar \
	%{buildroot}%{_javadir}/plexus/sec-dispatcher-%{version}.jar

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

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

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

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

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

%post
%update_maven_depmap

%postun
%update_maven_depmap

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

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

%changelog
%changelog
* Tue Mar 02 2010 gil <puntogil@...> 1.4-1mamba
- package created by autospec