2877c9c
# This is a version of BCEL that has been modified by the findbugs team.  They
2877c9c
# added some new functionality and also did some performance optimizations of
2877c9c
# the base code.  I am not producing a new manual, since we already have a
2877c9c
# bcel-manual package and the findbugs team did not patch the manual.  However,
2877c9c
# the javadoc package is necessary to show the changes in the API created by
2877c9c
# the findbug team's work.
2877c9c
294428c
%define findbugsver 1.3.8
2877c9c
%define with_gcj %{!?_without_gcj:1}%{?_without_gcj:0}
2877c9c
2877c9c
Name:           findbugs-bcel
2877c9c
Version:        5.2
34d23f2
Release:        %{findbugsver}%{?dist}.2
2877c9c
Summary:        Byte Code Engineering Library with findbugs extensions
2877c9c
2877c9c
Group:          Development/Libraries/Java
2877c9c
License:        ASL 2.0
2877c9c
URL:            http://jakarta.apache.org/bcel/
2877c9c
Source0:        http://www.apache.org/dist/jakarta/bcel/source/bcel-%{version}-src.tar.gz
2877c9c
# This patch is available in the findbugs release, in src/patches/bcel.diff.
2877c9c
Source1:        bcel.diff
2877c9c
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
2877c9c
2877c9c
BuildRequires:  java-devel, jpackage-utils
2877c9c
Requires:       java, jpackage-utils
2877c9c
2877c9c
%if %{with_gcj}
2877c9c
BuildRequires:  java-gcj-compat-devel >= 1.0.31
2877c9c
Requires(post): java-gcj-compat >= 1.0.31
2877c9c
Requires(postun): java-gcj-compat >= 1.0.31
2877c9c
%else
2877c9c
BuildArch:      noarch
2877c9c
%endif
2877c9c
2877c9c
%description
2877c9c
This is a version of Apache's Byte Code Engineering Library (BCEL) that has
2877c9c
been modified by the findbugs developers.  The modifications add some new
2877c9c
functionality, and also introduce a number of performance optimizations to
2877c9c
address findbugs performance problems.  Some of the performance optimizations
2877c9c
induce API changes, so this version of BCEL is not compatible with the vanilla
2877c9c
upstream version.
2877c9c
2877c9c
%package javadoc
2877c9c
Summary:        Javadoc for %{name}
2877c9c
Group:          Development/Documentation
2877c9c
2877c9c
%description javadoc
2877c9c
%{summary}.
2877c9c
2877c9c
%prep
2877c9c
%setup -q -n bcel-%{version}
294428c
%{__patch} -p7 -s < %{SOURCE1}
2877c9c
2877c9c
%build
2877c9c
# The ant and maven builds both try to download unneeded jars
2877c9c
mkdir classes
2877c9c
find src/java -type f -name '*.java' | \
2877c9c
xargs javac -g -d classes -source 1.5 -encoding ISO8859-1
2877c9c
cd classes
2877c9c
jar cf findbugs-bcel-%{findbugsver}.jar org
2877c9c
cd ..
2877c9c
2877c9c
mkdir javadoc
2877c9c
find src/java -type f -name '*.java' | xargs javadoc -sourcepath src/java \
2877c9c
  -classpath classes -source 1.5 -encoding ISO8859-1 -d javadoc 
2877c9c
2877c9c
%install
2877c9c
rm -rf $RPM_BUILD_ROOT
2877c9c
2877c9c
mkdir -p $RPM_BUILD_ROOT%{_javadir}
2877c9c
cp -p classes/findbugs-bcel-%{findbugsver}.jar $RPM_BUILD_ROOT%{_javadir}
2877c9c
ln -s findbugs-bcel-%{findbugsver}.jar $RPM_BUILD_ROOT%{_javadir}/findbugs-bcel.jar
2877c9c
2877c9c
mkdir -p $RPM_BUILD_ROOT%{_javadocdir}
2877c9c
cp -a javadoc $RPM_BUILD_ROOT%{_javadocdir}/findbugs-bcel-%{findbugsver}
2877c9c
ln -s findbugs-bcel-%{findbugsver} $RPM_BUILD_ROOT%{_javadocdir}/findbugs-bcel
2877c9c
2877c9c
%if %{with_gcj}
2877c9c
%{_bindir}/aot-compile-rpm
2877c9c
%endif
2877c9c
2877c9c
%clean
2877c9c
rm -rf $RPM_BUILD_ROOT
2877c9c
2877c9c
%post
2877c9c
%if %{with_gcj}
2877c9c
if [ -x %{_bindir}/rebuild-gcj-db ]; then
2877c9c
  %{_bindir}/rebuild-gcj-db
2877c9c
fi
2877c9c
%endif
2877c9c
2877c9c
%postun
2877c9c
%if %{with_gcj}
2877c9c
if [ -x %{_bindir}/rebuild-gcj-db ]; then
2877c9c
  %{_bindir}/rebuild-gcj-db
2877c9c
fi
2877c9c
%endif
2877c9c
2877c9c
%files
2877c9c
%defattr(-,root,root,-)
2877c9c
%doc LICENSE.txt NOTICE.txt README.txt
2877c9c
%{_javadir}/findbugs-bcel*
2877c9c
%if %{with_gcj}
2877c9c
%{_libdir}/gcj/%{name}
2877c9c
%endif
2877c9c
2877c9c
%files javadoc
2877c9c
%defattr(-,root,root,-)
34d23f2
%doc LICENSE.txt NOTICE.txt
2877c9c
%{_javadocdir}/findbugs-bcel*
2877c9c
2877c9c
%changelog
34d23f2
* Sun Jul 18 2010 Richard Fearn <richardfearn@gmail.com> - 5.2-1.3.8.2
34d23f2
- Add licence files to -javadoc subpackage to comply with new Subpackage
34d23f2
  Licensing requirements
34d23f2
045f264
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.2-1.3.8.1
045f264
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
045f264
294428c
* Tue Mar 17 2009 Jerry James <loganjerry@gmail.com> - 5.2-1.3.8
294428c
- Update to the findbugs 1.3.8 version of the BCEL patch
294428c
- The BCEL patch now applies cleanly, so drop workaround code
294428c
e69aef0
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.2-1.3.7.2
e69aef0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
e69aef0
2877c9c
* Tue Jan 13 2009 Jerry James <loganjerry@gmail.com> - 5.2-1.3.7.1
2877c9c
- Add '-source 1.5' to the javac and javadoc invocations
2877c9c
2877c9c
* Fri Jan  2 2009 Jerry James <loganjerry@gmail.com> - 5.2-1.3.7
2877c9c
- Update to the findbugs 1.3.7 version of the BCEL patch
2877c9c
2877c9c
* Mon Dec  8 2008 Jerry James <loganjerry@gmail.com> - 5.2-1.3.6
2877c9c
- Update to the findbugs 1.3.6 version of the BCEL patch
2877c9c
2877c9c
* Thu Sep 18 2008 Jerry James <loganjerry@gmail.com> - 5.2-1.3.5
2877c9c
- Initial RPM