Blame SPECS/jfreechart.spec

35c74b
%{?scl:%scl_package jfreechart}
35c74b
%{!?scl:%global pkg_name %{name}}
35c74b
35c74b
# Exclude generation of osgi() style provides, since they are not
35c74b
# SCL-namespaced and may conflict with base RHEL packages.
35c74b
# See: https://bugzilla.redhat.com/show_bug.cgi?id=1045437
35c74b
%global __provides_exclude ^osgi(.*)$
35c74b
35c74b
Name:           %{?scl_prefix}jfreechart
35c74b
Version:        1.0.14
35c74b
Release:        14%{?dist}
35c74b
Summary:        Java chart library
35c74b
35c74b
Group:          Development/Libraries
35c74b
License:        LGPLv2+
35c74b
URL:            http://www.jfree.org/jfreechart/
35c74b
Source0:        http://download.sourceforge.net/sourceforge/jfreechart/%{pkg_name}-%{version}.tar.gz
35c74b
Source1:        bnd.properties
35c74b
35c74b
Requires:       servlet java jpackage-utils
35c74b
Requires:       %{?scl_prefix}jcommon >= 1.0.17
35c74b
BuildRequires:  %{requires} ant java-devel servlet
35c74b
%if 0%{?fedora}
35c74b
BuildRequires:  eclipse-swt
35c74b
%endif
35c74b
# Required for converting jars to OSGi bundles
35c74b
BuildRequires:  aqute-bnd
35c74b
35c74b
%{?scl:Requires: %scl_runtime}
35c74b
35c74b
BuildArch:      noarch
35c74b
Patch0:         remove_itext_dep.patch
35c74b
35c74b
%description
35c74b
JFreeChart is a free 100% Java chart library that makes it easy for
35c74b
developers to display professional quality charts in their applications.
35c74b
35c74b
%if 0%{?fedora}
35c74b
%package swt
35c74b
Summary:        Experimental swt extension for jfreechart
35c74b
Group:          Development/Libraries
35c74b
Requires:       %{name} = %{version}-%{release}
35c74b
Requires:       eclipse-swt jpackage-utils
35c74b
35c74b
%description swt
35c74b
Experimental swt extension for jfreechart.
35c74b
%endif
35c74b
35c74b
%package javadoc
35c74b
Summary:        Javadocs for %{name}
35c74b
Group:          Documentation
35c74b
Requires:       %{name} = %{version}-%{release}
35c74b
Requires:       jpackage-utils
35c74b
35c74b
%description javadoc
35c74b
This package contains the API documentation for %{name}.
35c74b
35c74b
35c74b
%prep
35c74b
%setup -q -n %{pkg_name}-%{version}
35c74b
# Erase prebuilt files
35c74b
find \( -name '*.jar' -o -name '*.class' \) -exec rm -f '{}' \;
35c74b
%patch0
35c74b
35c74b
%build
35c74b
# jcommon comes from the SCL-ized package. That's why we need to source
35c74b
# the enable scriptlet.
35c74b
%{?scl:scl enable %{scl} - << "EOF"}
35c74b
CLASSPATH=$(build-classpath jcommon servlet) \
35c74b
    ant -f ant/build.xml compile javadoc
35c74b
35c74b
%if 0%{?fedora}
35c74b
# See RHBZ#912664. There seems to be some dispute about build-classpath.
35c74b
# So don't use it for swt.
35c74b
ant -f ant/build-swt.xml \
35c74b
        -Dswt.jar=%{_libdir}/eclipse/swt.jar \
35c74b
        -Djcommon.jar=$(build-classpath jcommon) \
35c74b
        -Djfreechart.jar=lib/jfreechart-%{version}.jar
35c74b
%endif
35c74b
# Convert to OSGi bundle
35c74b
java -Djfreechart.bundle.version="%{version}" -jar $(build-classpath aqute-bnd) \
35c74b
   wrap -output lib/%{pkg_name}-%{version}.bar -properties %{SOURCE1} lib/%{pkg_name}-%{version}.jar
