# TODO: junit QA tests
# These do fail to link, disabling them
#define with_gcj %{!?_without_gcj:1}%{?_without_gcj:0}
%define with_gcj 0
Name: jfreechart
Version: 1.0.10
Release: 1%{?dist}
Summary: Java chart library
Group: Development/Libraries
License: LGPLv2+
URL: http://www.jfree.org/jfreechart/
Source0: http://download.sourceforge.net/sourceforge/jfreechart/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: servlet jcommon java jpackage-utils
BuildRequires: %{requires} ant java-devel
%if %{with_gcj}
BuildRequires: java-gcj-compat-devel >= 1.0.31
Requires(post): java-gcj-compat >= 1.0.31
Requires(postun): java-gcj-compat >= 1.0.31
%else
BuildArch: noarch
%endif
%description
JFreeChart is a free 100% Java chart library that makes it easy for
developers to display professional quality charts in their applications.
%package javadoc
Summary: Javadocs for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
Requires: jpackage-utils
%description javadoc
This package contains the API documentation for %{name}.
%prep
%setup -q
%build
# Erase prebuilt files
find \( -name '*.jar' -o -name '*.class' \) -exec rm -f '{}' \;
# Build
cd ant
ant -Djcommon.jar=$(build-classpath jcommon) -Dservlet.jar=$(build-classpath servlet) compile javadoc
%install
rm -rf $RPM_BUILD_ROOT
# Directory structure
install -d $RPM_BUILD_ROOT%{_javadir}
install -d $RPM_BUILD_ROOT%{_javadocdir}/%{name}
# JARs and JavaDoc
install -m 644 jfreechart-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
ln -s %{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
cp -rp javadoc/. $RPM_BUILD_ROOT%{_javadocdir}/%{name}
# GCJ AOT bits
%if %{with_gcj}
%{_bindir}/aot-compile-rpm
%endif
%post
%if %{with_gcj}
[ -x %{_bindir}/rebuild-gcj-db ] && %{_bindir}/rebuild-gcj-db
%endif
%postun
%if %{with_gcj}
[ -x %{_bindir}/rebuild-gcj-db ] && %{_bindir}/rebuild-gcj-db
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%{_javadir}/*
%if %{with_gcj}
%{_libdir}/gcj/%{name}
%endif
%doc ChangeLog licence-LGPL.txt NEWS README.txt
%files javadoc
%defattr(-,root,root,-)
%{_javadocdir}/%{name}
%changelog
* Sat Jul 19 2008 Lubomir Rintel (Fedora Astronomy) <lkundrak@fedoraproject.org> - 1.0.10-1
- Initial packaging