File jpf.spec of Package jpf

#
# spec file for package jpf
#
# Copyright (c) 2013 Peter Conrad
#
# 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/
#

Name:		jpf
Version:	1.5.1
Release:	1
License:	LGPL-2.1
Summary:	Java Plugin Framework
Url:		http://jpf.sf.net/
Group:		Development/Libraries/Java
Source:		http://downloads.sourceforge.net/project/jpf/jpf-1.5/jpf-%{version}/jpf-src-%{version}.zip
BuildRequires:	java-devel ant unzip dos2unix
%if 0%{?fedora} > 0
BuildRequires:	java-1.5.0-gcj-devel
%endif
BuildArch:	noarch
BuildRoot:	%{_tmppath}/%{name}-%{version}-build

%description
JPF provides a runtime engine that dynamically discovers and loads "plug-ins".
A plug-in is a structured component that describes itself to JPF using a
"manifest". JPF maintains a registry of available plug-ins and the functions
they provide (via extension points and extensions).

One major goal of JPF is that the application (and its end-user) should not
pay any memory or performance penalty for plug-ins that are installed, but not
used. Plug-ins are added to the registry at application start-up or while the
application is running but they are not loaded until they are called.

%package javadoc
Summary:	API documentation of jpf
Group:		Development/Libraries/Java

%description javadoc
This package contains the API documentation of the Java Plugin Framework.

%prep
%setup -c -q
%__sed -i 's/target="1.5"//;/Class-Path/d' build.xml

%build
dos2unix changelog.txt license.txt README.txt jdocs/resources/css/base.css source/org/java/plugin/registry/xml/plugin_1_0.dtd

ant jar docs

%install
%__install -dm 755 "%{buildroot}%{_javadir}"
for i in build/lib/*.jar; do
  j="${i##*/}"
  %__install -m 0644 "$i" "%{buildroot}%{_javadir}/${j%%.jar}-%{version}.jar"
  %__ln_s "${j%%.jar}-%{version}.jar" "%{buildroot}%{_javadir}/$j"
done

%__install -dm 755 "%{buildroot}/%{_javadocdir}/%{name}-%{version}"
cp -pr build/docs "%{buildroot}/%{_javadocdir}/%{name}-%{version}/"
%__ln_s -f resources/images/favicon.ico "%{buildroot}/%{_javadocdir}/%{name}-%{version}/docs/favicon.ico"

%files
%defattr(-,root,root,-)
%doc changelog.txt license.txt README.txt
%{_javadir}/%{name}*.jar

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

%changelog
openSUSE Build Service is sponsored by