[httpcomponents-core] Convert patches to POM macros

Mikolaj Izdebski mizdebsk at fedoraproject.org
Mon Jul 23 10:53:02 UTC 2012


commit c71400709a569d3ce56927a4ac9f7b38e2c1884e
Author: Mikolaj Izdebski <mizdebsk at redhat.com>
Date:   Tue Jul 17 13:44:16 2012 +0200

    Convert patches to POM macros

 0001-Remove-unneeded-pom-dependencies.patch |  180 ---------------------------
 0002-Osgify-modules.patch                   |   84 -------------
 httpcomponents-core.spec                    |   26 ++++-
 3 files changed, 22 insertions(+), 268 deletions(-)
---
diff --git a/httpcomponents-core.spec b/httpcomponents-core.spec
index 331c55f..2979a16 100644
--- a/httpcomponents-core.spec
+++ b/httpcomponents-core.spec
@@ -8,8 +8,6 @@ Group:             Development/Libraries
 License:           ASL 2.0
 URL:               http://hc.apache.org/
 Source0:           http://www.apache.org/dist/httpcomponents/httpcore/source/httpcomponents-core-%{version}-src.tar.gz
-Patch0:            0001-Remove-unneeded-pom-dependencies.patch
-Patch1:            0002-Osgify-modules.patch
 BuildArch:         noarch
 
 BuildRequires:     httpcomponents-project
@@ -44,8 +42,28 @@ Requires:       jpackage-utils
 
 %prep
 %setup -q
-%patch0 -p1
-%patch1 -p1
+
+%pom_remove_plugin :maven-clover2-plugin httpcore-nio
+%pom_remove_plugin :maven-clover2-plugin httpcore
+%pom_remove_plugin :maven-notice-plugin
+%pom_remove_plugin :docbkx-maven-plugin
+
+# OSGify modules
+for module in httpcore httpcore-nio; do
+    %pom_xpath_remove "pom:project/pom:packaging" $module
+    %pom_xpath_inject "pom:project" "<packaging>bundle</packaging>" $module
+    %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>*</Export-Package>
+            </instructions>
+          </configuration>
+        </plugin>" $module
+done
 
 %build
 mvn-rpmbuild install javadoc:aggregate


More information about the scm-commits mailing list