File joda-time.spec of Package joda-time
#
# spec file for package joda-time
#
# Copyright (c) 2017 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/
#
%define tzversion tzdata2010h
Name: joda-time
Version: 1.6
Release: 0
Summary: Java date and time API
# FIXME: use correct group, see "https://en.opensuse.org/openSUSE:Package_group_guidelines"
License: Apache-2.0
Group: Development/Libraries
Url: http://joda-time.sourceforge.net/index.html
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}-src.tar.gz
Source1: ftp://elsie.nci.nih.gov/pub/%{tzversion}.tar.gz
Patch0: joda-time-use-system-junit.patch
Patch1: joda-time-1.6-sourcetarget.patch
BuildRequires: ant
BuildRequires: fdupes
BuildRequires: java-devel > 1.5.0
BuildRequires: javapackages-tools
BuildRequires: junit
Requires: java > 1.5.0
Requires: javapackages-tools
BuildArch: noarch
%description
Joda-Time provides a quality replacement for the Java date
and time classes. The design allows for multiple calendar
systems, while still providing a simple API. The 'default'
calendar is the ISO8601 standard which is used by XML. The
Gregorian, Julian, Buddhist, Coptic and Ethiopic systems
are also included, and we welcome further additions.
Supporting classes include time zone, duration, format
and parsing.
%package javadoc
Summary: Javadocs for %{name}
# FIXME: use correct group, see "https://en.opensuse.org/openSUSE:Package_group_guidelines"
Group: Documentation
Requires: %{name} = %{version}-%{release}
Requires: javapackages-tools
%description javadoc
This package contains the API documentation for %{name}.
%prep
%setup -q -n %{name}-%{version}-src
%patch0 -p1
%patch1 -p1
# all java binaries must be removed from the sources
find . -name '*.jar' -exec rm -f '{}' \;
find . -name '*.class' -exec rm -f '{}' \;
# prove that these binaries aren't used in building joda-time
rm -rf src/testdata/
# replace internal tzdata
rm -f src/java/org/joda/time/tz/src/*
tar -xzf %{SOURCE1} -C src/java/org/joda/time/tz/src/
%build
ant -Dcompile.source=1.6 -Dcompile.target=1.6
ant -Dcompile.source=1.6 -Dcompile.target=1.6 javadoc
%install
# jars
install -d -m 755 %{buildroot}%{_javadir}
# Don't install a versioned jar and symlink to it, instead install
# the unversioned jar as per Java Packaging Guidelines
install -m 644 build/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
# javadocs
install -p -d -m 755 %{buildroot}%{_javadocdir}/%{name}
cp -a build/docs/* %{buildroot}%{_javadocdir}/%{name}
%fdupes -s %{buildroot}%{_javadocdir}/%{name}
%files
%doc LICENSE.txt RELEASE-NOTES.txt ToDo.txt
%{_javadir}/%{name}.jar
%files javadoc
%doc %{_javadocdir}/%{name}
%changelog