packages java-mockobjects.spec
      Pages: < 1 >  DOWNLOAD      
%define javahome /usr/lib/jvm/jdk-gcj
Name:          java-mockobjects
Version:       0.10dev
Release:       3mamba
Summary:       Java MockObjects package
Group:         Development/Libraries/Java
Vendor:        openmamba
Distribution:  openmamba
Packager:      gil <puntogil@...>
URL:           http://sourceforge.net/projects/mockobjects
# cvs -d:pserver:anonymous@...:/cvsroot/mockobjects login
# cvs -z3 -d:pserver:anonymous@...:/cvsroot/mockobjects co -P mockobjects-java
# tar czf mockobjects-java-0.10dev-src-cvs.tar.gz mockobjects-java
Source0:       mockobjects-java-0.10dev-src-cvs.tar.gz

Source1:       mockobjects-core-%{version}.pom
Source2:       mockobjects-httpclient-%{version}.pom
Source3:       mockobjects-alt-httpclient-%{version}.pom
Source4:       mockobjects-jdk1.4-%{version}.pom
Source5:       mockobjects-alt-jdk1.4-%{version}.pom
Source6:       mockobjects-jdk1.4-j2ee1.4-%{version}.pom
Source7:       mockobjects-alt-jdk1.4-j2ee1.4-%{version}.pom

Patch0:        java-mockobjects-0.10dev-FileImpl.patch
Patch1:        java-mockobjects-0.10dev-MockPutMethod.patch
# fix for junit 3.8.2 do not use
Patch2:        java-mockobjects-0.10dev-AssertMo.patch
Patch3:        java-mockobjects-0.10dev-MockConnection.patch
Patch4:        java-mockobjects-0.10dev-MockMessagePublisher.patch
Patch5:        java-mockobjects-0.10dev-MockQueueConnectionFactory.patch
Patch6:        java-mockobjects-0.10dev-MockQueueSender.patch
Patch7:        java-mockobjects-0.10dev-MockSession.patch
Patch8:        java-mockobjects-0.10dev-MockTopicConnectionFactory.patch
# temporary build fix for mockobjects-alt-jdk1.4-j2ee1.4
Patch9:        java-mockobjects-0.10dev-MockBytesMessage.patch
# fix for junit 3.8.2 do not use
Patch10:       java-mockobjects-0.10dev-01-AssertMo.patch
License:       Apache Software License Version , BSD
BuildRequires: apache-ant
BuildRequires: apache-ant-junit
BuildRequires: apache-geronimo-1.2-j2ee-1.4-api
BuildRequires: jakarta-commons-httpclient
BuildRequires: java-gcj-compat
BuildRequires: java-junit381
BuildRoot:     %{_tmppath}/%{name}-%{version}-root

%description
The Mock Objects project is a generic unit testing framework whose goal
is to facilitate developing unit tests in the mock object style. The
goal of this project is to provide, a core mock objects framework. This
is a library of code that supports the implementation of mock objects.
It is based around a set of expectation classes for values and
collections. There are also various other classes to make mock objects
easier to write or to use.

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

%description javadoc
The Mock Objects project is a generic unit testing framework whose goal
is to facilitate developing unit tests in the mock object style. The
goal of this project is to provide, a core mock objects framework. This
is a library of code that supports the implementation of mock objects.
It is based around a set of expectation classes for values and
collections. There are also various other classes to make mock objects
easier to write or to use.

This package contains javadoc for %{name}.

%package jdk1.4
Group:         Development/Libraries/Java
Summary:       MockObjects for 1.4 JDK
Requires:      %{name} = %{version}-%{release}
Requires:      java-gcj-compat

%description jdk1.4
MockObjects specific to JDK 1.4.x.

%package httpclient
Group:         Development/Libraries/Java
Summary:       MockObjects for Commons HttpClient
Requires:      %{name} = %{version}-%{release}
Requires:      jakarta-commons-httpclient

%description httpclient
MockObjects for Jakarta Commons HttpClient.

