File findbugs-bcel.spec of Package findbugs-bcel

#
# spec file for package findbugs-bcel
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%global findbugsver 1.3.8
# This is a version of BCEL that has been modified by the findbugs team.  They
# added some new functionality and also did some performance optimizations of
# the base code.  I am not producing a new manual, since we already have a
# bcel-manual package and the findbugs team did not patch the manual.  However,
# the javadoc package is necessary to show the changes in the API created by
# the findbug team's work.
Name:           findbugs-bcel
Version:        5.2
Release:        0
Summary:        Byte Code Engineering Library with findbugs extensions
License:        Apache-2.0
Group:          Development/Libraries/Java
Url:            http://commons.apache.org/proper/commons-bcel/
Source0:        http://www.apache.org/dist/commons/bcel/source/bcel-%{version}-src.tar.gz
Source1:        http://www.apache.org/dist/commons/bcel/source/bcel-%{version}-src.tar.gz.asc
Source2:        findbugs-bcel.keyring
# This patch is available in the findbugs release, in src/patches/bcel.diff.
Source3:        bcel.diff
BuildRequires:  java-devel
BuildRequires:  javapackages-tools
Requires:       java
Requires:       javapackages-tools
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
This is a version of Apache's Byte Code Engineering Library (BCEL) that has
been modified by the findbugs developers.  The modifications add some new
functionality, and also introduce a number of performance optimizations to
address findbugs performance problems.  Some of the performance optimizations
induce API changes, so this version of BCEL is not compatible with the vanilla
upstream version.

%package javadoc
Summary:        Javadoc for %{name}
Group:          Documentation/HTML
Requires:       javapackages-tools

%description javadoc
%{summary} package.

%prep
%setup -q -n bcel-%{version}
patch -p7 -s < %{SOURCE3}

%build
# The ant and maven builds both try to download unneeded jars
mkdir classes
find src/java -type f -name '*.java' | \
xargs javac -g -d classes -source 1.5 -target 1.5 -encoding ISO8859-1
cd classes
jar cf findbugs-bcel-%{findbugsver}.jar org
cd ..

mkdir javadoc
find src/java -type f -name '*.java' | xargs javadoc -sourcepath src/java \
  -classpath classes -source 1.5 -encoding ISO8859-1 -d javadoc

%install

mkdir -p %{buildroot}%{_javadir}
cp -p classes/findbugs-bcel-%{findbugsver}.jar %{buildroot}%{_javadir}
ln -s findbugs-bcel-%{findbugsver}.jar %{buildroot}%{_javadir}/findbugs-bcel.jar

mkdir -p %{buildroot}%{_javadocdir}
cp -a javadoc %{buildroot}%{_javadocdir}/findbugs-bcel-%{findbugsver}
ln -s findbugs-bcel-%{findbugsver} %{buildroot}%{_javadocdir}/findbugs-bcel

%files
%defattr(-,root,root,-)
%doc LICENSE.txt NOTICE.txt README.txt
%{_javadir}/findbugs-bcel*

%files javadoc
%defattr(-,root,root,-)
%doc LICENSE.txt NOTICE.txt
%{_javadocdir}/findbugs-bcel*

%changelog
openSUSE Build Service is sponsored by