Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > by-pkgid > 253fcebb445eb43eca985bef5ad186c1 > files > 3

junit4-4.5-3.0.2mdv2009.1.src.rpm

# Copyright (c) 2000-2008, JPackage Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the
#    distribution.
# 3. Neither the name of the JPackage Project nor the names of its
#    contributors may be used to endorse or promote products derived
#    from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

%define gcj_support        1

Name:           junit4
Version:        4.5
Release:        %mkrel 3.0.2
Epoch:          0
Summary:        Java regression test package
License:        CPL
Url:            http://www.junit.org/
Group:          Development/Java
Source0:        junit-4.5.tar.bz2
# steps to reproduce
# cvs -d:pserver:anonymous@junit.cvs.sourceforge.net:/cvsroot/junit login
# cvs -z3 -d:pserver:anonymous@junit.cvs.sourceforge.net:/cvsroot/junit export -r r44 junit
# mv junit junit-4.4
# tar czf junit-4.4.tar.gz junit-4.4/

# Source1:        junit4.4-build.xml
Source2:        junit-4.5.pom
BuildRequires:  ant
BuildRequires:  java-rpmbuild >= 0:1.6
BuildRequires:  dos2unix
BuildRequires:  hamcrest
%if %{gcj_support}
BuildRequires:  java-gcj-compat-devel
%else
BuildArch:      noarch
%endif
Buildroot:      %{_tmppath}/%{name}-%{version}-%{release}-root

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

%package manual
Group:          Development/Java
Summary:        Manual for %{name}

%description manual
Documentation for %{name}.

%package javadoc
Group:          Development/Java
Summary:        Javadoc for %{name}

%description javadoc
Javadoc for %{name}.

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

%description demo
Demonstrations and samples for %{name}.

%prep
%setup -q -n junit-%{version}
%remove_java_binaries
ln -sf $(build-classpath hamcrest/core) lib/hamcrest-core-1.1.jar
#rm src/org/junit/tests/BothTest.java


%build
%{ant} dist

find -name \*.htm -o -name \*.html | xargs dos2unix

%install
%{__rm} -rf %{buildroot}

# jars
%{__mkdir_p} %{buildroot}%{_javadir}
%{__cp} -a junit%{version}/junit-4.5.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do %{__ln_s} ${jar} ${jar/-%{version}/}; done)
# pom
install -d -m 755 %{buildroot}%{_datadir}/maven2/poms
install -m 644 %{SOURCE2} %{buildroot}%{_datadir}/maven2/poms/JPP-%{name}.pom
%add_to_maven_depmap junit junit %{version} JPP %{name}
%add_to_maven_depmap junit junit4 %{version} JPP %{name}
# javadoc
%{__mkdir_p} %{buildroot}%{_javadocdir}/%{name}-%{version}
%{__cp} -a junit%{version}/javadoc/* %{buildroot}%{_javadocdir}/%{name}-%{version}
(cd %{buildroot}%{_javadocdir} && %{__ln_s} %{name}-%{version} %{name})
# demo
%{__mkdir_p} %{buildroot}%{_datadir}/%{name}/demo/junit
%{__cp} -a junit%{version}/junit/* %{buildroot}%{_datadir}/%{name}/demo/junit

%{gcj_compile}

# fix end-of-line
%{__perl} -pi -e 's/\r$//g' README.html

for i in `find junit%{version}/doc -type f -name "*.htm*"`; do
    %{__perl} -pi -e 's/\r$//g' $i
done

for i in `find %{buildroot}%{_datadir}/%{name} -type f -name "*.java"`; do
    %{__perl} -pi -e 's/\r$//g' $i
done

%clean
%{__rm} -rf %{buildroot}

%post
%update_maven_depmap
%if %{gcj_support}
%{update_gcjdb}
%endif

%postun
%update_maven_depmap
%if %{gcj_support}
%{clean_gcjdb}
%endif

%files
%defattr(0644,root,root,0755)
%doc README.html
%{_javadir}/*
%{_datadir}/maven2
%{_mavendepmapfragdir}
%{gcj_files}
%dir %{_datadir}/%{name}

%files manual
%defattr(0644,root,root,0755)
%doc junit%{version}/doc/*

%files javadoc
%defattr(0644,root,root,0755)
%{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}

%files demo
%defattr(0644,root,root,0755)
%{_datadir}/%{name}/*


%changelog
* Fri Jan 23 2009 Jérôme Soyer <saispo@mandriva.org> 0:4.5-3.0.2mdv2009.1
+ Revision: 332739
- New upstream release

* Wed Aug 06 2008 Thierry Vignaud <tvignaud@mandriva.com> 0:4.4-3.0.2mdv2009.0
+ Revision: 264757
- rebuild early 2009.0 package (before pixel changes)

* Tue May 13 2008 Alexander Kurtakov <akurtakov@mandriva.org> 0:4.4-1.0.2mdv2009.0
+ Revision: 206543
- add artifactId junit:junit4 to the depmap

* Fri Apr 18 2008 Alexander Kurtakov <akurtakov@mandriva.org> 0:4.4-1.0.1mdv2009.0
+ Revision: 195643
- new version

* Mon Feb 18 2008 Alexander Kurtakov <akurtakov@mandriva.org> 0:4.3.1-4.0.1mdv2008.1
+ Revision: 171990
- use %%{gcj_compile} macro

* Thu Feb 07 2008 Alexander Kurtakov <akurtakov@mandriva.org> 0:4.3.1-3.0.1mdv2008.1
+ Revision: 163776
- add maven pom

* Thu Jan 10 2008 David Walluck <walluck@mandriva.org> 0:4.3.1-2.0.4mdv2008.1
+ Revision: 147444
- bump release

* Fri Jan 04 2008 David Walluck <walluck@mandriva.org> 0:4.3.1-2.0.3mdv2008.1
+ Revision: 145454
- rebuild with gcj support

  + Olivier Blin <oblin@mandriva.com>
    - restore BuildRoot

  + Thierry Vignaud <tvignaud@mandriva.com>
    - kill re-definition of %%buildroot on Pixel's request

* Sun Dec 16 2007 Anssi Hannula <anssi@mandriva.org> 0:4.3.1-2.0.2mdv2008.1
+ Revision: 120955
- buildrequire java-rpmbuild, i.e. build with icedtea on x86(_64)

* Sun Dec 09 2007 Alexander Kurtakov <akurtakov@mandriva.org> 0:4.3.1-2.0.1mdv2008.1
+ Revision: 116715
- disable gcj_support - aot fails

  + Anssi Hannula <anssi@mandriva.org>
    - rebuild to filter out autorequires of GCJ AOT objects
    - remove unnecessary Requires(post) on java-gcj-compat

* Fri Jun 29 2007 David Walluck <walluck@mandriva.org> 0:4.3.1-1.2mdv2008.0
+ Revision: 45723
- disable test run for now
- fix jar contents
- fix typo in %%{__ln_s} macro
- bump release
- enable aot-compile-rpm
- enable gcj support
- Import junit4



* Fri Jun 29 2007 David Walluck <walluck@mandriva.org> 0:4.3.1-1.1mdv2008.0
- release