%define name cobertura %define version 1.5 %define release 1.1mdk %define section free Summary: Free Java tool that calculates the percentage of code accessed by tests Name: %{name} Version: %{version} Release: %{release} Epoch: 0 Group: Development/Java License: GPL URL: http://cobertura.sourceforge.net/ Source0: http://download.sourceforge.net/cobertura/cobertura-1.5-src.tar.bz2 Patch0: cobertura-no-javancss.patch.bz2 Patch1: cobertura-no-classpath-in-manifest.patch.bz2 BuildArch: noarch Requires: ant >= 0:1.6 Requires: ant-junit Requires: ant-nodeps Requires: asm2 Requires: gnu.getopt 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: gnu.getopt BuildRequires: jpackage-utils >= 0:1.5.32 BuildRequires: junit BuildRequires: log4j BuildRequires: oro BuildRequires: xalan-j2 BuildRequires: xerces-j2 #Vendor: JPackage Project #Distribution: JPackage BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot %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 -b .javancss %patch1 -p1 -b .manifest %{__perl} -pi -e 's/1000000/99999/' test/net/sourceforge/cobertura/util/IOUtilTest.java find . -name '*.jar' -exec %{__rm} -f '{}' ';' %build export CLASSPATH=$(build-classpath ant asm2/asm2 gnu.getopt junit log4j oro xalan-j2 xerces-j2) export OPT_JAR_LIST="junit ant/ant-junit ant/ant-nodeps" # FIXME: E: cobertura-javadoc zero-length /usr/share/javadoc/cobertura-1.5/package-list %ant -Dbuild.sysclasspath=last compile test 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 cobertura gnu.getopt 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}) %clean %{__rm} -rf %{buildroot} %post javadoc %{__rm} -f %{_javadocdir}/%{name} %{__ln_s} %{name}-%{version} %{_javadocdir}/%{name} %postun javadoc if [ $1 -eq 0 ]; then %{__rm} -f %{_javadocdir}/%{name} fi %files %defattr(0644,root,root,0755) %doc ChangeLog COPYING COPYRIGHT README %{_javadir}/*.jar %config(noreplace) %{_sysconfdir}/ant.d/%{name} %files javadoc %defattr(0644,root,root,0755) %dir %{_javadocdir}/%{name}-%{version} %{_javadocdir}/%{name}-%{version}/* %ghost %dir %{_javadocdir}/%{name} %changelog * 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