packages java-fest-assert.spec
      Pages: < 1 >  DOWNLOAD      
%define        maven          0
Name:          java-fest-assert
Version:       1.1
Release:       2mamba
Summary:       FEST Fluent Assertions
Group:         Development/Tools
Vendor:        openmamba
Distribution:  openmamba
Packager:      Silvan Calarco <silvan.calarco@...>
URL:           http://fest.easytesting.org/
# jsvn export http://svn.codehaus.org/fest/tags/fest-assert-1.1 fest-assert 
Source0:       fest-assert-%{version}-src-svn.tar.gz
Source1:       maven2-2.2.0-settings.xml
Source2:       java-fest-assert-1.1-build.xml
Source3:       java-fest-assert-1.1-maven-build.properties
Source4:       java-fest-assert-1.1-maven-build.xml
Patch0:        java-fest-assert-1.1-maven-build_xml.patch
License:       Apache License 2.0
## AUTOBUILDREQ-BEGIN
## AUTOBUILDREQ-END
%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-cglib21
BuildRequires: java-easymock2
BuildRequires: java-easymockclassextension
BuildRequires: java-fest-mocks
BuildRequires: java-fest-test
BuildRequires: java-fest-util
BuildRequires: java-junit3
BuildRequires: java-testng
BuildRequires: jpackage-utils
Requires:      java-testng
Requires:      jpackage-utils
BuildRoot:     %{_tmppath}/%{name}-%{version}-root

%description
"Flexible" or "fluent" assertions for testing.

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

%description javadoc
"Flexible" or "fluent" assertions for testing.

This package contains javadoc for %{name}.

%prep
%setup -q -n fest-assert

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

%patch0 -p0

%endif

%build
export JAVA_HOME=%{_jvmdir}/jdk
export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository

mkdir -p $MAVEN_REPO_LOCAL/junit/junit/3.8.1
ln -sf $(build-classpath junit-3.8.2) $MAVEN_REPO_LOCAL/junit/junit/3.8.1/junit-3.8.1.jar

mkdir -p $MAVEN_REPO_LOCAL/org/easytesting/fest-util/1.1
ln -sf $(build-classpath fest-util) $MAVEN_REPO_LOCAL/org/easytesting/fest-util/1.1/fest-util-1.1.jar
mkdir -p $MAVEN_REPO_LOCAL/org/easytesting/fest-test/1.1
ln -sf $(build-classpath fest-test) $MAVEN_REPO_LOCAL/org/easytesting/fest-test/1.1/fest-test-1.1.jar
mkdir -p $MAVEN_REPO_LOCAL/org/easytesting/fest-mocks/1.0
ln -sf $(build-classpath fest-mocks) $MAVEN_REPO_LOCAL/org/easytesting/fest-mocks/1.0/fest-mocks-1.0.jar

mkdir -p $MAVEN_REPO_LOCAL/org/easymock/easymockclassextension/2.2
ln -sf $(build-classpath easymockclassextension) \
	$MAVEN_REPO_LOCAL/org/easymock/easymockclassextension/2.2/easymockclassextension-2.2.jar

mkdir -p $MAVEN_REPO_LOCAL/org/easymock/easymock/2.2
ln -sf $(build-classpath easymock2) $MAVEN_REPO_LOCAL/org/easymock/easymock/2.2/easymock-2.2.jar

mkdir -p $MAVEN_REPO_LOCAL/cglib/cglib-nodep/2.1_3
ln -sf $(build-classpath cglib21-nodep) $MAVEN_REPO_LOCAL/cglib/cglib-nodep/2.1_3/cglib-nodep-2.1_3.jar

mkdir -p $MAVEN_REPO_LOCAL/org/testng/testng/5.7
ln -sf $(build-classpath testng-jdk15) $MAVEN_REPO_LOCAL/org/testng/testng/5.7/testng-5.7-jdk15.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
eof
	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 cglib21-nodep junit-3.8.2 \
		easymockclassextension easymock2 \
		fest-mocks fest-test fest-util \
		testng-jdk15):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-assert.pom
%add_to_maven_depmap org.easytesting fest-assert %{version} JPP fest-assert

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

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

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

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

%post
%update_maven_depmap

%postun
%update_maven_depmap

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

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

%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