packages java-fest-util.spec
      Pages: < 1 >  DOWNLOAD      
%define        maven        0
Name:          java-fest-util
Version:       1.1
Release:       2mamba
Summary:       Utility methods used by FEST modules
Group:         Development/Tools
Vendor:        openmamba
Distribution:  openmamba
Packager:      Silvan Calarco <silvan.calarco@...>
URL:           http://fest.easytesting.org/
# jsvn export http://svn.codehaus.org/fest/trunk/fest-util/ fest-util
Source0:       fest-util-%{version}-src-svn.tar.gz
Source1:       maven2-2.2.0-settings.xml
Source2:       java-fest-util-1.1-build.xml
Source3:       java-fest-util-1.1-maven-build.properties
Source4:       java-fest-util-1.1-maven-build.xml
License:       Apache License 2.0
%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
%endif
BuildRequires: apache-ant
BuildRequires: java-junit45
BuildRequires: jpackage-utils
Requires:      java-junit45
Requires:      jpackage-utils
BuildRoot:     %{_tmppath}/%{name}-%{version}-root

%description
Utility methods used by FEST modules.

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

%description javadoc
Utility methods used by FEST modules.

This package contains javadoc for %{name}.

%prep
%setup -q -n fest-util

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
	cp %{SOURCE2} build.xml
	cp %{SOURCE3} maven-build.properties
	cp %{SOURCE4} maven-build.xml
%endif

%build
export JAVA_HOME=%{_jvmdir}/jdk
export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
mkdir -p $MAVEN_REPO_LOCAL/junit/junit/4.5
ln -sf $(build-classpath junit45) $MAVEN_REPO_LOCAL/junit/junit/4.5/junit-4.5.jar

%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
	
	mvn-jpp \
		-e \
		-s $(pwd)/settings.xml \
		-Dmaven.test.failure.ignore=true \
		-Dmaven.repo.local=$MAVEN_REPO_LOCAL \
		install javadoc:javadoc
%else

	export CLASSPATH=$(build-classpath junit45):target/classes:target/test-classes
	ant \
		-Duser.home=$PWD \
		-Dmaven.repo.local=$MAVEN_REPO_LOCAL \
		-Dmaven.settings.offline=true \
		-Dmaven.settings.interactiveMode=false \
		jar javadoc
%endif

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

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

install -pm 644 pom.xml %{buildroot}%{_datadir}/maven2/poms/JPP-fest-util.pom
%add_to_maven_depmap org.easytesting fest-util %{version} JPP fest-util

install -pm 644 target/fest-util-%{version}.jar \
	%{buildroot}%{_javadir}/fest-util-%{version}.jar

(
	cd %{buildroot}%{_javadir}
	for jar in *-%{version}*; do
		ln -sf ${jar} ${jar/-%{version}/}
	done
)

mkdir -p %{buildroot}%{_javadocdir}/fest-util-%{version}
cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/fest-util-%{version}
ln -sf fest-util-%{version} %{buildroot}%{_javadocdir}/fest-util

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

%post
%update_maven_depmap

%postun
%update_maven_depmap

%files
%defattr(-,root,root)
%{_javadir}/fest-util-%{version}.jar
%{_javadir}/fest-util.jar
%{_datadir}/maven2/poms
%{_mavendepmapfragdir}
%doc LICENSE.txt

%files javadoc
%defattr(-,root,root)
%{_javadocdir}/fest-util-%{version}
%{_javadocdir}/fest-util

%changelog
* Mon Sep 16 2013 Silvan Calarco <silvan.calarco@...> 1.1-2mamba
- rebuilt in devel

* Tue Dec 08 2009 gil <puntogil@...> 1.1-1mamba
- package created by autospec