packages java-gnu-getopt.spec
      Pages: < 1 >  DOWNLOAD      
%define        repodir    %{_javadir}/repository.jboss.com/gnu-getopt/%{version}-brew
%define        repodirlib %{repodir}/lib
%define        repodirsrc %{repodir}/src
Name:          java-gnu-getopt
Version:       1.0.13
Release:       2mamba
Summary:       Java getopt implementation
Group:         Development/Libraries/Java
Vendor:        openmamba
Distribution:  openmamba
Packager:      gil <puntogil@...>
URL:           http://www.urbanophile.com/arenn/hacking/download.html
Source0:       ftp://ftp.urbanophile.com/pub/arenn/software/sources/java-getopt-%{version}.tar.gz
Source1:       java-gnu-getopt-%{version}.pom
Source2:       java-component-info3.xml
License:       LGPL
BuildRequires: apache-ant
BuildRequires: java-gcj-compat
BuildRequires: jpackage-utils
Requires:      jpackage-utils
BuildRoot:     %{_tmppath}/%{name}-%{version}-root

%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. I am currently unaware of any bugs
in this software, but there certainly could be some lying about. I would
appreciate bug reports as well as hearing about positive experiences.

%package javadoc
Group:		Documentation
Summary:	Javadoc for %{name}

%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. I am currently unaware of any bugs
in this software, but there certainly could be some lying about. I would
appreciate bug reports as well as hearing about positive experiences.

This package contains Javadoc for %{name}.

%package repolib
Group:         Development/Libraries/Java
Summary:       Artifacts to be uploaded to a repository library

%description repolib
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. I am currently unaware of any bugs
in this software, but there certainly could be some lying about. I would
appreciate bug reports as well as hearing about positive experiences.

This package contains artifacts to be uploaded to a repository library.
This package is not meant to be installed but so its contents
can be extracted through rpm2cpio

%package gcj
Summary:       GCJ %{name} support
Group:         System/Libraries/Java
BuildRequires: java-gcj-compat
BuildRequires: libgcj4-devel
Requires:      %{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires:      java-gcj-compat
Requires:      jpackage-utils

%description gcj
dom4j is a simple and flexible open source library for working with XML,

This package contains GCJ %{name} support.

%prep

%setup -q -c

mv gnu/getopt/buildx.xml build.xml

%build

export JAVA_HOME=%java_home
ant jar javadoc

%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"

mkdir -p %{buildroot}%{_javadir}
mkdir -p %{buildroot}%{_mavenpomdir}

install -pm 644 build/lib/gnu.getopt.jar \
  %{buildroot}%{_javadir}/gnu-getopt-%{version}.jar

%add_to_maven_depmap gnu-getopt getopt %{version} JPP gnu-getopt
%add_to_maven_depmap urbanophile java-getopt %{version} JPP gnu-getopt
install -pm 644 %{SOURCE1} %{buildroot}%{_mavenpomdir}/JPP-gnu-getopt.pom

(
  cd %{buildroot}%{_javadir}
  for jar in *-%{version}.jar; do
    ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`
  done
  ln -s gnu-getopt.jar gnu.getopt.jar
)

mkdir -p %{buildroot}%{_javadocdir}/gnu-getopt-%{version}
cp -pr build/api/* %{buildroot}%{_javadocdir}/gnu-getopt-%{version}

mkdir -p %{buildroot}%{repodir}
mkdir -p %{buildroot}%{repodirlib}
install -pm 644 %{SOURCE2} %{buildroot}%{repodir}/component-info.xml
sed -i "s/@NAME@/gnu-getopt-component-info/g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@ID@/gnu-getopt/g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@LICENSE@/%{license}/g" %{buildroot}%{repodir}/component-info.xml
sed -i 's/@VERSION@/%{version}-brew/g' %{buildroot}%{repodir}/component-info.xml
sed -i "s|@PROJECTHOME@|%{url}|g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@DESCRIPTION@/Java getopt classes for short and long argument parsing/g" %{buildroot}%{repodir}/component-info.xml
tag=`echo gnu-getopt-%{version}-%{release} | sed 's|\.|_|g'`
sed -i "s/@TAG@/$tag/g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@ARTIFACTID@/getopt.jar/g" %{buildroot}%{repodir}/component-info.xml
sed -i "s/@INCLUDEINPUT@/getopt.jar/g" %{buildroot}%{repodir}/component-info.xml
mkdir -p %{buildroot}%{repodirsrc}
install -pm 644 %{SOURCE0} %{buildroot}%{repodirsrc}
cp -p %{buildroot}%{_javadir}/gnu-getopt-%{version}.jar %{buildroot}%{repodirlib}/getopt.jar


%{_bindir}/aot-compile-rpm

%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"

%post
%update_maven_depmap

%postun
%update_maven_depmap

%files
%defattr(-,root,root)
%{_javadir}/gnu-getopt-%{version}.jar
%{_javadir}/gnu-getopt.jar
%{_javadir}/gnu.getopt.jar
%{_mavenpomdir}
%{_mavendepmapfragdir}
%doc gnu/getopt/COPYING.LIB gnu/getopt/README

%files javadoc
%defattr(-,root,root)
%{_javadocdir}/gnu-getopt-%{version}

%files repolib
%defattr(-,root,root)
%{repodir}

%post gcj
/sbin/ldconfig
if [ -x %{_bindir}/rebuild-gcj-db ]; then
   %{_bindir}/rebuild-gcj-db
fi

%postun gcj
/sbin/ldconfig
if [ -x %{_bindir}/rebuild-gcj-db ]; then
   %{_bindir}/rebuild-gcj-db
fi

%files gcj
%defattr(-,root,root)
%{_libdir}/gcj/java-gnu-getopt/gnu-getopt-%{version}.jar.db
%{_libdir}/gcj/java-gnu-getopt/gnu-getopt-%{version}.jar.so

%changelog
* Sat Mar 12 2011 gil <puntogil@...> 1.0.13-2mamba
- rebuilt with java-gcj-compat support

* Sun Jun 14 2009 gil <puntogil@...> 1.0.12-1mamba
- update to 1.0.13

* Sat Jan 16 2010 gil <puntogil@...> 1.0.12-2mamba
- added maven 2 pom
- added new sun package repolib

* Sun Mar 01 2009 gil <puntogil@...> 1.0.12-1mamba
- package created by autospec