[httpcomponents-client] Convert patches to POM macros

Mikolaj Izdebski mizdebsk at fedoraproject.org
Fri Jul 27 06:48:02 UTC 2012


commit bb5d8f0202e014c9200df9e7a95a4f9b90060ed5
Author: Mikolaj Izdebski <mizdebsk at redhat.com>
Date:   Tue Jul 24 18:35:07 2012 +0200

    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(-)
---
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" "<packaging>bundle</packaging>" $module
+done
+
+# Make httpmime into bundle
+%pom_xpath_inject pom:build/pom:plugins "
+    <plugin>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>maven-bundle-plugin</artifactId>
+      <extensions>true</extensions>
+    </plugin>" httpmime
+
+# Make httpclient into bundle
+%pom_xpath_inject pom:reporting/pom:plugins "
+    <plugin>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>maven-bundle-plugin</artifactId>
+      <configuration>
+        <instructions>
+          <Export-Package>*</Export-Package>
+          <Private-Package></Private-Package>
+          <Import-Package>!org.apache.avalon.framework.logger,!org.apache.log,!org.apache.log4j,*</Import-Package>
+        </instructions>
+      </configuration>
+    </plugin>" httpclient
+%pom_xpath_inject pom:build/pom:plugins "
+    <plugin>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>maven-bundle-plugin</artifactId>
+      <extensions>true</extensions>
+      <configuration>
+        <instructions>
+          <Export-Package>org.apache.http.*,!org.apache.http.param</Export-Package>
+          <Private-Package></Private-Package>
+          <_nouses>true</_nouses>
+          <Import-Package>!org.apache.avalon.framework.logger,!org.apache.log,!org.apache.log4j,*</Import-Package>
+        </instructions>
+        <excludeDependencies>true</excludeDependencies>
+      </configuration>
+    </plugin>" httpclient
+
 
 %build
 mvn-rpmbuild -Dmaven.test.skip=true install javadoc:aggregate


More information about the scm-commits mailing list