packages java-junit47.spec
      Pages: < 1 >  DOWNLOAD      
Name:          java-junit47
Version:       4.7
Release:       2mamba
Summary:       Java regression test package
Group:         Development/Tools
Vendor:        openmamba
Distribution:  openmamba
Packager:      gil <puntogil@...>
URL:           http://junit.org/
Source0:       http://cloud.github.com/downloads/KentBeck/junit/junit%{version}.zip
Source1:       http://mirrors.ibiblio.org/pub/mirrors/maven2/junit/junit/%{version}/junit-%{version}.pom
# git clone git://github.com/KentBeck/junit.git
Source2:       java-junit47-4.7-Version.java.template
Source3:       java-junit47-4.7-Version.java
Source4:       java-junit47-4.7-test.tar.gz
License:       Common Public License Version 1.0
BuildRequires: apache-ant
BuildRequires: apache-ant-junit
BuildRequires: apache-ant-antunit
BuildRequires: jakarta-commons-net
BuildRequires: jakarta-oro
BuildRequires: java-hamcrest
BuildRequires: jpackage-utils
Requires:      java-hamcrest
Requires:      jpackage-utils
BuildRoot:     %{_tmppath}/%{name}-%{version}-root

%description
%{name} is a regression testing framework written by Erich Gamma and Kent
Beck. It is used by the developer who implements unit tests in Java.
%{name} is Open Source Software, released under the IBM Public License and
hosted on SourceForge.

%package manual
Group:          Documentation
Summary:        Manual for %{name}

%description manual
%{name} is a regression testing framework written by Erich Gamma and Kent
Beck. It is used by the developer who implements unit tests in Java.
%{name} is Open Source Software, released under the IBM Public License and
hosted on SourceForge.

This package contains documentation for %{name}.

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

%description javadoc
%{name} is a regression testing framework written by Erich Gamma and Kent
Beck. It is used by the developer who implements unit tests in Java.
%{name} is Open Source Software, released under the IBM Public License and
hosted on SourceForge.

This package contains javadoc for %{name}.

%package demo
Group:          Development/Libraries
Summary:        Demos for %{name}
Requires:       %{name} = %{version}-%{release}

%description demo
%{name} is a regression testing framework written by Erich Gamma and Kent
Beck. It is used by the developer who implements unit tests in Java.
%{name} is Open Source Software, released under the IBM Public License and
hosted on SourceForge.

This package contains demonstrations and samples for %{name}.

%prep

%setup -q -n junit%{version}

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

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

mkdir -p lib
ln -s $(build-classpath hamcrest/core) lib/hamcrest-core-1.1.jar

mkdir -p  src/main/java
cp -pr junit-%{version}-src.jar.no src/main/java/junit-%{version}-src.jar
pushd src/main/java
	unzip junit-%{version}-src.jar
	rm -rf META-INF junit-%{version}-src.jar
popd

mkdir -p src/test/java

tar xf %{S:4} -C src/

cp -pr javadoc/stylesheet.css stylesheet.css
perl -pi -e 's/\r$//g' stylesheet.css

%build

export CLASSPATH=$(build-classpath commons-net hamcrest/core oro ant-antunit ant/ant-junit)
ant -Dant.build.javac.source=1.5 build jars javadoc

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

mkdir -p %{buildroot}%{_javadir}
install -m 644 junit%{version}/junit-%{version}.jar \
	%{buildroot}%{_javadir}/junit47-%{version}.jar
install -m 644 junit%{version}/junit-dep-%{version}.jar \
	%{buildroot}%{_javadir}/junit47-dep-%{version}.jar


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

install -m 644 junit%{version}/junit-%{version}-src.jar \
	%{buildroot}%{_javadir}/

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

mkdir -p %{buildroot}%{_javadocdir}/junit47-%{version}
cp -pr junit%{version}/javadoc/* %{buildroot}%{_javadocdir}/junit47-%{version}
ln -s junit47-%{version} %{buildroot}%{_javadocdir}/junit47

#mkdir -p %{buildroot}%{_datadir}/junit-%{version}/demo/junit 
#cp -pr junit%{version}/junit/* %{buildroot}%{_datadir}/junit-%{version}/demo/junit

#%{_bindir}/aot-compile-rpm

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

%files
%defattr(-,root,root)
%{_javadir}/junit47-%{version}.jar
%{_javadir}/junit47.jar
%{_javadir}/junit47-dep-%{version}.jar
%{_javadir}/junit47-dep.jar
%{_javadir}/junit-%{version}-src.jar
%{_datadir}/maven2/poms
%{_mavendepmapfragdir}
%doc *.html

%files manual
%defattr(-,root,root)
%doc doc/*

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

#%files demo
#%defattr(-,root,root)
#%{_datadir}/junit-%{version}

%changelog
* Thu Nov 25 2010 gil <puntogil@...> 4.7-2mamba
- rebuilt devel

* Sat Sep 26 2009 gil <puntogil@...> 4.7-1mamba
- package created by autospec