# Copyright (c) 2000-2007, JPackage Project # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the # distribution. # 3. Neither the name of the JPackage Project nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # %global short_name httpclient Name: jakarta-commons-httpclient Version: 3.1 %define subrel 1 Release: %mkrel 10 Epoch: 1 Summary: Jakarta Commons HTTPClient implements the client side of HTTP standards License: ASL 2.0 and (ASL 2.0 or LGPLv2+) Source0: http://archive.apache.org/dist/httpcomponents/commons-httpclient/source/commons-httpclient-3.1-src.tar.gz Source1: http://repo.maven.apache.org/maven2/commons-httpclient/commons-httpclient/%{version}/commons-httpclient-%{version}.pom Patch0: %{name}-disablecryptotests.patch # Add OSGi MANIFEST.MF bits Patch1: %{name}-addosgimanifest.patch Patch2: %{name}-encoding.patch # CVE-2012-5783: missing connection hostname check against X.509 certificate name # https://fisheye6.atlassian.com/changelog/httpcomponents?cs=1422573 Patch3: %{name}-CVE-2012-5783.patch Patch4: %{name}-CVE-2014-3577.patch URL: http://jakarta.apache.org/commons/httpclient/ Group: Development/Java BuildArch: noarch BuildRequires: jpackage-utils >= 0:1.5 BuildRequires: ant BuildRequires: apache-commons-codec BuildRequires: apache-commons-logging >= 0:1.0.3 #BuildRequires: java-javadoc BuildRequires: apache-commons-logging-javadoc BuildRequires: junit Requires: java Requires: jpackage-utils Requires: apache-commons-logging >= 0:1.0.3 Requires: apache-commons-codec Provides: commons-httpclient = %{epoch}:%{version}-%{release} Obsoletes: commons-httpclient < %{epoch}:%{version}-%{release} Provides: jakarta-commons-httpclient3 = %{epoch}:%{version}-%{release} Obsoletes: jakarta-commons-httpclient3 < %{epoch}:%{version}-%{release} %description The Hyper-Text Transfer Protocol (HTTP) is perhaps the most significant protocol used on the Internet today. Web services, network-enabled appliances and the growth of network computing continue to expand the role of the HTTP protocol beyond user-driven web browsers, and increase the number of applications that may require HTTP support. Although the java.net package provides basic support for accessing resources via HTTP, it doesn't provide the full flexibility or functionality needed by many applications. The Jakarta Commons HTTP Client component seeks to fill this void by providing an efficient, up-to-date, and feature-rich package implementing the client side of the most recent HTTP standards and recommendations. Designed for extension while providing robust support for the base HTTP protocol, the HTTP Client 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: Javadoc for %{name} Group: Documentation Requires: jpackage-utils %description javadoc %{summary}. %package demo Summary: Demos for %{name} Group: Development/Java Requires: %{name} = %{epoch}:%{version}-%{release} %description demo %{summary}. %package manual Summary: Manual for %{name} Group: Documentation Requires: %{name}-javadoc = %{epoch}:%{version}-%{release} %description manual %{summary}. %prep %setup -q -n commons-httpclient-%{version} mkdir lib # duh rm -rf docs/apidocs docs/*.patch docs/*.orig docs/*.rej %patch0 pushd src/conf %{__sed} -i 's/\r//' MANIFEST.MF %patch1 popd %patch2 %patch3 -p2 %patch4 -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|javax.net.ssl|' $j > tempf cp tempf $j done rm tempf popd %build ant \ -Dbuild.sysclasspath=first \ -Djavadoc.j2sdk.link=%{_javadocdir}/java \ -Djavadoc.logging.link=%{_javadocdir}/jakarta-commons-logging \ -Dtest.failonerror=false \ -Dlib.dir=%{_javadir} \ -Djavac.encoding=UTF-8 \ dist test %install # jars mkdir -p $RPM_BUILD_ROOT%{_javadir} cp -p dist/commons-httpclient.jar \ $RPM_BUILD_ROOT%{_javadir}/%{name}.jar # compat symlink pushd $RPM_BUILD_ROOT%{_javadir} ln -s jakarta-commons-httpclient.jar commons-httpclient3.jar ln -s jakarta-commons-httpclient.jar commons-httpclient.jar popd # javadoc mkdir -p $RPM_BUILD_ROOT%{_javadocdir} mv dist/docs/api $RPM_BUILD_ROOT%{_javadocdir}/%{name} # demo mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name} cp -pr src/examples src/contrib $RPM_BUILD_ROOT%{_datadir}/%{name} # manual and docs rm -f dist/docs/{BUILDING,TESTING}.txt ln -s %{_javadocdir}/%{name}-%{version} dist/docs/apidocs # maven POM and depmap install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir} install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}.pom %add_maven_depmap %files %doc LICENSE NOTICE %doc README RELEASE_NOTES %{_javadir}/%{name}.jar %{_javadir}/commons-httpclient3.jar %{_javadir}/commons-httpclient.jar %{_mavenpomdir}/JPP-%{name}.pom %{_mavendepmapfragdir}/%{name} %files javadoc %doc LICENSE NOTICE %doc %{_javadocdir}/%{name} %files demo %{_datadir}/%{name} %files manual %doc dist/docs/* %changelog * Mon Aug 18 2014 luigiwalser <luigiwalser> 1:3.1-10.1.mga3 + Revision: 665212 - add patch from fedora to fix CVE-2012-6153 (aka CVE-2014-3577) * Sat Feb 02 2013 luigiwalser <luigiwalser> 1:3.1-10.mga3 + Revision: 393971 - add patch from fedora to fix CVE-2012-5783 * Sat Jan 12 2013 umeabot <umeabot> 1:3.1-9.mga3 + Revision: 354688 - Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild * Sat Dec 01 2012 dmorgan <dmorgan> 1:3.1-8.mga3 + Revision: 324539 - Add maven POM * Thu Jul 05 2012 dmorgan <dmorgan> 1:3.1-7.mga3 + Revision: 268308 - Fix character encoding - Rebuild to generate mvn() osgi() provides * Thu Apr 28 2011 dmorgan <dmorgan> 1:3.1-3.mga1 + Revision: 92530 - Rebuild after bootstrapping - imported package jakarta-commons-httpclient