File jakarta-commons-launcher.spec of Package jakarta-commons-launcher
#
# spec file for package jakarta-commons-launcher
#
# Copyright (c) 2011 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-launcher
BuildRequires: ant java-devel junit xml-commons-apis
%define base_name launcher
%define short_name commons-%{base_name}
%define name jakarta-%{short_name}
%define section devel
Version: 1.1
Release: 11
Summary: A Cross-Platform Java Application Launcher
License: Apache-2.0
Group: Development/Libraries/Java
Url: http://jakarta.apache.org/commons/launcher/
Source: http://archive.apache.org/dist/jakarta/commons/launcher/source/commons-launcher-%{version}-src.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
Commons-launcher eliminates the need for a batch or shell script to
launch a Java class. Some situations where elimination of a batch or
shell script may be desirable are:
* You want to avoid having to determining where certain application
paths are, for example, your application's home directory.
Determining this dynamically in a Windows batch script is very
tricky on some versions of Windows or when softlinks are used on
Unix platforms.
* You want to avoid having to handle native file and path separators
or native path quoting issues.
* You need to enforce certain system properties, such as
java.endorsed.dirs when running with JDK 1.4.
* You want to allow users to pass custom JVM arguments or system
properties without having to parse and reorder arguments in your
script. This can be tricky or messy in batch and shell scripts.
* You want to bootstrap system properties from a configuration file
instead of hard-coding them in your batch and shell scripts.
* You want to provide localized error messages, which is very tricky to
do in batch and shell scripts.
%package javadoc
License: Apache-2.0
PreReq: coreutils
Summary: Javadoc for jakarta-commons-launcher
Group: Development/Libraries/Java
%description javadoc
Commons-launcher eliminates the need for a batch or shell script to
launch a Java class.
This package contains the javadoc documentation for the Jakarta Commons
Launcher Package.
%prep
%setup -q -n %{short_name}
%build
mkdir lib
ant \
-Dbuild.sysclasspath=only \
-Dfinal.name=%{short_name} \
-Dj2se.javadoc=%{_javadocdir}/java \
-Dsrcdir=. \
-Dant.build.javac.source=1.5 -Dant.build.javac.target=1.5 \
jar javadoc
%install
# jars
mkdir -p $RPM_BUILD_ROOT%{_javadir}
cp -p dist/bin/%{short_name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
(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}
ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} # ghost symlink
%clean
rm -rf $RPM_BUILD_ROOT
%post javadoc
rm -f %{_javadocdir}/%{name}
ln -s %{name}-%{version} %{_javadocdir}/%{name}
%files
%defattr(0644,root,root,0755)
%doc LICENSE.txt
%{_javadir}/*
%files javadoc
%defattr(0644,root,root,0755)
%doc %{_javadocdir}/%{name}-%{version}
%ghost %doc %{_javadocdir}/%{name}
%changelog