packages java-jmock2.spec
      Pages: < 1 >  DOWNLOAD      
Name:          java-jmock2
Version:       2.4.0
Release:       2mamba
Summary:       Test Java code using mock objects
Group:         Development/Libraries/Java
Vendor:        openmamba
Distribution:  openmamba
Packager:      gil <puntogil@...>
URL:           http://jmock.codehaus.org/
# jsvn export http://svn.codehaus.org/jmock/tags/2.4.0/ jmock-2.4.0
Source0:       jmock-2.4.0-svn-src.tar.gz
Source1:       http://repo1.maven.org/maven2/org/jmock/jmock-parent/%{version}/jmock-parent-%{version}.pom
Source2:       http://repo1.maven.org/maven2/org/jmock/jmock/%{version}/jmock-%{version}.pom
Source3:       http://repo1.maven.org/maven2/org/jmock/jmock-junit3/%{version}/jmock-junit3-%{version}.pom
Source4:       http://repo1.maven.org/maven2/org/jmock/jmock-junit4/%{version}/jmock-junit4-%{version}.pom
Source5:       http://repo1.maven.org/maven2/org/jmock/jmock-legacy/%{version}/jmock-legacy-%{version}.pom
License:       Open Source
BuildRequires: apache-ant
BuildRequires: apache-ant-junit
BuildRequires: java-cglib21
BuildRequires: java-hamcrest
BuildRequires: java-junit381
BuildRequires: java-junit48
BuildRequires: java-objenesis
BuildRequires: jpackage-utils
Requires:      java-hamcrest
Requires:      java-junit381
Requires:      java-junit48
Requires:      java-objenesis
BuildRoot:     %{_tmppath}/%{name}-%{version}-root

%description
JMock is a library that supports test-driven development1 of Java2 code with mock objects3.
Mock objects help you design and test the interactions between the objects in your programs.

The jMock library:

* makes it quick and easy to define mock objects, so you don't break the rhythm of programming.
* lets you precisely specify the interactions between your objects, reducing the brittleness of your tests.
* works well with the autocompletion and refactoring features of your IDE
* plugs into your favourite test framework
* is easy to extend.

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

%description javadoc
JMock is a library that supports test-driven development1 of Java2 code with mock objects3.
Mock objects help you design and test the interactions between the objects in your programs.

This package contains documentation for %{name}.

%prep

%setup -q -n jmock-%{version}

for j in $(find . -name "*.jar"); do
  mv $j $j.no
done

pushd lib
  ln -sf $(build-classpath cglib21-nodep) cglib-nodep-2.1_3.jar
  ln -sf $(build-classpath hamcrest/core) hamcrest-core-1.1.jar
  ln -sf $(build-classpath hamcrest/library) hamcrest-library-1.1.jar
  ln -sf $(build-classpath junit381) junit-3.8.1.jar
  ln -sf $(build-classpath junit48) junit-4.4.jar
  ln -sf $(build-classpath objenesis) objenesis-1.0.jar
popd

%build

export CLASSPATH=""
CLASSPATH=$CLASSPATH:$(build-classpath cglib21-nodep hamcrest/core hamcrest/library)
CLASSPATH=$CLASSPATH:$(build-classpath junit381 junit48 objenesis ant/ant-junit)
ant \
  -Dant.build.javac.source=1.5 \
  -Dant.build.javac.target=1.5 \
  -Dversion=%{version}

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

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

install -m 644 %{SOURCE1} %{buildroot}%{_datadir}/maven2/poms/JPP.jmock2-jmock2-parent.pom
%add_to_maven_depmap org.jmock jmock-parent %{version} JPP/jmock2 jmock2-parent

install -pm 644 build/jmock-%{version}/jmock-%{version}.jar \
  %{buildroot}%{_javadir}/jmock2/jmock2-%{version}.jar

install -m 644 %{SOURCE2} %{buildroot}%{_datadir}/maven2/poms/JPP.jmock2-jmock2.pom
%add_to_maven_depmap org.jmock jmock %{version} JPP/jmock2 jmock2

install -m 644 build/jmock-%{version}/jmock-junit3-%{version}.jar \
	%{buildroot}%{_javadir}/jmock2/jmock2-junit3-%{version}.jar

install -m 644 %{SOURCE3} %{buildroot}%{_datadir}/maven2/poms/JPP.jmock2-jmock2-junit3.pom
%add_to_maven_depmap org.jmock jmock-junit3 %{version} JPP/jmock2 jmock2-junit3

install -m 644 build/jmock-%{version}/jmock-junit4-%{version}.jar \
  %{buildroot}%{_javadir}/jmock2/jmock2-junit4-%{version}.jar

install -m 644 %{SOURCE4} %{buildroot}%{_datadir}/maven2/poms/JPP.jmock2-jmock2-junit4.pom
%add_to_maven_depmap org.jmock jmock-junit4 %{version} JPP/jmock2 jmock2-junit4

install -m 644 build/jmock-%{version}/jmock-legacy-%{version}.jar \
  %{buildroot}%{_javadir}/jmock2/jmock2-legacy-%{version}.jar

install -m 644 %{SOURCE5} %{buildroot}%{_datadir}/maven2/poms/JPP.jmock2-jmock2-legacy.pom
%add_to_maven_depmap org.jmock jmock-legacy %{version} JPP/jmock2 jmock2-legacy

install -m 644 build/jmock-%{version}/jmock-tests-%{version}.jar \
  %{buildroot}%{_javadir}/jmock2/jmock2-tests-%{version}.jar

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

mkdir -p %{buildroot}%{_javadocdir}/jmock2-%{version}
cp -pr build/jmock-%{version}/doc/* %{buildroot}%{_javadocdir}/jmock2-%{version}
ln -s jmock2-%{version} %{buildroot}%{_javadocdir}/jmock2

#%{_bindir}/aot-compile-rpm

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

%files
%defattr(-,root,root)
%{_javadir}/jmock2/jmock2-%{version}.jar
%{_javadir}/jmock2/jmock2.jar
%{_javadir}/jmock2/jmock2-junit3-%{version}.jar
%{_javadir}/jmock2/jmock2-junit3.jar
%{_javadir}/jmock2/jmock2-junit4-%{version}.jar
%{_javadir}/jmock2/jmock2-junit4.jar
%{_javadir}/jmock2/jmock2-legacy-%{version}.jar
%{_javadir}/jmock2/jmock2-legacy.jar
%{_javadir}/jmock2/jmock2-tests-%{version}.jar
%{_javadir}/jmock2/jmock2-tests.jar
%{_datadir}/maven2/poms
%{_mavendepmapfragdir}
%doc LICENSE.txt

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

%changelog
* Fri Jan 07 2011 gil <puntogil@...> 2.4.0-2mamba
- rebuilt devel

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