A basic task for invoking the rpm executable to build a RedHat Package Manager Linux installation file. The task currently only works on Linux or other Unix platforms with rpm support.


Attribute Description Required
specFile The name of the spec file to be used. This must be relative to the SPECS directory under the root of the RPM set in the topDir attribute. Yes
topDir This is the directory which will have the expected subdirectories, SPECS, SOURCES, BUILD, SRPMS. If this isn't specified, the default RPM directory of the system (or user, if ~/.rpmmacros defines it) is used (often /usr/src/rpm.
Defining a topdir will set %_topdir to the specified directory—there is no need to edit your .rpmmacros file.
No, but your build file is very brittle if it is not set.
cleanBuildDir This will remove the generated files in the BUILD directory. See the the --clean option of rpmbuild. No
removeSpec This will remove the spec file from SPECS. See the the --rmspec option of rpmbuild. No
removeSource Flag to remove the sources after the build. See the --rmsource option of rpmbuild. No; default is false
rpmBuildCommand The executable to use for building the RPM. Set this if default executables are not on PATH or a different executable is needed. Since Apache Ant 1.6. No; defaults to rpmbuild if it can be found or rpm otherwise
command The command to pass to the rpmbuild program. No; default is -bb
quiet Suppress output. No; defaults to false
output/error Where standard output and error go. No
failOnError Stop the build process if the RPM build command exits with a non-zero return code. No; defaults to false


<rpm specFile="example.spec"