Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37825033
en ru br
ALT Linux repos
5.0: 1.9-alt1_10jpp5
4.1: 1.9-alt1_2jpp1.7
4.0: 1.9-alt1_2jpp1.7

Group :: Development/Java
RPM: cobertura

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

BuildRequires: /proc
BuildRequires: jpackage-1.4-compat
# Copyright (c) 2000-2007, 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 0


Summary:        Free Java tool that calculates the percentage of code accessed by tests
Name:           cobertura
Version:        1.9
Release:        alt1_2jpp1.7
Epoch:          0
Group:          Development/Java
License:        GPL
URL:            http://cobertura.sourceforge.net/
Source0:        http://prdownloads.sourceforge.net/cobertura/cobertura-1.9-src.tar.gz
Source1:        %{name}-%{version}.pom
Source2:        %{name}-runtime-%{version}.pom
Patch0:         cobertura-build_xml.patch
Patch1:         cobertura-scripts.patch
Requires: ant >= 0:1.6.5
Requires: asm2
Requires: jpackage-utils >= 0:1.7.2
Requires: jakarta-oro
Requires: junit
Requires: log4j
Requires: xerces-j2
BuildRequires: ant >= 0:1.6.5
BuildRequires: asm2
BuildRequires: jpackage-utils >= 0:1.7.2
BuildRequires: jakarta-oro
BuildRequires: jaxen
BuildRequires: jdom
BuildRequires: junit
BuildRequires: log4j
BuildRequires: xalan-j2
BuildRequires: xerces-j2
BuildRequires: xml-commons-jaxp-1.3-apis
Requires(post): jpackage-utils >= 0:1.7.2
Requires(postun): jpackage-utils >= 0:1.7.2
%if %{gcj_support}
BuildRequires: gnu-crypto
BuildRequires: java-gcj-compat-devel
Requires(post): java-gcj-compat
Requires(postun): java-gcj-compat
%endif
%if ! %{gcj_support}
BuildArch:      noarch
%endif
Patch33: cobertura-1.9-javadoc-exclude.patch

%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.

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

%description    javadoc
Javadoc for %{name}.

%prep
%setup -q
%patch0 -b .sav
%patch1 -b .sav
for j in $(find . -name '*.jar'); do
   mv $j $j.no
done
%patch33 -p1

%build
pushd lib
ln -sf $(build-classpath asm2/asm2)
ln -sf $(build-classpath asm2/asm2-tree)
ln -sf $(build-classpath jaxen)
ln -sf $(build-classpath jdom)
ln -sf $(build-classpath junit)
ln -sf $(build-classpath oro)
ln -sf $(build-classpath log4j)
ln -sf $(build-classpath xalan-j2)
pushd xerces
ln -sf $(build-classpath xerces-j2)
ln -sf $(build-classpath xml-commons-jaxp-1.3-apis)
popd
popd

%ant 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)
%add_to_maven_depmap cobertura cobertura %{version} JPP %{name}
%add_to_maven_depmap cobertura cobertura-runtime %{version} JPP %{name}-runtime

# pom

%__mkdir_p %{buildroot}%{_datadir}/maven2/poms
%__cp -a %{SOURCE1} %{buildroot}%{_datadir}/maven2/poms/JPP-%{name}.pom
%__cp -a %{SOURCE2} %{buildroot}%{_datadir}/maven2/poms/JPP-%{name}-runtime.pom

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

# bin

%__mkdir_p %{buildroot}%{_bindir}
%__install -m 755 cobertura-check.sh %{buildroot}%{_bindir}/cobertura-check
%__install -m 755 cobertura-instrument.sh %{buildroot}%{_bindir}/cobertura-instrument
%__install -m 755 cobertura-merge.sh %{buildroot}%{_bindir}/cobertura-merge
%__install -m 755 cobertura-report.sh %{buildroot}%{_bindir}/cobertura-report

# javadoc

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

%if %{gcj_support}
export CLASSPATH=$(build-classpath gnu-crypto)
%{_bindir}/aot-compile-rpm
%endif

%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

%post
%update_maven_depmap
%if %{gcj_support}
if [ -x %{_bindir}/rebuild-gcj-db ]
then
 %{_bindir}/rebuild-gcj-db
fi
%endif

%postun
%update_maven_depmap
%if %{gcj_support}
if [ -x %{_bindir}/rebuild-gcj-db ]
then
 %{_bindir}/rebuild-gcj-db
fi
%endif

%files
%doc ChangeLog COPYING COPYRIGHT README
%attr(0755,root,root) %{_bindir}/*
%{_javadir}/*.jar
%config(noreplace) %{_sysconfdir}/ant.d/%{name}
%{_datadir}/maven2/poms/JPP-%{name}*.pom
%{_mavendepmapfragdir}
%if %{gcj_support}
%dir %{_libdir}/gcj/%{name}
%{_libdir}/gcj/%{name}/%{name}-%{version}.jar.*
%endif

%files javadoc
%dir %{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}-%{version}/*
%ghost %dir %{_javadocdir}/%{name}

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin