Bug 47047 - Add buildroot to RPM
Summary: Add buildroot to RPM
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Optional Tasks (show other bugs)
Version: 1.8.2
Hardware: PC Linux
: P5 enhancement (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2009-04-17 18:55 UTC by Brian Chase
Modified: 2010-12-27 11:12 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Chase 2009-04-17 18:55:56 UTC
Please add --buildroot support to the optional RPM task.

--- Rpm.java    2009-02-08 13:18:36.000000000 -0500
+++ Rpm_new.java        2009-04-17 21:12:24.000000000 -0400
@@ -107,6 +107,11 @@
     private boolean quiet = false;
 
     /**
+     * The root build directory as a base location for the files to package.
+     */
+    private File buildRoot;
+    
+    /**
      * Execute the task
      *
      * @throws BuildException is there is a problem in the task execution.
@@ -125,6 +130,11 @@
 
         toExecute.createArgument().setLine(command);
 
+        if (buildRoot != null) {
+            toExecute.createArgument().setValue("--buildroot");
+            toExecute.createArgument().setValue(buildRoot.toString());
+        }
+        
         if (cleanBuildDir) {
             toExecute.createArgument().setValue("--clean");
         }
@@ -308,6 +318,14 @@
     }
 
     /**
+     * Sets the build root as the base for files included in package.
+     *
+     */
+    public void setBuildRoot(File buildRoot) {
+        this.buildRoot = buildRoot;
+    }
+    
+    /**
      * Checks whether <code>rpmbuild</code> is on the PATH and returns
      * the absolute path to it - falls back to <code>rpm</code>
      * otherwise.