From bb5d8f0202e014c9200df9e7a95a4f9b90060ed5 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Tue, 24 Jul 2012 18:35:07 +0200 Subject: [PATCH] Convert patches to POM macros --- 0001-Remove-few-modules-and-deps.patch | 141 ------------------------- 0002-Make-httpmime-into-bundle.patch | 37 ------- 0003-Make-httpclient-into-bundle.patch | 97 ----------------- httpcomponents-client.spec | 65 ++++++++++-- 4 files changed, 54 insertions(+), 286 deletions(-) delete mode 100644 0001-Remove-few-modules-and-deps.patch delete mode 100644 0002-Make-httpmime-into-bundle.patch delete mode 100644 0003-Make-httpclient-into-bundle.patch diff --git a/0001-Remove-few-modules-and-deps.patch b/0001-Remove-few-modules-and-deps.patch deleted file mode 100644 index 05997eb..0000000 --- a/0001-Remove-few-modules-and-deps.patch +++ /dev/null @@ -1,141 +0,0 @@ -From 69fb282ec131437de7a4f0f3a8a38c764ddd05af Mon Sep 17 00:00:00 2001 -From: Stanislav Ochotnicky -Date: Thu, 1 Mar 2012 11:38:36 +0100 -Subject: [PATCH 1/3] Remove few modules and deps - ---- - pom.xml | 92 +------------------------------------------------------------- - 1 files changed, 2 insertions(+), 90 deletions(-) - -diff --git a/pom.xml b/pom.xml -index 25a70a2..39c4777 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -82,28 +82,11 @@ - - httpclient - httpmime -- httpclient-cache -- httpclient-osgi - - - - - -- maven-notice-plugin -- org.apache.httpcomponents -- -- -- attach-notice-license -- -- generate -- -- -- -- -- Apache HttpComponents -- -- -- - maven-jar-plugin - - -@@ -200,62 +183,6 @@ - - - -- -- com.agilejava.docbkx -- docbkx-maven-plugin -- -- -- org.docbook -- docbook-xml -- 4.4 -- runtime -- -- -- -- -- tutorial-site -- -- generate-html -- generate-pdf -- -- pre-site -- -- -- -- index.xml -- true -- true -- src/docbkx/resources/xsl/fopdf.xsl -- src/docbkx/resources/xsl/html_chunk.xsl -- css/hc-tutorial.css -- -- -- version -- ${project.version} -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - maven-resources-plugin - -@@ -277,14 +204,7 @@ - - - -- -- org.codehaus.mojo -- clirr-maven-plugin -- -- ${comparisonVersion} -- -- -- -+ - - - -@@ -305,15 +225,7 @@ - - - -- -- org.codehaus.mojo -- clirr-maven-plugin -- -- ${comparisonVersion} -- -- -- -- -+ - - - --- -1.7.7.6 - diff --git a/0002-Make-httpmime-into-bundle.patch b/0002-Make-httpmime-into-bundle.patch deleted file mode 100644 index d982f06..0000000 --- a/0002-Make-httpmime-into-bundle.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 9e38a0ea7c90f6ae416c790c3a03addef3ff66d2 Mon Sep 17 00:00:00 2001 -From: Stanislav Ochotnicky -Date: Thu, 1 Mar 2012 11:39:17 +0100 -Subject: [PATCH 2/3] Make httpmime into bundle - ---- - httpmime/pom.xml | 7 ++++++- - 1 files changed, 6 insertions(+), 1 deletions(-) - -diff --git a/httpmime/pom.xml b/httpmime/pom.xml -index a5e0179..43b5275 100644 ---- a/httpmime/pom.xml -+++ b/httpmime/pom.xml -@@ -38,7 +38,7 @@ - HttpComponents HttpClient - MIME coded entities - - http://hc.apache.org/httpcomponents-client -- jar -+ bundle - - - -@@ -112,6 +112,11 @@ - - - -+ -+ org.apache.felix -+ maven-bundle-plugin -+ true -+ - - - --- -1.7.7.6 - diff --git a/0003-Make-httpclient-into-bundle.patch b/0003-Make-httpclient-into-bundle.patch deleted file mode 100644 index 1ab0f73..0000000 --- a/0003-Make-httpclient-into-bundle.patch +++ /dev/null @@ -1,97 +0,0 @@ -From ff696dac1e539854085b48c51d9d315ab94e469c Mon Sep 17 00:00:00 2001 -From: Stanislav Ochotnicky -Date: Thu, 1 Mar 2012 11:39:52 +0100 -Subject: [PATCH 3/3] Make httpclient into bundle - -Also remove few build deps we don't have ---- - httpclient/pom.xml | 47 +++++++++++++++++++---------------------------- - 1 files changed, 19 insertions(+), 28 deletions(-) - -diff --git a/httpclient/pom.xml b/httpclient/pom.xml -index 0e391f6..f0c6632 100644 ---- a/httpclient/pom.xml -+++ b/httpclient/pom.xml -@@ -38,7 +38,7 @@ - HttpComponents Client (base module) - - http://hc.apache.org/httpcomponents-client -- jar -+ bundle - - - -@@ -65,12 +65,6 @@ - ${junit.version} - test - -- -- org.mockito -- mockito-core -- ${mockito.version} -- test -- - - - -@@ -116,25 +110,21 @@ - - - -- -- com.atlassian.maven.plugins -- maven-clover2-plugin -+ -+ org.apache.felix -+ maven-bundle-plugin -+ true - -- threaded -- 100 -- 50% -+ -+ org.apache.http.*,!org.apache.http.param -+ -+ <_nouses>true -+ !org.apache.avalon.framework.logger,!org.apache.log,!org.apache.log4j,* -+ -+ true - -- -- -- site -- pre-site -- -- instrument -- -- -- -- -- -+ -+ - - - -@@ -161,11 +149,14 @@ - - - -- com.atlassian.maven.plugins -- maven-clover2-plugin -- ${clover.version} -+ org.apache.felix -+ maven-bundle-plugin - -- 1.5 -+ -+ * -+ -+ !org.apache.avalon.framework.logger,!org.apache.log,!org.apache.log4j,* -+ - - - --- -1.7.7.6 - diff --git a/httpcomponents-client.spec b/httpcomponents-client.spec index 0c82c8d..3e27963 100644 --- a/httpcomponents-client.spec +++ b/httpcomponents-client.spec @@ -8,14 +8,6 @@ Group: Development/Libraries License: ASL 2.0 URL: http://hc.apache.org/ Source0: http://www.apache.org/dist/httpcomponents/httpclient/source/httpcomponents-client-%{version}-src.tar.gz -# Remove optional build deps not available in Fedora -# and add proper Apache felix bundle plugin instructions -# so that we get a reasonable OSGi manifest. -Patch0: 0001-Remove-few-modules-and-deps.patch -Patch1: 0002-Make-httpmime-into-bundle.patch -Patch2: 0003-Make-httpclient-into-bundle.patch - - BuildArch: noarch @@ -49,9 +41,60 @@ API docs for %{name}. %prep %setup -q -%patch0 -p1 -b .sav -%patch1 -p1 -b .sav -%patch2 -p1 -b .sav + +# Remove optional build deps not available in Fedora +%pom_disable_module httpclient-cache +%pom_disable_module httpclient-osgi +%pom_remove_dep :mockito-core httpclient +%pom_remove_plugin :maven-notice-plugin +%pom_remove_plugin :docbkx-maven-plugin +%pom_remove_plugin :clirr-maven-plugin +%pom_remove_plugin :maven-clover2-plugin httpclient + +# Add proper Apache felix bundle plugin instructions +# so that we get a reasonable OSGi manifest. +for module in httpclient httpclient; do + %pom_xpath_remove "pom:project/pom:packaging" $module + %pom_xpath_inject "pom:project" "bundle" $module +done + +# Make httpmime into bundle +%pom_xpath_inject pom:build/pom:plugins " + + org.apache.felix + maven-bundle-plugin + true + " httpmime + +# Make httpclient into bundle +%pom_xpath_inject pom:reporting/pom:plugins " + + org.apache.felix + maven-bundle-plugin + + + * + + !org.apache.avalon.framework.logger,!org.apache.log,!org.apache.log4j,* + + + " httpclient +%pom_xpath_inject pom:build/pom:plugins " + + org.apache.felix + maven-bundle-plugin + true + + + org.apache.http.*,!org.apache.http.param + + <_nouses>true + !org.apache.avalon.framework.logger,!org.apache.log,!org.apache.log4j,* + + true + + " httpclient + %build mvn-rpmbuild -Dmaven.test.skip=true install javadoc:aggregate