File apache-commons-httpclient.spec of Package apache-commons-httpclient.16969

# spec file for package apache-commons-httpclient
# Copyright (c) 2020 SUSE LLC
# 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

%define short_name commons-httpclient
Name:           apache-commons-httpclient
Version:        3.1
Release:        0
Summary:        Feature rich package for accessing resources via HTTP
License:        Apache-2.0
Group:          Development/Libraries/Java
Patch0:         %{name}-disablecryptotests.patch
Patch1:         %{name}-addosgimanifest.patch
Patch2:         %{name}-encoding.patch
Patch3:         %{short_name}-CVE-2012-5783-2.patch
#PATCH-FIX-UPSTREAM bsc#1178171 CVE-2014-3577 MITM security vulnerability
Patch4:         apache-commons-httpclient-CVE-2014-3577.patch
#PATCH-FIX-UPSTREAM bsc#945190 CVE-2015-5262 Missing HTTPS connection timeout
Patch5:         apache-commons-httpclient-CVE-2015-5262.patch
BuildRequires:  ant
BuildRequires:  ant-junit
BuildRequires:  commons-codec
BuildRequires:  commons-logging >= 1.0.3
BuildRequires:  fdupes
BuildRequires:  java-devel >= 1.8
BuildRequires:  javapackages-local
BuildRequires:  junit
Requires:       commons-codec
Requires:       commons-logging >= 1.0.3
Provides:       %{short_name} = %{version}
Provides:       jakarta-%{short_name} = %{version}
Obsoletes:      jakarta-%{short_name} < %{version}
Provides:       jakarta-%{short_name}3 = %{version}
Obsoletes:      jakarta-%{short_name}3 < %{version}
BuildArch:      noarch

Although the  package provides basic functionality for
accessing resources via HTTP, it doesn't provide the full flexibility
or functionality needed by many applications. The Apache Commons
HttpClient component provides a package implementing the client side
of the most recent HTTP standards and recommendations.

The HttpClient component may be of interest to anyone building
HTTP-aware client applications such as web browsers, web service
clients, or systems that leverage or extend the HTTP protocol for
distributed communication.

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

%description    javadoc
Developer documentation for %{name} in JavaDoc


%package        demo
Summary:        Demonstration files for %{name}
Group:          Development/Libraries/Java
Requires:       %{name} = %{version}

%description    demo
Demonstration files for %{name}. NOTE: It is
possible that some demonstration files are specially prepared for SUN
Java runtime environment. If they fail with IBM or BEA Java, the
package itself does not need to be broken.


%package        manual
Summary:        Manual for %{name}
Group:          Development/Libraries/Java

%description    manual
Manual for %{name}


%setup -q -n %{short_name}-%{version}
mkdir lib # duh
rm -rf docs/apidocs docs/*.patch docs/*.orig docs/*.rej


pushd src/conf
sed -i 's/\r//' MANIFEST.MF

%patch3 -p1
%patch4 -p1
%patch5 -p1

# Use javax classes, not com.sun ones
# assume no filename contains spaces
pushd src
    for j in $(find . -name "*.java" -exec grep -l 'com\.sun\.net\.ssl' {} \;); do
        sed -e 's|com\.sun\.net\.ssl||' $j > tempf
        cp tempf $j
    rm tempf

sed -i 's/\r//' RELEASE_NOTES.txt
sed -i 's/\r//' README.txt
sed -i 's/\r//' LICENSE.txt

ant \ \
  -Dbuild.sysclasspath=first \{_javadocdir}/java \{_javadocdir}/apache-commons-logging \
  -Dtest.failonerror=false \
  -Dlib.dir=%{_javadir} \
  -Djavac.encoding=UTF-8 \
  dist test

# jars
mkdir -p %{buildroot}%{_javadir}
cp -p dist/%{short_name}.jar \
# compat symlink
pushd %{buildroot}%{_javadir}
ln -s %{name}.jar %{name}3.jar
ln -s %{name}.jar %{short_name}3.jar
ln -s %{name}.jar %{short_name}.jar
ln -s %{name}.jar jakarta-%{short_name}.jar
ln -s %{name}.jar jakarta-%{short_name}3.jar

# pom
mkdir -p %{buildroot}%{_mavenpomdir}
cp -p %{SOURCE1} %{buildroot}%{_mavenpomdir}/%{name}.pom
%add_maven_depmap %{name}.pom %{name}.jar -a apache:commons-httpclient

# javadoc
mkdir -p %{buildroot}%{_javadocdir}
mv dist/docs/api %{buildroot}%{_javadocdir}/%{name}
%fdupes -s %{buildroot}%{_javadocdir}/%{name}

# demo
mkdir -p %{buildroot}%{_datadir}/%{name}
cp -pr src/examples src/contrib %{buildroot}%{_datadir}/%{name}
%fdupes -s %{buildroot}%{_datadir}/%{name}

# manual and docs
rm -f dist/docs/{BUILDING,TESTING}.txt
ln -s %{_javadocdir}/%{name} dist/docs/apidocs
%fdupes -s dist/docs

%license LICENSE.txt
%if %{defined _maven_repository}

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

%files demo

%files manual
%doc dist/docs/*

openSUSE Build Service is sponsored by