org.apache.tools.ant.taskdefs.optional
Class Rpm

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--org.apache.tools.ant.taskdefs.optional.Rpm

public class Rpm
extends Task

Invokes the rpm tool to build a Linux installation file.


Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
Rpm()
           
 
Method Summary
 void execute()
          Execute the task
protected  java.lang.String guessRpmBuildCommand()
          Checks whether rpmbuild is on the PATH and returns the absolute path to it - falls back to rpm otherwise.
 void setCleanBuildDir(boolean cbd)
          Flag (optional, default=false) to remove the generated files in the BUILD directory
 void setCommand(java.lang.String c)
          What command to issue to the rpm build tool; optional.
 void setError(java.io.File error)
          Optional file to save stderr to
 void setOutput(java.io.File output)
          Optional file to save stdout to.
 void setRemoveSource(boolean rs)
          Flag (optional, default=false) to remove the sources after the build.
 void setRemoveSpec(boolean rs)
          Flag (optional, default=false) to remove the spec file from SPECS
 void setRpmBuildCommand(java.lang.String c)
          The executable to run when building; optional.
 void setSpecFile(java.lang.String sf)
          The name of the spec File to use; required.
 void setTopDir(java.io.File td)
          The directory which will have the expected subdirectories, SPECS, SOURCES, BUILD, SRPMS ; optional.
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Rpm

public Rpm()
Method Detail

execute

public void execute()
             throws BuildException
Execute the task

Overrides:
execute in class Task
Throws:
BuildException - is there is a problem in the task execution.

setTopDir

public void setTopDir(java.io.File td)
The directory which will have the expected subdirectories, SPECS, SOURCES, BUILD, SRPMS ; optional. If this isn't specified, the baseDir value is used

Parameters:
td - the directory containing the normal RPM directories.

setCommand

public void setCommand(java.lang.String c)
What command to issue to the rpm build tool; optional. The default is "-bb"


setSpecFile

public void setSpecFile(java.lang.String sf)
The name of the spec File to use; required.


setCleanBuildDir

public void setCleanBuildDir(boolean cbd)
Flag (optional, default=false) to remove the generated files in the BUILD directory


setRemoveSpec

public void setRemoveSpec(boolean rs)
Flag (optional, default=false) to remove the spec file from SPECS


setRemoveSource

public void setRemoveSource(boolean rs)
Flag (optional, default=false) to remove the sources after the build. See the --rmsource option of rpmbuild.


setOutput

public void setOutput(java.io.File output)
Optional file to save stdout to.


setError

public void setError(java.io.File error)
Optional file to save stderr to


setRpmBuildCommand

public void setRpmBuildCommand(java.lang.String c)
The executable to run when building; optional. The default is rpmbuild.

Parameters:
c - the rpm build executable
Since:
Ant 1.6

guessRpmBuildCommand

protected java.lang.String guessRpmBuildCommand()
Checks whether rpmbuild is on the PATH and returns the absolute path to it - falls back to rpm otherwise.

Since:
1.6


Copyright 2000-2004 Apache Software Foundation. All Rights Reserved.