File jakarta-commons-fileupload.spec of Package jakarta-commons-fileupload.11150

#
# spec file for package jakarta-commons-fileupload
#
# 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 fileupload
%define short_name commons-%{base_name}
Name:           jakarta-commons-fileupload
Version:        1.1.1
Release:        0
Summary:        Jakarta Commons FileUpload Package
License:        Apache-2.0
Group:          Development/Libraries/Java
Url:            http://jakarta.apache.org/commons/fileupload/
Source0:        http://www.apache.org/dist/jakarta/commons/fileupload/source/commons-fileupload-1.1.1-src.tar.gz
Patch0:         %{name}-build_xml.patch
Patch1:         %{name}-%{version}-servletapi5.patch
#PATCH-FIX-UPSTREAM: bnc#846174
#DiskFileItem.java part of http://svn.apache.org/viewvc?view=revision&revision=1507048
Patch2:         jakarta-commons-fileupload-CVE-2013-2186.patch
#PATCH-FIX-UPSTREAM: bnc#862781
Patch3:         jakarta-commons-fileupload-CVE-2014-0050-DOS-buffer-overflow.patch
#PATCH-FIX-UPSTREAM: bsc#1128963 CVE-2016-1000031
Patch4:         jakarta-commons-fileupload-CVE-2016-1000031.patch
BuildRequires:  ant
BuildRequires:  ant-junit
BuildRequires:  fdupes
BuildRequires:  jakarta-commons-io
BuildRequires:  java-devel
BuildRequires:  javapackages-tools
BuildRequires:  junit >= 3.8.1
BuildRequires:  portlet-1.0-api
BuildRequires:  servletapi5
BuildRequires:  unzip
BuildRequires:  xerces-j2-xml-apis
Requires:       javapackages-tools
Requires:       servletapi5
# FIXME: correct on update of fileuploads
Provides:       %{short_name} = 1.1.2
Obsoletes:      %{short_name} <= 1.1.1
BuildArch:      noarch

%description
The javax.servlet package lacks support for RFC 1867, HTML file upload.
 This package provides a simple-to-use API for working with such data.
The scope of this package is to create a package of Java utility
classes to read multipart/form-data within a
javax.servlet.http.HttpServletRequest.

%package        javadoc
Summary:        Javadoc for jakarta-commons-fileupload
Group:          Development/Libraries/Java
Requires(pre):  coreutils

%description    javadoc
The javax.servlet package lacks support for rfc 1867, html file upload.
 This package provides a simple to use api for working with such data.
The scope of this package is to create a package of Java utility
classes to read multipart/form-data within a
javax.servlet.http.HttpServletRequest.

This package contains the javadoc documentation for the Jakarta Commons
Fileupload Package.

%prep
%setup -q -n %{short_name}-%{version}
%patch0 -b .build.xml
%patch1  -b .servletapi5
%patch2
%patch3 -p1
%patch4 -p1
# -----------------------------------------------------------------------------

%build
export CLASSPATH="$(build-classpath commons-io junit portlet-1.0-api \
    servletapi5 xerces-j2-xml-apis):${PWD}/target/classes:${PWD}/target/test-classes"
ant \
    -Dant.build.javac.source=1.6 -Dant.build.javac.target=1.6 \
    -Dbuild.sysclasspath=only \
    -Dfinal.name=%{name}-%{version} \
    -Dservletapi.javadoc=%{_javadocdir}/servletapi5 \
    dist

%install

# jars
mkdir -p %{buildroot}%{_javadir}
cp -p dist/%{name}-%{version}.jar %{buildroot}%{_javadir}
(
    cd %{buildroot}%{_javadir} && \
    for jar in *-%{version}*; do
        ln -s -f ${jar} `echo $jar | sed "s|jakarta-||g"`
    done
)
(
    cd %{buildroot}%{_javadir} && \
    for jar in *-%{version}*; do
        ln -s -f ${jar} `echo $jar | sed "s|-%{version}||g"`
    done
)
# javadoc
mkdir -p %{buildroot}%{_javadocdir}/%{name}
cp -pr dist/docs/api/* %{buildroot}%{_javadocdir}/%{name}
%fdupes -s %{buildroot}%{_javadocdir}/%{name}

%files
%license LICENSE.txt
%doc NOTICE.txt RELEASE-NOTES.txt
%{_javadir}/*

%files javadoc
%doc %{_javadocdir}/%{name}

%changelog
openSUSE Build Service is sponsored by