spec = freeSpec(spec);
return PART_ERROR;
}
+
+rpmSpec rpmSpecParse(const char *specFile, rpmSpecFlags flags,
+ const char *buildRoot)
+{
+ rpmts ts = rpmtsCreate();
+ rpmSpec spec = NULL;
+
+ if (parseSpec(ts, specFile, NULL, buildRoot, 0, NULL, NULL,
+ (flags & RPMSPEC_ANYARCH), (flags & RPMSPEC_FORCE)) == 0) {
+ spec = rpmtsSetSpec(ts, NULL);
+ }
+
+ rpmtsFree(ts);
+ return spec;
+}
/** \ingroup rpmbuild
* Parse spec file into spec control structure.
+ * @todo Eliminate buildRoot from here, its a build, not spec property
+ *
+ * @param specFile path to spec file
+ * @param flags flags to control operation
+ * @param buildRoot buildRoot override or NULL for default
+ * @return new spec control structure
+ */
+rpmSpec rpmSpecParse(const char *specFile, rpmSpecFlags flags,
+ const char *buildRoot);
+
+/** \ingroup rpmbuild
+ * Parse spec file into spec control structure.
* @param ts transaction set (spec file control in ts->spec)
* @param specFile
* @param rootDir (unused)
#define RPMBUILD_DEFAULT_LANG "C"
+typedef enum rpmSpecFlags_e {
+ RPMSPEC_NONE = 0,
+ RPMSPEC_ANYARCH = (1 << 0),
+ RPMSPEC_FORCE = (1 << 1),
+} rpmSpecFlags;
+
/** \ingroup rpmbuild
*/
struct Source {