%package alt-httpclient
Group:         Development/Libraries/Java
Summary:       Mockable API for Commons HttpClient
Requires:      %{name}-httpclient = %{version}-%{release}
Requires:      %{name} = %{version}-%{release}
Requires:      jakarta-commons-httpclient

%description alt-httpclient
Alternative API for Jakarta Commons HttpClient to allow for testing.

%package alt-jdk1.4
Group:         Development/Libraries/Java
Summary:       Mockable API for JDK 1.4
Requires:      %{name} = %{version}-%{release}
Requires:      %{name}-jdk1.4 = %{version}-%{release}
Requires:      java-gcj-compat

%description alt-jdk1.4
Alternative API for JDK 1.4 to allow for testing.

%package jdk1.4-j2ee1.4
Group:         Development/Libraries/Java
Summary:       Mockable J2EE API for JDK 1.4 and J2EE 1.4
Requires:      %{name} = %{version}-%{release}
Requires:      %{name}-jdk1.4 = %{version}-%{release}
Requires:      java-gcj-compat

%description jdk1.4-j2ee1.4
API for JDK 1.4 to allow testing with J2EE 1.4 mocks.

%package alt-jdk1.4-j2ee1.4
Group:         Development/Libraries/Java
Summary:       Mockable J2EE API for JDK 1.4 and J2EE 1.4
Requires:      %{name} = %{version}-%{release}
Requires:      %{name}-jdk1.4 = %{version}-%{release}
Requires:      java-gcj-compat

%description alt-jdk1.4-j2ee1.4
Alternative API for JDK 1.4 to allow testing with J2EE 1.4 mocks.

%prep

%setup -q -n mockobjects-java
# -D -T
%patch0 -p0
%patch1 -p0
#%patch2 -p0
%patch3 -p0
%patch4 -p0
%patch5 -p0
%patch6 -p0
%patch7 -p0
%patch8 -p0
%patch9 -p0
#%patch10 -p0

for j in $(find . -name "CVS"); do
  rm -rf $j
done

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

mkdir -p lib
ln -sf $(build-classpath junit381) lib/junit.jar

%build

