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

#
# spec file for package jakarta-commons-compress
#
# Copyright (c) 2017 SUSE LINUX 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/
#


%define base_name commons-compress
%define svnrev 701433
Name:           jakarta-commons-compress
Version:        1.0
Release:        0
Summary:        Commons Compress
License:        Apache-2.0
Group:          Development/Libraries/Java
Url:            http://jakarta.apache.org/commons/sandbox/compress/
# svn export http://svn.apache.org/repos/asf/commons/sandbox/compress/trunk commons-compress-1.0-701433
# tar cjf commons-compress-1.0-701433.tar.bz2 commons-compress-1.0-701433
Source0:        commons-compress-1.0-%{svnrev}.tar.bz2
Source1:        pom-maven2jpp-depcat.xsl
Source2:        pom-maven2jpp-newdepmap.xsl
Source3:        pom-maven2jpp-mapdeps.xsl
Source4:        commons-compress-0.1-jpp-depmap.xml
Source5:        commons-sandbox-build-project.xml
Source6:        commons-compress-0.1-build.xml
Patch0:         commons-compress-0.1-project_xml.patch
BuildRequires:  ant >= 1.6
BuildRequires:  jakarta-commons-io
BuildRequires:  junit
BuildArch:      noarch

%description
Commons Compress is a component that contains Tar, Zip and BZip2
packages.

%package javadoc
Summary:        Javadoc for %{name}
Group:          Development/Libraries/Java

%description javadoc
Developer documentation of Commons Compress component

%prep
%setup -q -n %{base_name}-%{version}-%{svnrev}
cp -p %{SOURCE5} .
cp -p %{SOURCE6} build.xml
%patch0

%build
export CLASSPATH=$(build-classpath commons-io):`pwd`/target/classes:`pwd`/target/test-classes
export OPT_JAR_LIST=:
ant \
    -Djunit.jar=file://$(build-classpath junit) \
    -Dbuild.sysclasspath=only \
    -Dant.build.javac.source=1.6 -Dant.build.javac.target=1.6  \
    jar javadoc

%install
# jars
install -d -m 755 %{buildroot}%{_javadir}
install -m 644 target/commons-compress-0.1-dev.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
(cd %{buildroot}%{_javadir} && for jar in jakarta-*; do ln -sf ${jar} ${jar/jakarta-/}; done)
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} ${jar/-%{version}/}; done)

mkdir -p %{buildroot}%{_javadocdir}/%{name}-%{version}
cp -r target/docs/apidocs/* %{buildroot}%{_javadocdir}/%{name}-%{version}

%files
%doc LICENSE.txt
%{_javadir}/%{name}-%{version}.jar
%{_javadir}/%{name}.jar
%{_javadir}/%{base_name}-%{version}.jar
%{_javadir}/%{base_name}.jar

%files javadoc
%{_javadocdir}/%{name}-%{version}

%changelog
openSUSE Build Service is sponsored by