File gnu-getopt.spec of Package gnu-getopt

#
# spec file for package gnu-getopt (Version 1.0.13)
#
# Copyright (c) 2008 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:           gnu-getopt
BuildRequires:  ant java2-devel-packages xml-commons-apis
%define name		gnu-getopt
%define version		1.0.10
%define release		1jpp
%define	section		free
Version:        1.0.13
Release:        1
Summary:        Java getopt Implementation
License:        LGPL v2.1 or later
Url:            http://www.urbanophile.com/arenn/hacking/download.html
Source0:        ftp://ftp.urbanophile.com/pub/arenn/software/sources/java-getopt-%{version}.tar.bz2
Patch:          %{name}-java14compat.patch
Group:          Development/Libraries/Java
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The GNU Java getopt classes support short and long argument parsing in
a manner 100% compatible with the version of GNU getopt in glibc 2.0.6
with a mostly compatible programmer's interface as well. Note that this
is a port, not a new implementation.



%package javadoc
License:        LGPL v2.1 or later
PreReq:         coreutils
Summary:        Javadoc for gnu.getopt
Group:          Development/Libraries/Java

%description javadoc
The GNU Java getopt classes support short and long argument parsing in
a manner 100% compatible with the version of GNU getopt in glibc 2.0.6
with a mostly compatible programmer's interface as well. Note that this
is a port, not a new implementation.

This package contains the javadoc documentation for the GNU Java getopt
classes.



%prep
%setup -q -c
%patch 
# Aaron, where did you put my build script :-) ?
mv gnu/getopt/buildx.xml build.xml

%build
%ant jar javadoc

%install
# jars
%__mkdir_p %{buildroot}%{_javadir}
%__install -m 644 build/lib/gnu.getopt.jar %{buildroot}%{_javadir}/gnu.getopt-%{version}.jar
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do %__ln_s ${jar} ${jar/-%{version}/}; done)
# javadoc
%__mkdir_p %{buildroot}%{_javadocdir}/%{name}-%{version}
%__cp -a build/api/* %{buildroot}%{_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 gnu/getopt/COPYING.LIB gnu/getopt/README
%{_javadir}/*

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

%changelog
* Thu Oct 09 2008 mvyskocil@suse.cz
- update to 1.0.13:
  * added an Spanish, Polish and Italian messages
* Mon Sep 25 2006 skh@suse.de
- don't use icecream
- use source="1.4" and target="1.4" for build with java 1.5
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Wed Jul 27 2005 jsmeix@suse.de
- Adjustments in the spec file.
* Mon Jul 18 2005 jsmeix@suse.de
- Current version 1.0.10 from JPackage.org
* Fri Feb 18 2005 skh@suse.de
- update to version 1.0.10
- don't use icecream
* Thu Sep 16 2004 skh@suse.de
- Fix prerequires of javadoc subpackage
* Mon Sep 06 2004 skh@suse.de
- Fix rename error.
* Sun Sep 05 2004 skh@suse.de
- Rename to gnu-getopt to not confuse autobuild
* Thu Sep 02 2004 skh@suse.de
- Initial package created with version 1.0.9 (JPackage 1.5)
openSUSE Build Service is sponsored by