5 * \file build/rpmbuild.h
6 * This is the *only* module users of librpmbuild should need to include.
9 #include <rpm/rpmcli.h>
10 #include <rpm/rpmds.h>
11 #include <rpm/rpmspec.h>
18 * Bit(s) to control rpmSpecBuild() operation.
20 enum rpmBuildFlags_e {
22 RPMBUILD_PREP = (1 << 0), /*!< Execute %%prep. */
23 RPMBUILD_BUILD = (1 << 1), /*!< Execute %%build. */
24 RPMBUILD_INSTALL = (1 << 2), /*!< Execute %%install. */
25 RPMBUILD_CHECK = (1 << 3), /*!< Execute %%check. */
26 RPMBUILD_CLEAN = (1 << 4), /*!< Execute %%clean. */
27 RPMBUILD_FILECHECK = (1 << 5), /*!< Check %%files manifest. */
28 RPMBUILD_PACKAGESOURCE = (1 << 6), /*!< Create source package. */
29 RPMBUILD_PACKAGEBINARY = (1 << 7), /*!< Create binary package(s). */
30 RPMBUILD_RMSOURCE = (1 << 8), /*!< Remove source(s) and patch(s). */
31 RPMBUILD_RMBUILD = (1 << 9), /*!< Remove build sub-tree. */
32 RPMBUILD_STRINGBUF = (1 << 10), /*!< Internal use only */
33 RPMBUILD_RMSPEC = (1 << 11), /*!< Remove spec file. */
35 RPMBUILD_NOBUILD = (1 << 31) /*!< Don't execute or package. */
38 typedef rpmFlags rpmBuildFlags;
41 * Bit(s) to control package generation
43 enum rpmBuildPkgFlags_e {
44 RPMBUILD_PKG_NONE = 0,
45 RPMBUILD_PKG_NODIRTOKENS = (1 << 0), /*!< Legacy filename layout */
48 typedef rpmFlags rpmBuildPkgFlags;
51 * Describe build request.
53 struct rpmBuildArguments_s {
54 rpmBuildPkgFlags pkgFlags; /*!< Bit(s) to control package generation. */
55 rpmBuildFlags buildAmount; /*!< Bit(s) to control build execution. */
56 char * buildRootOverride; /*!< from --buildroot */
57 char * cookie; /*!< NULL for binary, ??? for source, rpm's */
63 typedef struct rpmBuildArguments_s * BTA_t;
66 * Parse spec file into spec control structure.
67 * @todo Eliminate buildRoot from here, its a build, not spec property
69 * @param specFile path to spec file
70 * @param flags flags to control operation
71 * @param buildRoot buildRoot override or NULL for default
72 * @return new spec control structure
74 rpmSpec rpmSpecParse(const char *specFile, rpmSpecFlags flags,
75 const char *buildRoot);
78 * Return the headers of the SRPM that would be built from the spec file
79 * @param spec path to spec file
82 Header rpmSpecSourceHeader(rpmSpec spec);
85 * Verify build depencies of a spec against.
86 * @param ts (empty) transaction set
87 * @param spec parsed spec control structure
88 * @return rpm problem set or NULL on no problems
90 rpmps rpmSpecCheckDeps(rpmts ts, rpmSpec spec);
93 * Retrieve build dependency set from spec.
94 * @param spec parsed spec control structure
95 * @param tag dependency tag
96 * @return dependency set of tag (or NULL)
98 rpmds rpmSpecDS(rpmSpec spec, rpmTagVal tag);
100 /** \ingroup rpmbuild
101 * Spec build stages state machine driver.
102 * @param spec spec file control structure
103 * @param buildArgs build arguments
104 * @return RPMRC_OK on success
106 rpmRC rpmSpecBuild(rpmSpec spec, BTA_t buildArgs);
112 #endif /* _H_RPMBUILD_ */