35c74b
%{?scl:EOF}
35c74b
35c74b
%install
35c74b
# Directory structure
35c74b
install -d $RPM_BUILD_ROOT%{_javadir}/%{pkg_name}
35c74b
install -d $RPM_BUILD_ROOT%{_javadocdir}/%{pkg_name}
35c74b
install -d $RPM_BUILD_ROOT%{_mavenpomdir}
35c74b
35c74b
# JARs and JavaDoc
35c74b
install -m 644 lib/jfreechart-%{version}.bar  $RPM_BUILD_ROOT%{_javadir}/%{pkg_name}/%{pkg_name}.jar
35c74b
%if 0%{?fedora}
35c74b
install -m 644 lib/swtgraphics2d.jar  $RPM_BUILD_ROOT%{_javadir}/%{pkg_name}/swtgraphics2d.jar
35c74b
install -m 644 lib/jfreechart-%{version}-swt.jar  $RPM_BUILD_ROOT%{_javadir}/%{pkg_name}/%{pkg_name}-swt.jar
35c74b
%endif
35c74b
cp -rp javadoc/. $RPM_BUILD_ROOT%{_javadocdir}/%{pkg_name}
35c74b
35c74b
# POM
35c74b
install -pm 644 pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{pkg_name}-%{pkg_name}.pom
35c74b
35c74b
# DEPMAP
35c74b
%add_maven_depmap JPP.%{pkg_name}-%{pkg_name}.pom %{pkg_name}/%{pkg_name}.jar
35c74b
35c74b
%files
35c74b
%{_mavenpomdir}/*
35c74b
%{_mavendepmapfragdir}/*
35c74b
%dir %{_javadir}/%{pkg_name}
35c74b
%{_javadir}/%{pkg_name}/%{pkg_name}.jar
35c74b
%doc ChangeLog licence-LGPL.txt NEWS README.txt
35c74b
35c74b
%if 0%{?fedora}
35c74b
%files swt
35c74b
%{_javadir}/%{name}/swtgraphics2d*.jar
35c74b
%{_javadir}/%{name}/%{name}-swt*.jar
35c74b
%endif
35c74b
35c74b
%files javadoc
35c74b
%{_javadocdir}/%{pkg_name}
35c74b
35c74b
%changelog
35c74b
* Fri Dec 20 2013 Severin Gehwolf <sgehwolf@redhat.com> 1.0.14-14
35c74b
- Don't generate osgi() style provides.
35c74b
- Resolves: RHBZ#1045437.
35c74b
35c74b
* Wed Nov 27 2013 Severin Gehwolf <sgehwolf@redhat.com> 1.0.14-13
35c74b
- Properly enalbe SCL.
35c74b
35c74b
* Mon Nov 11 2013 Severin Gehwolf <sgehwolf@redhat.com> 1.0.14-12
35c74b
- Use build-classpath which now accounts for SCL-ized deps if
35c74b
  properly enabled.
35c74b
35c74b
* Tue Sep 17 2013 Severin Gehwolf <sgehwolf@redhat.com> 1.0.14-11
35c74b
- BR SCL-ized jcommon package.
35c74b
- SCL-ize ant build command.
35c74b
35c74b
* Wed Aug 28 2013 Severin Gehwolf <sgehwolf@redhat.com> 1.0.14-10
35c74b
- SCL-ize package.
35c74b
35c74b
* Tue Feb 19 2013 Severin Gehwolf <sgehwolf@redhat.com> 1.0.14-9
35c74b
- Fix FTBFS due to build-classpath not finding swt.jar any
35c74b
  longer. See RHBZ#912664.
35c74b
35c74b
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.14-8
35c74b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
35c74b
35c74b
* Wed Nov 21 2012 Severin Gehwolf <sgehwolf@redhat.com> 1.0.14-7
35c74b
- Remove itext dependency in pom.
35c74b
35c74b
* Fri Nov 16 2012 Severin Gehwolf <sgehwolf@redhat.com> 1.0.14-6
35c74b
- Conditionally build jfreechart-swt.
35c74b
35c74b
* Mon Sep 17 2012 Severin Gehwolf <sgehwolf@redhat.com> 1.0.14-4
35c74b
- Set proper Bundle-{Version,SymbolicName,Name} in manifest.
35c74b
35c74b
* Tue Jul 24 2012 Severin Gehwolf <sgehwolf@redhat.com> 1.0.14-3
35c74b
- Add aqute bnd instructions so as to produce OSGi metadata.
35c74b
- Based on kdaniel's suggestion, use build-classpath script to find swt
35c74b
35c74b
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.14-2
35c74b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
35c74b
35c74b
* Mon Apr 23 2012 Alexander Kurtakov <akurtako@redhat.com> 1.0.14-1
35c74b
- Update to new upstream version 1.0.14.
35c74b
- Use pom.xml file from the tarball.
35c74b
35c74b
* Wed Feb 15 2012 Marek Goldmann <mgoldman@redhat.com> 1.0.13-5
35c74b
- Added Maven POM: BZ#789586
35c74b
35c74b
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.13-4
35c74b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
35c74b
35c74b
* Wed Jun 29 2011 Alexander Kurtakov <akurtako@redhat.com> 1.0.13-3
35c74b
- Adapt to current guidelines.
35c74b
35c74b
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.13-2
35c74b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
35c74b
35c74b
* Mon Apr 19 2010 Lubomir Rintel <lkundrak@v3.sk> - 1.0.13-1
35c74b
- Update to a later release
35c74b
- Cosmetic fixes
35c74b
35c74b
* Mon Apr 19 2010 Lubomir Rintel <lkundrak@v3.sk> - 1.0.10-4
35c74b
- Enable SWT support (ELMORABITY Mohamed, #583339)
35c74b
35c74b
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.10-3
35c74b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
35c74b
35c74b
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.10-2
35c74b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
35c74b
35c74b
* Sat Jul 19 2008 Lubomir Rintel (Fedora Astronomy) <lkundrak@fedoraproject.org> - 1.0.10-1
35c74b
- Initial packaging