%global reltag -3 %global tagversion %{version}%{?reltag} Name: HTTPClient Version: 0.3 Release: 1%{?dist} Summary: A complete HTTP client library Group: Development/Libraries License: LGPLv2+ URL: http://www.innovation.ch/java/HTTPClient/ Source0: http://www.innovation.ch/java/%{name}/%{name}.tar.gz Source1: http://repo1.maven.org/maven2/%{name}/%{name}/%{tagversion}/%{name}-%{tagversion}.pom Patch0: %{name}-%{tagversion}-enum.patch Patch1: %{name}-%{tagversion}-updatefsfaddress.patch BuildRequires: java-devel BuildRequires: jpackage-utils BuildRequires: ant Requires: java Requires: jpackage-utils BuildArch: noarch %description This package provides a complete HTTP client library. It currently implements most of the relevant parts of the HTTP/1.0 and HTTP/1.1 protocols, including the request methods HEAD, GET, POST and PUT, and automatic handling of authorization, redirection requests, and cookies. Furthermore the included Codecs class contains coders and decoders for the base64, quoted-printable, URL-encoding, chunked and the multipart/form-data encodings. %package javadoc Group: Documentation Summary: Javadoc for %{name} Requires: jpackage-utils %description javadoc This package contains javadoc for %{name}. %prep %setup -q -n %{name} find . -name "*.jar" -delete find . -name "*.class" -delete %patch0 -p1 %patch1 -p1 for p in 0COPYRIGHT 0README;do iconv -f iso8859-1 -t utf-8 ${p} > ${p}.conv && mv -f ${p}.conv ${p} sed -i 's/\r//' ${p} done for s in $(find . -name "*.java");do native2ascii -encoding UTF8 ${s} ${s} done cp -p doc/build_1.xml build.xml rm -rf doc/* # fix incomplete build directory mkdir -p build/src/HTTPClient mv *.java build/src/HTTPClient mv http build/src/HTTPClient mv https build/src/HTTPClient mv shttp build/src/HTTPClient %build ant jars javadocs %install mkdir -p %{buildroot}%{_javadir} install -m 644 build/httpclient.jar %{buildroot}%{_javadir}/%{name}.jar mkdir -p %{buildroot}%{_mavenpomdir} install -pm 644 %{SOURCE1} %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom %add_maven_depmap JPP-%{name}.pom %{name}.jar mkdir -p %{buildroot}%{_javadocdir}/%{name} cp -rp build/javadocs/* %{buildroot}%{_javadocdir}/%{name} %files %{_javadir}/%{name}.jar %{_mavenpomdir}/JPP-%{name}.pom %{_mavendepmapfragdir}/%{name} %doc 0COPYRIGHT 0LICENSE 0README %files javadoc %{_javadocdir}/%{name} %doc 0COPYRIGHT 0LICENSE %changelog * Sat Dec 08 2012 gil cattaneo 0.3-1 - initial rpm