File java-xz.spec of Package java-xz

# spec file for package java-xz
#
# 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:		    java-xz
Version:	    1.6
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
Patch0:		    java-3d_source_version.patch
BuildRequires:	java-devel >= 1.8
BuildRequires:	ant
BuildRequires:	unzip
BuildRequires:  javapackages-tools
BuildConflicts:	java-9-openjdk-devel >= 1.9.0
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 -n xz-java
%patch0 -p1

%build
%__sed -i 's/false/true/' build.properties
%__sed -i '/debug/s/$/ target="1.8"/' build.xml
%__sed -i 's/linkoffline="[^"]*"//;/extdoc_/d' build.xml
ant -Dant.build.javac.source=1.8 -Dant.build.javac.target=1.8 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