Subject: [bug#30845] [PATCH 06/82] gnu: Add java-commons-httpclient.

From: Julien Lepiller <[email-masked]>
Date: Sun, 18 Mar 2018 14:05:26 +0100

* gnu/packages/java.scm (java-commons-httpclient): New variable.
---
 gnu/packages/java.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 9f5b234bb..b8fd30ea5 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -9430,3 +9430,47 @@ Java programmers to create two-dimensional charts and plots.  The library
 features an assortment of graph styles, including advanced scatter plots, bar
 graphs, and pie charts.")
     (license license:lgpl2.1+)))
+
+(define-public java-commons-httpclient
+  (package
+    (name "java-commons-httpclient")
+    (version "3.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://archive.apache.org/dist/httpcomponents/"
+                                  "commons-httpclient/source/commons-httpclient-"
+                                  version "-src.tar.gz"))
+              (sha256
+               (base32
+                "1wlpn3cfy3d4inxy6g7wxcsa8p7sshn6aldk9y4ia3lb879rd97r"))))
+    (build-system ant-build-system)
+    (arguments
+     `(#:build-target "compile"
+       #:test-target "test"
+       #:tests? #f; requires junit-textui (junit 3)
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'fix-accent
+           (lambda _
+             (for-each (lambda (file)
+                         (with-fluids ((%default-port-encoding "ISO-8859-1"))
+                          (substitute* file
+                            (("\\* @author Ortwin .*") "* @author Ortwin Gluck\n"))))
+               '("src/java/org/apache/commons/httpclient/HttpContentTooLargeException.java"
+                 "src/examples/TrivialApp.java" "src/examples/ClientApp.java"
+                 "src/test/org/apache/commons/httpclient/TestHttps.java"
+                 "src/test/org/apache/commons/httpclient/TestURIUtil2.java"))))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (zero? (system* "ant" "dist"
+                             (string-append "-Ddist.home=" (assoc-ref outputs "out")
+                                            "/share/java"))))))))
+    (propagated-inputs
+     `(("java-commons-logging" ,java-commons-logging-minimal)
+       ("java-commons-codec" ,java-commons-codec)))
+    (home-page "https://hc.apache.org")
+    (synopsis "HTTP/1.1 compliant HTTP agent implementation")
+    (description "This package contains an HTTP/1.1 compliant HTTP agent
+implementation.  It also provides reusable components for client-side
+authentication, HTTP state management, and HTTP connection management.")
+    (license license:asl2.0)))
-- 
2.16.1