From f2e7f834fa6a9283dbcf2cc02a64ebc0ef1f59b5 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Wed, 23 May 2007 13:42:50 +0000 Subject: [PATCH] Let's make the rpm documentation more complete, shall we? git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@540954 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/OptionalTasks/rpm.html | 36 +++++++++++++------ .../tools/ant/taskdefs/optional/Rpm.java | 2 +- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/docs/manual/OptionalTasks/rpm.html b/docs/manual/OptionalTasks/rpm.html index 7344c4fa6..b213e0602 100644 --- a/docs/manual/OptionalTasks/rpm.html +++ b/docs/manual/OptionalTasks/rpm.html @@ -27,9 +27,8 @@

Rpm

Description

- A basic task for invoking the rpm executable to build a Linux installation - file. The task currently only works on Linux or other Unix platforms - with rpm support. + 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.

Parameters

@@ -41,7 +40,8 @@ specFile - The name of the spec file to be used. + 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 @@ -49,26 +49,33 @@ This is the directory which will have the expected subdirectories, SPECS, SOURCES, BUILD, SRPMS. If this isn't specified, - the baseDir value is used + 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 + No, but your build file is very brittle if it is not set. cleanBuildDir This will remove the generated files in the BUILD -directory. + directory. + See the the --clean option of rpmbuild. + No removeSpec - This will remove the spec file from SPECS + This will remove the spec file from SPECS. + See the the --rmspec option of rpmbuild. + No removeSource Flag (optional, default=false) to remove the sources after the build. - See the the --rmsource option of rpmbuild. + See the the --rmsource option of rpmbuild. No @@ -82,7 +89,7 @@ directory. command - Very similar idea to the cvs task. the default is "-bb" + The command to pass to the rpmbuild program. The default is "-bb" No @@ -103,7 +110,14 @@ directory. - +

Examples

+
+    <rpm
+        specFile="example.spec"
+        topDir="build/rpm"
+        cleanBuildDir="true"
+        failOnError="true"/>
+
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java b/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java index 1b5909bee..d570e1141 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java @@ -225,7 +225,7 @@ public class Rpm extends Task { * @param sf the spec file name to use. */ public void setSpecFile(String sf) { - if ((sf == null) || (sf.trim().equals(""))) { + if ((sf == null) || (sf.trim().length()==0)) { throw new BuildException("You must specify a spec file", getLocation()); } this.specFile = sf;