Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > c98f7e47e9109a400b9ac17988e0c60b > files > 3

cobertura-1.9-9mdv2009.0.src.rpm

%define section         free
%define gcj_support     1
%define build_tests     0

Name:           cobertura
Version:        1.9
Release:        %mkrel 9
Epoch:          0
Summary:        Free Java tool that calculates the percentage of code accessed by tests
Group:          Development/Java
License:        GPL
URL:            http://cobertura.sourceforge.net/
Source0:        http://download.sourceforge.net/cobertura/cobertura-%{version}-src.tar.bz2
Patch0:         %{name}-javadoc.patch
%if %{gcj_support}
BuildRequires:  java-gcj-compat-devel
%else
BuildArch:      noarch
%endif
Requires:       ant >= 0:1.6
Requires:       ant-junit
Requires:       ant-nodeps
Requires:       asm2
Requires:       jpackage-utils >= 0:1.5.32
Requires:       junit
Requires:       log4j
Requires:       oro
Requires:       xerces-j2
BuildRequires:  ant >= 0:1.6
BuildRequires:  ant-junit
BuildRequires:  ant-nodeps
BuildRequires:  asm2
BuildRequires:  java-devel >= 0:1.4.2
BuildRequires:  java-rpmbuild >= 0:1.5.32
BuildRequires:  junit
BuildRequires:  log4j
BuildRequires:  oro
BuildRequires:  xalan-j2
BuildRequires:  xerces-j2
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root

%description
Cobertura is a free Java tool that calculates the percentage of code 
accessed by tests. It can be used to identify which parts of your 
Java program are lacking test coverage. It is based on jcoverage.

Features:

    * Can be executed from ant or from the command line.
    * Instruments Java bytecode after it has been compiled.
    * Can generate reports in HTML or XML.
    * Shows percent of lines coveraged and branches coveraged for each
      class, package, and for the overall project.
    * Shows the McCabe cyclomatic code complexity of each class, and
      the average cyclomatic code complexity for each package, and for
      the overall product.
    * Can sort HTML results by class name, percent of lines covered,
      percent of branches covered, etc. And can sort in ascending or
      decending order.

NOTE: Due to asm version conflicts, if you use Cobertura as an ant
      task you MUST add manually a classpath element 

        <classpath location="/usr/share/java/asm2/asm2.jar"/>

      to all Cobertura tasks requiring bytecode manipulation.

NOTE: This version does NOT contain the cyclomatic code complexity 
      code because the javancss dependency cannot currently be rebuilt
      from source.

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

%description javadoc
Javadoc for %{name}.

%prep
%setup -q
%patch0 -p1
%{__perl} -pi -e 's/1000000/99999/' test/net/sourceforge/cobertura/util/IOUtilTest.java
%{_bindir}/find . -name '*.jar' | %{_bindir}/xargs -t %{__rm}

%build
export CLASSPATH=$(build-classpath ant asm2/asm2 asm2/asm2-tree junit log4j oro xalan-j2 xerces-j2)
export OPT_JAR_LIST="junit ant/ant-junit ant/ant-nodeps"
%{ant} -Dbuild.sysclasspath=last compile \
%if %{build_tests}
test \
%endif
jar javadoc

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

# jar
%{__mkdir_p} %{buildroot}%{_javadir}
%{__cp} -a %{name}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do \
%{__ln_s} ${jar} ${jar/-%{version}/}; done)

%{__mkdir_p} %{buildroot}%{_sysconfdir}/ant.d
%{__cat} > %{buildroot}%{_sysconfdir}/ant.d/%{name} << EOF
ant asm2 cobertura junit log4j oro xerces-j2
EOF

