File jakarta-commons-codec.spec of Package jakarta-commons-codec

#
# spec file for package jakarta-commons-codec (Version 1.3)
#
# Copyright (c) 2009 SUSE LINUX Products 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/
#

# norootforbuild
# icecream 0


Name:           jakarta-commons-codec
BuildRequires:  ant-junit java2-devel-packages xml-commons-apis
%define base_name  codec
%define short_name commons-%{base_name}
%define name       jakarta-%{short_name}
%define version    1.3
%define release    2jpp
%define section    free
Version:        1.3
Release:        314
Summary:        Implementations of common encoders and decoders
License:        The Apache Software License
Group:          Development/Libraries/Java
Url:            http://jakarta.apache.org/commons/codec/
Source0:        http://www.apache.org/dist/jakarta/commons/codec/source/commons-codec-%{version}-src.tar.gz
Patch0:         jakarta-commons-codec-1.3-buildscript.patch
Patch1:         %{name}-java14compat.patch
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Provides:       %{short_name}
Obsoletes:      %{short_name}

%description
Commons Codec provides implementations of common encoders and decoders
such as Base64, Hex, various phonetic encodings, and URLs.



Authors:
--------
    Henri Yandell
    Tim OBrien
    Scott Sanders
    Rodney Waldhoff
    Daniel Rall
    Jon S. Stevens
    Gary D. Gregory
    David Graham
    
    Contributors
    Christopher O'Brien
    Martin Redington
    Jeffery Dever
    Steve Zimmermann
    Benjamin Walstrum
    Oleg Kalnichevski
    Dave Dribin
    Alex Karasulu
    Matthew Inger

%package        javadoc
License:        The Apache Software License
PreReq:         coreutils
Summary:        Implementations of common encoders and decoders
Group:          Development/Libraries/Java

%description    javadoc
Commons Codec provides implementations of common encoders and decoders
such as Base64, Hex, various phonetic encodings, and URLs.



Authors:
--------
    Henri Yandell
    Tim OBrien
    Scott Sanders
    Rodney Waldhoff
    Daniel Rall
    Jon S. Stevens
    Gary D. Gregory
    David Graham
    
    Contributors
    Christopher O'Brien
    Martin Redington
    Jeffery Dever
    Steve Zimmermann
    Benjamin Walstrum
    Oleg Kalnichevski
    Dave Dribin
    Alex Karasulu
    Matthew Inger

%prep
%setup -q -c
# FIXME Remove SoundexTest which is failing
# and thus preventing the build to proceed.
# This problem has been communicated upstream Bug 31096
%patch0 -p1
%patch1
# -----------------------------------------------------------------------------

%build
export CLASSPATH=$(build-classpath junit)
perl -p -i -e 's|../LICENSE|LICENSE.txt|g' build.xml
ant -Dbuild.sysclasspath=first \
  -Dconf.home=src/conf \
  -Dbuild.home=build \
  -Dsource.home=src/java \
  -Dtest.home=src/test \
  -Ddist.home=dist \
  -Dcomponent.title=%{short_name} \
  -Dcomponent.version=%{version} \
  -Dfinal.name=%{name}-%{version} \
  -Dextension.name=%{short_name} \
  test jar javadoc
# -----------------------------------------------------------------------------

%install
# jars
mkdir -p $RPM_BUILD_ROOT%{_javadir}
cp -p dist/%{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed  "s|jakarta-||g"`; done)
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed  "s|-%{version}||g"`; done)
# javadoc
mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr dist/docs/api/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
# -----------------------------------------------------------------------------

%clean
rm -rf $RPM_BUILD_ROOT
# -----------------------------------------------------------------------------

%post javadoc
rm -f %{_javadocdir}/%{name}
ln -s %{name}-%{version} %{_javadocdir}/%{name}

%postun javadoc
if [ "$1" = "0" ]; then
  rm -f %{_javadocdir}/%{name}
fi
# -----------------------------------------------------------------------------

%files
%defattr(0644,root,root,0755)
%doc LICENSE.txt RELEASE-NOTES.txt
%{_javadir}/*

%files javadoc
%defattr(0644,root,root,0755)
%{_javadocdir}/%{name}-%{version}
# -----------------------------------------------------------------------------

%changelog
* Fri Sep 22 2006 skh@suse.de
- don't use icecream
- use target="1.4" for build with java 1.5
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Mon Dec 19 2005 dbornkessel@suse.de
- Current version 1.3 from JPackage.org
openSUSE Build Service is sponsored by