GenerateRpm.java revision a395dd575518d9e5280fc5d5d5ef47c61b174647
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at
* trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
* add the following below this CDDL HEADER, with the fields enclosed
* by brackets "[]" replaced with your own identifying information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2007-2008 Sun Microsystems, Inc.
*/
/**
* Generates an RPM spec file.
*/
public class GenerateRpm extends Task {
private String topDirAbsolutePath;
private String sourceDirName;
private boolean overwrite;
private StringBuilder sb;
/**
* Sets the top directory for the rpm build.
* @param topDir File representing top directory for rpm build directory
*/
}
/**
* Sets the prefix for the RPM.
* @param prefix Used for package relocation
*/
}
/**
* Sets the name of the source directory.
* @param sourceDirName name of the source directory.
*/
this.sourceDirName = sourceDirName;
}
/**
* Sets the RPM spec file that will be generated.
* @param dest The spec file
*
*/
}
/**
* Sets the version number.
* @param version The version number
*
*/
}
/**
* Sets the release number.
* @param release The release number
*
*/
}
/**
* Indicates when true that an existing destination
* file will be overwritten.
* @param o boolean where true means overwrite
*/
public void setOverwrite(boolean o) {
this.overwrite = o;
}
/**
* {@inheritDoc}
*/
public void execute() throws BuildException {
try {
+ " does not exist");
}
if (!topDir.isDirectory()) {
}
if (this.overwrite) {
} else {
}
}
sb = new StringBuilder();
// Generate the package information
// flush the spec file.
destWriter.close();
} catch (Exception e) {
// Don't leave a malformed file laying around. Delete
// it so it will be forced to be regenerated.
}
e.printStackTrace();
+ e.getMessage());
}
}
{
if (source.isDirectory())
{
{
}
}
else
{
}
}
}