File apache-commons-compress.spec of Package apache-commons-compress

#
# spec file for package apache-commons-compress
#
# 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:		apache-commons-compress
Version:	1.8
Release:	1
License:	Apache-2.0
Summary:	Java API for handling various compression formats
Url:		http://commons.apache.org/proper/commons-compress/
Group:		Development/Libraries/Java
Source:		http://apache.mirror.digionline.de//commons/compress/source/commons-compress-%{version}-src.tar.gz
BuildRequires:	java-devel ant xz-java
%if 0%{?fedora} > 0
BuildRequires:  java-1.5.0-gcj-devel
%endif
Requires:	xz-java
BuildArch:	noarch
BuildRoot:	%{_tmppath}/%{name}-%{version}-build

%description
The Apache Commons Compress library defines an API for working with ar, cpio,
Unix dump, tar, zip, gzip, XZ, Pack200 and bzip2 files.

The compress component is split into compressors and archivers. While
compressors (un)compress streams that usually store a single entry, archivers
deal with archives that contain structured content represented by ArchiveEntry
instances which in turn usually correspond to single files or directories.

Currently the bzip2, Pack200, XZ and gzip formats are supported as compressors
where gzip support is mostly provided by the java.util.zip package and Pack200
support by the java.util.jar package of the Java class library. XZ support is
provided by the public domain XZ for Java library.

The ar, cpio, dump, tar and zip formats are supported as archivers where the
zip implementation provides capabilities that go beyond the features found in
java.util.zip. As of Commons Compress 1.3 support for the dump format is
read-only.

The compress component provides abstract base classes for compressors and
archivers together with factories that can be used to choose implementations
by algorithm name. In the case of input streams the factories can also be used
to guess the format and provide the matching implementation.

%package javadoc
Summary:	API doc for apache-commons-compress
Group:		Development/Libraries/Java

%description javadoc
This package contains the API documentation of the apache-commons-compress
library.

%prep
%setup -q -n commons-compress-%{version}-src

%build
%__mkdir_p build/classes
find src/main/java -name \*.java | \
 xargs javac -d build/classes -cp "%{_javadir}/xz.jar" -source 1.5 -target 1.5 -g
jar cf build/%{name}-%{version}.jar -C build/classes .

%__mkdir_p build/doc
%__sed -i '/^ *\*/s/<ar/\&lt;ar/' src/main/java/org/apache/commons/compress/archivers/ar/Ar*
javadoc -d build/doc -sourcepath src/main/java -classpath "build/classes:%{_javadir}/xz.jar" `find src/main/java -name \*.java`

%install
%__install -dm 0755 "%{buildroot}%{_javadir}"
%__install -m 0644 "build/%{name}-%{version}.jar" "%{buildroot}%{_javadir}"
%__ln_s "%{name}-%{version}.jar" "%{buildroot}%{_javadir}/commons-compress.jar"

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

%files
%defattr(-,root,root,-)
%doc LICENSE.txt README.txt RELEASE-NOTES.txt
%{_javadir}/%{name}-%{version}.jar
%{_javadir}/commons-compress.jar

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

%changelog
openSUSE Build Service is sponsored by