export JAVA_HOME=%javahome 
CLASSPATH=$(build-classpath junit381 ant/ant-junit) ant jar-core
CLASSPATH=$(build-classpath junit381) ant -buildfile build.xml -Dbuild.compiler=modern jar-jdk
CLASSPATH=$(build-classpath jakarta-commons-httpclient junit381) ant jar-ext-httpclient
rm -rf out/j2ee/classes/*
CLASSPATH=$(build-classpath geronimo/j2ee-1.4-api junit381) ant -Djdk.version=1.4 -Dj2ee.version=1.4 compile-j2ee jar-j2ee
CLASSPATH=$CLASSPATH ant javadoc

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

mkdir -p %{buildroot}%{_javadir}

pushd out
install -m 644 mockobjects-core-%{version}.jar %{buildroot}%{_javadir}/

install -m 644 mockobjects-httpclient.jar %{buildroot}%{_javadir}/mockobjects-httpclient-%{version}.jar
install -m 644 alt-httpclient.jar %{buildroot}%{_javadir}/mockobjects-alt-httpclient-%{version}.jar

install -m 644 mockobjects-alt-jdk1.4-%{version}.jar %{buildroot}%{_javadir}/
install -m 644 mockobjects-jdk1.4-%{version}.jar %{buildroot}%{_javadir}/

install -m 644 mockobjects-jdk1.4-j2ee1.4-%{version}.jar %{buildroot}%{_javadir}/
install -m 644 mockobjects-alt-jdk1.4-j2ee1.4-%{version}.jar %{buildroot}%{_javadir}/


mkdir -p %{buildroot}%{_javadocdir}/mockobjects-%{version}
cp -pr doc/javadoc-1.4/* %{buildroot}%{_javadocdir}/mockobjects-%{version}
ln -s mockobjects-%{version} %{buildroot}%{_javadocdir}/mockobjects

popd

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

mkdir -p %{buildroot}%{_datadir}/maven2/poms
install -m 644 %{SOURCE1} %{buildroot}%{_datadir}/maven2/poms/JPP-mockobjects-core.pom
%add_to_maven_depmap mockobjects mockobjects-core %{version} JPP mockobjects-core

install -m 644 %{SOURCE2} %{buildroot}%{_datadir}/maven2/poms/JPP-mockobjects-httpclient.pom
%add_to_maven_depmap mockobjects mockobjects-httpclient %{version} JPP mockobjects-httpclient

install -m 644 %{SOURCE3} %{buildroot}%{_datadir}/maven2/poms/JPP-mockobjects-alt-httpclient.pom
%add_to_maven_depmap mockobjects mockobjects-alt-httpclient %{version} JPP mockobjects-alt-httpclient

install -m 644 %{SOURCE4} %{buildroot}%{_datadir}/maven2/poms/JPP-mockobjects-jdk1.4.pom
%add_to_maven_depmap mockobjects mockobjects-jdk1.4 %{version} JPP mockobjects-jdk1.4

install -m 644 %{SOURCE5} %{buildroot}%{_datadir}/maven2/poms/JPP-mockobjects-alt-jdk1.4.pom
%add_to_maven_depmap mockobjects mockobjects-alt-jdk1.4 %{version} JPP mockobjects-alt-jdk1.4

install -m 644 %{SOURCE6} %{buildroot}%{_datadir}/maven2/poms/JPP-mockobjects-jdk1.4-j2ee1.4.pom
%add_to_maven_depmap mockobjects mockobjects-jdk1.4-j2ee1.4 %{version} JPP mockobjects-jdk1.4-j2ee1.4

install -m 644 %{SOURCE7} %{buildroot}%{_datadir}/maven2/poms/JPP-mockobjects-alt-jdk1.4-j2ee1.4.pom
%add_to_maven_depmap mockobjects mockobjects-alt-jdk1.4-j2ee1.4 %{version} JPP mockobjects-alt-jdk1.4-j2ee1.4

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

%post
%update_maven_depmap

%postun
%update_maven_depmap

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

%files jdk1.4
%defattr(-,root,root)
%{_javadir}/mockobjects-jdk1.4-%{version}.jar
%{_javadir}/mockobjects-jdk1.4.jar

%files httpclient
%defattr(-,root,root)
%{_javadir}/mockobjects-httpclient-%{version}.jar
%{_javadir}/mockobjects-httpclient.jar

%files alt-httpclient
%defattr(-,root,root)
%{_javadir}/mockobjects-alt-httpclient-%{version}.jar
%{_javadir}/mockobjects-alt-httpclient.jar

%files alt-jdk1.4
%defattr(-,root,root)
%{_javadir}/mockobjects-alt-jdk1.4-%{version}.jar
%{_javadir}/mockobjects-alt-jdk1.4.jar

%files jdk1.4-j2ee1.4
%defattr(-,root,root)
%{_javadir}/mockobjects-jdk1.4-j2ee1.4-%{version}.jar
%{_javadir}/mockobjects-jdk1.4-j2ee1.4.jar

%files alt-jdk1.4-j2ee1.4
%defattr(-,root,root)
%{_javadir}/mockobjects-alt-jdk1.4-j2ee1.4-%{version}.jar
%{_javadir}/mockobjects-alt-jdk1.4-j2ee1.4.jar

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

%changelog
* Sat Mar 05 2011 gil <puntogil@...> 0.10dev-3mamba
- rebuilt with java-gcj-compat support
- add new sub package:  jdk1.4, httpclient, alt-httpclient, alt-jdk1.4, jdk1.4-j2ee1.4, alt-jdk1.4-j2ee1.4
- add maven 2 poms

* Fri Nov 05 2010 gil <puntogil@...> 0.10dev-2mamba
- rebuilt devel

* Mon Mar 16 2009 gil <puntogil@...> 0.10dev-1mamba
- package created by autospec