# javadoc
%{__mkdir_p} %{buildroot}%{_javadocdir}/%{name}-%{version}
%{__cp} -a build/api/* %{buildroot}%{_javadocdir}/%{name}-%{version}
(cd %{buildroot}%{_javadocdir} && %{__ln_s} %{name}-%{version} %{name})

%{__perl} -pi -e 's/\r$//g;' ChangeLog COPYING COPYRIGHT README
/bin/find examples -type f -exec %{__perl} -pi -e 's/\r$//g;' {} \;

%if %{gcj_support}
%{_bindir}/aot-compile-rpm
%endif

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

%if %{gcj_support}
%post
%{update_gcjdb}

%postun
%{clean_gcjdb}
%endif

%files
%defattr(0644,root,root,0755)
%doc ChangeLog COPYING COPYRIGHT README examples
%{_javadir}/*.jar
%if %{gcj_support}
%dir %{_libdir}/gcj/%{name}
%attr(-,root,root) %{_libdir}/gcj/%{name}/*.jar.*
%endif
%config(noreplace) %{_sysconfdir}/ant.d/%{name}

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


%changelog
* Wed Jul 23 2008 Thierry Vignaud <tvignaud@mandriva.com> 0:1.9-9mdv2009.0
+ Revision: 243583
- rebuild
- kill re-definition of %%buildroot on Pixel's request

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

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

* Wed Sep 19 2007 David Walluck <walluck@mandriva.org> 0:1.9-6mdv2008.0
+ Revision: 91106
- add asm2 to ant.d file

* Sat Sep 15 2007 Anssi Hannula <anssi@mandriva.org> 0:1.9-5mdv2008.0
+ Revision: 87290
- rebuild to filter out autorequires of GCJ AOT objects
- remove unnecessary Requires(post) on java-gcj-compat

* Sun Sep 09 2007 Pascal Terjan <pterjan@mandriva.org> 0:1.9-4mdv2008.0
+ Revision: 82798
- update to new version

* Thu Jun 07 2007 Anssi Hannula <anssi@mandriva.org> 0:1.9-3mdv2008.0
+ Revision: 36224
- rebuild with correct optflags

  + David Walluck <walluck@mandriva.org>
    - 1.9
    - Import cobertura



* Sun Jun 04 2006 David Walluck <walluck@mandriva.org> 0:1.8-2mdv2007.0
- rebuild for libgcj.so.7
- own %%{_libdir}/gcj/%%{name}

* Tue Apr 11 2006 David Walluck <walluck@mandriva.org> 0:1.8-1mdk
- 1.8
- no longer requires ccl and javancss
- no need to patch manifest (fixed upstream)
- include examples
- disable tests (requires jdom)

* Sun Jan 15 2006 David Walluck <walluck@mandriva.org> 0:1.7-3mdk 
- BuildRequires: java-gcj-compat-devel

* Tue Jan 03 2006 David Walluck <walluck@mandriva.org> 0:1.7-2mdk
- build with javancss

* Wed Dec 07 2005 David Walluck <walluck@mandriva.org> 0:1.7-1mdk
- 1.7
- aot compile

* Wed Nov 02 2005 David Walluck <walluck@mandriva.org> 0:1.6-1mdk
- 1.6
- disable tests

* Wed Aug 17 2005 David Walluck <walluck@mandriva.org> 0:1.5-1.1mdk
- 1.5
- gnu.getopt no longer required
- require oro
- export OPT_JAR_LIST when building

* Mon May 31 2005 David Walluck <walluck@mandriva.org> 0:1.4-1mdk
- 1.4

* Sat May 28 2005 David Walluck <walluck@mandriva.org> 0:1.3-1mdk
- release

* Thu Mar 17 2005 David Walluck <david@jpackage.org> 0:1.2-2jpp
- fix changelog entry

* Thu Mar 17 2005 David Walluck <david@jpackage.org> 0:1.2-1jpp
- 1.2
- drop oro as java 1.4 classes are now used for regex

* Tue Mar 15 2005 Sebastiano Vigna <vigna at acm.org> 0:1.1-3jpp
- Added blurb about required classpath ant element.

* Sat Mar 12 2005 Sebastiano Vigna <vigna at acm.org> 0:1.1-2jpp
- Removed spurious dependency on BCEL, and fixed dependency on asm2.

* Fri Mar 11 2005 Sebastiano Vigna <vigna at acm.org> 0:1.1-1jpp
- Upgrade to 1.1

* Sat Feb 19 2005 David Walluck <david@jpackage.org> 0:1.0-1jpp
- release