File swing-layout.spec of Package swing-layout

# Copyright (c) 2006-2007 oc2pus
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments to toni@links2linux.de
# or pascal.bleser@opensuse.org

# norootforbuild

Name:		swing-layout
Summary:	Natural layout for Swing panels 
Group:		Development/Libraries/Java
URL:		https://swing-layout.dev.java.net/
Version:	1.0.3
Release:	0
License:	LGPL
BuildRequires:	ant
BuildRequires:	java-devel >= 1.5
BuildRequires:	jpackage-utils >= 1.5
BuildRequires:	update-alternatives
BuildRequires:	unzip
BuildRequires:	xml-commons-apis
BuildRequires:	xml-commons-resolver
Requires:	java >= 1.5
BuildArch:	noarch
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot
Source:		https://swing-layout.dev.java.net/files/documents/2752/70793/swing-layout-%{version}-src.zip

%description
Swing Layout Extensions goal is to make it easy to create professional
cross platform layouts with Swing. This project has an eye towards
the needs of GUI builders, such as NetBeans. This project consists
of the following pieces:
* Ability to get the baseline for components.
* Ability to get the preferred gap between components.

A new LayoutManager that utilizes both of these concepts and is
tuned toward a free-form drag and drop layout model as can be
provided by GUI builders.

%package javadoc
Summary:	Javadoc documentation for Swing-Layout
Group:		Documentation/HTML

%description javadoc
This package contains the Javadoc documentation for Swing Layout.

%prep
%setup -q -n %{name}-%{version}

%__sed -ri 's/\r//g' releaseNotes.txt COPYING
%__chmod 0644 releaseNotes.txt COPYING

%build
unset CLASSPATH
export CLASSPATH=%{java_home}/jre/lib/rt.jar
%ant jar javadoc

%install
# jars
%__install -dm 755 %{buildroot}%{_javadir}
%__install -m 644 dist/%{name}.jar \
	%{buildroot}%{_javadir}/%{name}-%{version}.jar
pushd %{buildroot}%{_javadir}
	for jar in *-%{version}*; do
		v=%{version}
		%__ln_s "${jar}" "$(echo ${jar} | %__sed 's|-%{version}||g')"
	done
popd

# javadoc
%__install -dm 755 %{buildroot}%{_javadocdir}/%{name}-%{version}
%__cp -pr dist/javadoc/* \
	%{buildroot}%{_javadocdir}/%{name}-%{version}
%__ln_s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name} # ghost symlink

%clean
[ -d %{buildroot} -a "%{buildroot}" != "" ] && %__rm -rf "%{buildroot}"

%post javadoc
%__rm -f "%{_javadocdir}/%{name}"
%__ln_s "%{name}-%{version}" "%{_javadocdir}/%{name}"

%files
%defattr(-,root,root)
%doc releaseNotes.txt COPYING
%{_javadir}/%{name}*.jar

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

%changelog
* Sun Jul  6 2008 Pascal Bleser <guru@unixtech.be> 1.0.3
- use tr instead of dos2unix
- use fully qualified URL to sources
- copied to openSUSE Build Service

* Mon Oct 08 2007 Toni Graffy <toni@links2linux.de> - 1.0.3-0.pm.1
- update to 1.0.3
* Fri Aug 31 2007 Toni Graffy <toni@links2linux.de> - 1.0.2-0.pm.2
- build openSUSE-10.3, corrected BuildRequires
* Wed Feb 07 2007 Toni Graffy <toni@links2linux.de> - 1.0.2-0.pm.1
- update to 1.0.2
* Fri Dec 01 2006 Toni Graffy <toni@links2linux.de> - 1.0.1-0.pm.1
- initial build for packman 1.0.1
openSUSE Build Service is sponsored by