File swing-worker.spec of Package swing-worker

#
# spec file for package swing-worker (Version 1.2)
#
# 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


Name:           swing-worker
Version:        1.2
Release:        3
Summary:        UI updates support for long running tasks
Group:          Development/Libraries/Java
License:        LGPL v2.1 or later
Url:            https://swingworker.dev.java.net/
Source0:        %{name}-src-%{version}.tar.bz2
Source1:        releasenotes.txt
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
BuildRequires:  java-devel
BuildRequires:  ant
Requires:       jre >= 1.5

%description
SwingWorker is designed for situations where you need to have a long
running task run in a background thread and provide updates to the UI
either when done, or while processing. This project is a backport of
SwingWorker included into Java 1.6.



%package javadoc
License:        LGPL v2.1 or later
Group:          Development/Libraries/Java
Summary:        UI updates support for long running tasks

%description		javadoc
SwingWorker is designed for situations where you need to have a long
running task run in a background thread and provide updates to the UI
either when done, or while processing. This project is a backport of
SwingWorker included into Java 1.6.



%package demo
License:        LGPL v2.1 or later
Group:          Development/Libraries/Java
Summary:        UI updates support for long running tasks
Requires:       %{name} = %{version}-%{release}

%description 		demo
SwingWorker is designed for situations where you need to have a long
running task run in a background thread and provide updates to the UI
either when done, or while processing. This project is a backport of
SwingWorker included into Java 1.6.



%prep
%setup -q -c %{name}-%{version}
# remove all third party jars
find . -iname '*.jar' | xargs rm -rf
cp %{SOURCE1} .
# wrong end of line encoding
sed -i -e 's/.$//' releasenotes.txt COPYING

%build
ant -Dant.build.javac.source=1.5 -Dant.build.javac.target=1.5 \
    bundles

%install
install -d -m 755 $RPM_BUILD_ROOT/%{_javadir}
# jars
install -pm 644 dist/bundles/%{name}.jar $RPM_BUILD_ROOT/%{_javadir}/%{name}-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir}/ && for jar in *-%{version}*; do ln -sf ${jar} ${jar/-%{version}/}; done)
# javadoc
install -d -m 755 $RPM_BUILD_ROOT/%{_javadocdir}/%{name}-%{version}
cp -pr dist/javadoc/* $RPM_BUILD_ROOT/%{_javadocdir}/%{name}-%{version}
ln -s %{name}-%{version} $RPM_BUILD_ROOT/%{_javadocdir}/%{name}
# demo
install -d $RPM_BUILD_ROOT/%{_datadir}/%{name}-%{version}
cp -pr src/demo  $RPM_BUILD_ROOT/%{_datadir}/%{name}-%{version}/

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(0644,root,root,0755)
%doc COPYING releasenotes.txt
%{_javadir}/*.jar

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

%files demo
%defattr(0644,root,root,0755)
%{_datadir}/%{name}-%{version}

%changelog
* Mon Sep 15 2008 mvyskocil@suse.cz
- -target=1.5 -source=1.5
* Thu Aug 21 2008 mvyskocil@suse.cz
- Initial packaging (version 1.2)