File xz-java.spec of Package xz-java

# spec file for package xz-java
#
# Copyright (c) 2013-2014 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:		xz-java
Version:	1.5
Release:	1
License:	SUSE-Public-Domain
Summary:	Pure Java implementation of XZ compression
Url:		http://tukaani.org/xz/java.html
Group:		Development/Libraries/Java
Source:		http://tukaani.org/xz/xz-java-%{version}.zip
BuildRequires:	java-devel ant unzip
%if 0%{?fedora} > 0
BuildRequires:	java-1.5.0-gcj-devel
%endif
BuildArch:	noarch
BuildRoot:	%{_tmppath}/%{name}-%{version}-build

%description
This aims to be a complete implementation of XZ data compression in pure Java.
Single-threaded streamed compression and decompression and random access
decompression have been fully implemented. Threading is planned but it is
unknown when it will be implemented.

%package javadoc
Summary:	API documentation of Java XZ compression library
Group:		Development/Libraries/Java

%description javadoc
This package contains the API documentation of xz-java.

%prep
%setup -c -q

%build
%__sed -i 's/false/true/' build.properties
%__sed -i '/debug/s/$/ target="1.4"/' build.xml
%__sed -i 's/linkoffline="[^"]*"//;/extdoc_/d' build.xml
ant clean jar doc

%install
%__install -dm 755 "%{buildroot}%{_javadir}"
%__install -m 0644 build/jar/xz.jar "%{buildroot}%{_javadir}/xz-%{version}.jar"
%__ln_s "xz-%{version}.jar" "%{buildroot}%{_javadir}/xz.jar"

%__install -dm 755 "%{buildroot}/%{_javadocdir}/%{name}-%{version}"
cp -pr build/doc/* "%{buildroot}/%{_javadocdir}/%{name}-%{version}/"

%files
%defattr(-,root,root,-)
%doc COPYING NEWS README THANKS
%{_javadir}/xz.jar
%{_javadir}/xz-%{version}.jar

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

%changelog
openSUSE Build Service is sponsored by