Blob Blame Raw
%global tzversion tzdata2010l

Name:             joda-time
Version:          1.6.2
Release:          1.%{tzversion}%{?dist}
Summary:          Java date and time API

Group:            Development/Libraries
License:          ASL 2.0
URL:              http://joda-time.sourceforge.net
Source0:          http://downloads.sourceforge.net/%{name}/%{name}-%{version}-src.tar.gz
Source1:          ftp://elsie.nci.nih.gov/pub/%{tzversion}.tar.gz
# Remove maven toolchanins from pom.xml (not present in fedora yet)
Patch0:           joda-time-remove-toolchains-from-pom.patch
BuildRoot:        %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:        noarch

BuildRequires:    java-devel >= 1:1.6.0
BuildRequires:    jpackage-utils
BuildRequires:    maven2 >= 2.2.1
BuildRequires:    maven-clean-plugin
BuildRequires:    maven-compiler-plugin
#BuildRequires:    maven-toolchains-plugin
BuildRequires:    maven-antrun-plugin
BuildRequires:    maven-repository-plugin
BuildRequires:    maven-resources-plugin
BuildRequires:    maven-assembly-plugin
BuildRequires:    maven-surefire-maven-plugin
BuildRequires:    maven-jar-plugin
BuildRequires:    maven-javadoc-plugin
BuildRequires:    maven-install-plugin
BuildRequires:    maven-source-plugin
BuildRequires:    maven-site-plugin

Requires:         java >= 1:1.6.0
Requires:         jpackage-utils

Requires(post):   jpackage-utils
Requires(postun): jpackage-utils


%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, Ethiopic and Islamic systems are also 
included, and we welcome further additions. Supporting classes include time 
zone, duration, format and parsing. 


%package javadoc
Summary:          Javadoc for %{name}
Group:            Documentation
Requires:         jpackage-utils


%description javadoc
This package contains the API documentation for %{name}.


%prep
%setup -q -n %{name}-%{version}-src
sed -i 's/\r//' LICENSE.txt
sed -i 's/\r//' RELEASE-NOTES.txt
sed -i 's/\r//' ToDo.txt
%patch0 -p0

# all java binaries must be removed from the sources
find . -name '*.jar' -exec rm -f '{}' \;
find . -name '*.class' -exec rm -f '{}' \;

# replace internal tzdata
rm -f src/main/java/org/joda/time/tz/src/*
tar -xzf %{SOURCE1} -C src/main/java/org/joda/time/tz/src/


%build
export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
mvn-jpp \
        -e \
        -Dmaven2.jpp.mode=true \
        -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
        install javadoc:javadoc


%install
rm -rf %{buildroot}

# jars
install -d -m 0755 %{buildroot}%{_javadir}
install -pm 644 target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
ln -s %{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar

# pom
install -d -m 755 %{buildroot}%{_mavenpomdir}
install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
%add_to_maven_depmap %{name} %{name} %{version} JPP %{name}

# javadoc
install -d -m 0755 %{buildroot}%{_javadocdir}/%{name}-%{version}
cp -pr target/site/api*/* %{buildroot}%{_javadocdir}/%{name}-%{version}/
ln -s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name}

%post
%update_maven_depmap

%postun
%update_maven_depmap

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc LICENSE.txt RELEASE-NOTES.txt ToDo.txt
%{_javadir}/*
%{_mavenpomdir}/*
%{_mavendepmapfragdir}/*

%files javadoc
%defattr(-,root,root,-)
%doc LICENSE.txt
%{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}



%changelog
* Thu Sep 23 2010 Chris Spike <chris.spike@arcor.de> 1.6.2-1.tzdata2010l
- New upstream version (1.6.2)
- Removed dependency on main package for -javadoc subpackage
- Replaced summary with latest version
- Switched from ant to maven (no build.xml any more)
- Added patch to remove maven toolchain from pom.xml

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6-3.tzdata2008i
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6-2.tzdata2008i
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Fri Dec 12 2008 Conrad Meyer <konrad@tylerc.org> - 1.6-1.tzdata2008i
- New upstream version (1.6).

* Fri Oct 31 2008 Conrad Meyer <konrad@tylerc.org> - 1.5.2-10.tzdata2008i
- New tzdata.

* Mon Oct 13 2008 Conrad Meyer <konrad@tylerc.org> - 1.5.2-7.tzdata2008g
- New tzdata (2008g).

* Sat Aug 23 2008 Conrad Meyer <konrad@tylerc.org> - 1.5.2-7.tzdata2008e
- New version with new tzdata (2008e).

* Sat Jul 19 2008 Conrad Meyer <konrad@tylerc.org> - 1.5.2-7.tzdata2008d
- New version with new tzdata (2008d).

* Mon Jun 9 2008 Conrad Meyer <konrad@tylerc.org> - 1.5.2-6.tzdata2008c
- New version with new tzdata (2008c).

* Sun Apr 6 2008 Conrad Meyer <konrad@tylerc.org> - 1.5.2-5.tzdata2008b
- Don't compile GCJ bits yet as we hit some GCJ bug.

* Sat Apr 5 2008 Conrad Meyer <konrad@tylerc.org> - 1.5.2-4.tzdata2008b
- Update to tzdata2008b.
- Use unversioned jar.
- Some small things to comply with Java Packaging Guidelines.
- GCJ support.

* Mon Mar 17 2008 Conrad Meyer <konrad@tylerc.org> - 1.5.2-3.tzdata2008a
- Many small changes from bz# 436239 comment 6.
- Change -javadocs to -javadoc in accordance with java packaging
  guidelines draft.

* Sun Mar 16 2008 Conrad Meyer <konrad@tylerc.org> - 1.5.2-2
- Use system junit via Mamoru Tasaka's patch.

* Mon Mar 3 2008 Conrad Meyer <konrad@tylerc.org> - 1.5.2-1
- Initial package.