# rpmbuild.h File Reference

This is the *only* module users of librpmbuild should need to include. More...

`#include <rpm/rpmcli.h>`
`#include <rpm/rpmds.h>`
`#include <rpm/rpmstring.h>`
`#include <rpm/rpmspec.h>`

Include dependency graph for rpmbuild.h:

Go to the source code of this file.

## Defines

#define | PART_SUBNAME 0
#define | PART_NAME 1
#define | PART_BASE 0
| rpmSpec file parser states.
#define | STRIP_NOTHING 0
#define | STRIP_TRAILINGSPACE (1 << 0)
#define | STRIP_COMMENTS (1 << 1)

## Typedefs

typedef enum rpmBuildFlags_e | rpmBuildFlags
| Bit(s) to control buildSpec() operation.
typedef enum rpmParseState_e | rpmParseState

## Enumerations

enum

rpmBuildFlags_e {
RPMBUILD_NONE = 0, RPMBUILD_PREP = (1 << 0), RPMBUILD_BUILD = (1 << 1), RPMBUILD_INSTALL = (1 << 2),
RPMBUILD_CHECK = (1 << 3), RPMBUILD_CLEAN = (1 << 4), RPMBUILD_FILECHECK = (1 << 5), RPMBUILD_PACKAGESOURCE = (1 << 6),
RPMBUILD_PACKAGEBINARY = (1 << 7), RPMBUILD_RMSOURCE = (1 << 8), RPMBUILD_RMBUILD = (1 << 9), RPMBUILD_STRINGBUF = (1 << 10),
RPMBUILD_RMSPEC = (1 << 11)
}

| Bit(s) to control buildSpec() operation. More...

enum

rpmParseState_e {
PART_ERROR = -1, PART_NONE = 0+ 0, PART_PREAMBLE = 11+ 0, PART_PREP = 12+ 0,
PART_BUILD = 13+ 0, PART_INSTALL = 14+ 0, PART_CHECK = 15+ 0, PART_CLEAN = 16+ 0,
PART_FILES = 17+ 0, PART_PRE = 18+ 0, PART_POST = 19+ 0, PART_PREUN = 20+ 0,
PART_POSTUN = 21+ 0, PART_PRETRANS = 22+ 0, PART_POSTTRANS = 23+ 0, PART_DESCRIPTION = 24+ 0,
PART_CHANGELOG = 25+ 0, PART_TRIGGERIN = 26+ 0, PART_TRIGGERUN = 27+ 0, PART_VERIFYSCRIPT = 28+ 0,
PART_BUILDARCHITECTURES = 29+ 0, PART_TRIGGERPOSTUN = 30+ 0, PART_TRIGGERPREIN = 31+ 0, PART_LAST = 32+ 0
}

## Functions

void | freeNames (void)
| Destroy uid/gid caches.
const char * | getUname (uid_t uid)
| Return cached user name from user id.
const char * | getUnameS (const char *uname)
| Return cached user name.
uid_t | getUidS (const char *uname)
| Return cached user id.
const char * | getGname (gid_t gid)
| Return cached group name from group id.
const char * | getGnameS (const char *gname)
| Return cached group name.
gid_t | getGidS (const char *gname)
| Return cached group id.
const char * | buildHost (void)
| Return build hostname.
rpm_time_t * | getBuildTime (void)
| Return build time stamp.
int | readLine (rpmSpec spec, int strip)
| Read next line from spec file.
void | closeSpec (rpmSpec spec)
| Stop reading from spec file, freeing resources.
void | handleComments (char *s)
| Truncate comment lines.
rpmParseState | isPart (const char *line)
| Check line for section separator, return next parser state.
uint32_t | parseUnsignedNum (const char *line, uint32_t *res)
| Parse an unsigned number.
void | addChangelogEntry (Header h, time_t time, const char *name, const char *text)
| Add changelog entry to header.
int | parseBuildInstallClean (rpmSpec spec, rpmParseState parsePart)
| Parse %build/%install/%clean section(s) of a spec file.
int | parseChangelog (rpmSpec spec)
| Parse %changelog section of a spec file.
int | parseDescription (rpmSpec spec)
| Parse %description section of a spec file.
int | parseFiles (rpmSpec spec)
| Parse %files section of a spec file.
int | parsePreamble (rpmSpec spec, int initialPackage)
| Parse tags from preamble of a spec file.
int | parsePrep (rpmSpec spec)
| Parse %prep section of a spec file.
rpmRC | parseRCPOT (rpmSpec spec, Package pkg, const char *field, rpmTag tagN, int index, rpmsenseFlags tagflags)
| Parse dependency relations from spec file and/or autogenerated output buffer.
int | parseScript (rpmSpec spec, int parsePart)
| Parse %pre et al scriptlets from a spec file.
int | parseExpressionBoolean (rpmSpec spec, const char *expr)
| Evaluate boolean expression.
char * | parseExpressionString (rpmSpec spec, const char *expr)
| Evaluate string expression.
rpmRC | doScript (rpmSpec spec, rpmBuildFlags what, const char *name, StringBuf sb, int test)
| Run a build script, assembled from spec file scriptlet section.
rpmRC | lookupPackage (rpmSpec spec, const char *name, int flag, Package *pkg)
| Find sub-package control structure by name.
Package | newPackage (rpmSpec spec)
| Create and initialize package control structure.
Package | freePackages (Package packages)
| Destroy all packages associated with spec file.
Package | freePackage (Package pkg)
| Destroy package control structure.
int | addReqProv (rpmSpec spec, Header h, rpmTag tagN, const char *N, const char *EVR, rpmsenseFlags Flags, uint32_t index)
| Add dependency to header, filtering duplicates.
int | rpmlibNeedsFeature (Header h, const char *feature, const char *featureEVR)
| Add rpmlib feature dependency.
int | processBinaryFiles (rpmSpec spec, int installSpecialDoc, int test)
| Post-build processing for binary package(s).
void | initSourceHeader (rpmSpec spec)
| Create and initialize header for source package.
int | processSourceFiles (rpmSpec spec)
| Post-build processing for source package.
int | parseSpec (rpmts ts, const char *specFile, const char *rootDir, const char *buildRoot, int recursing, const char *passPhrase, const char *cookie, int anyarch, int force)
| Parse spec file into spec control structure.
rpmRC | buildSpec (rpmts ts, rpmSpec spec, int what, int test)
| Build stages state machine driver.
rpmRC | packageBinaries (rpmSpec spec)
| Generate binary package(s).
rpmRC | packageSources (rpmSpec spec)
| Generate source package.

## Detailed Description

This is the *only* module users of librpmbuild should need to include.

Definition in file rpmbuild.h.

## Define Documentation

#define PART_NAME 1

Definition at line 42 of file rpmbuild.h.

#define PART_SUBNAME 0

Definition at line 41 of file rpmbuild.h.

#define STRIP_COMMENTS (1 << 1)

Definition at line 82 of file rpmbuild.h.

#define STRIP_NOTHING 0

Definition at line 80 of file rpmbuild.h.

#define STRIP_TRAILINGSPACE (1 << 0)

Definition at line 81 of file rpmbuild.h.

## Typedef Documentation

typedef enum rpmParseState_e rpmParseState

## Enumeration Type Documentation

enum rpmParseState_e

Enumerator:

  PART_ERROR |
  PART_NONE |
  PART_PREAMBLE |
  PART_PREP |
  PART_BUILD |
  PART_INSTALL |
  PART_CHECK |
  PART_CLEAN |
  PART_FILES |
  PART_PRE |
  PART_POST |
  PART_PREUN |
  PART_POSTUN |
  PART_PRETRANS |
  PART_POSTTRANS |
  PART_DESCRIPTION |
  PART_CHANGELOG |
  PART_TRIGGERIN |
  PART_TRIGGERUN |
  PART_VERIFYSCRIPT |
  PART_BUILDARCHITECTURES |
  PART_TRIGGERPOSTUN |
  PART_TRIGGERPREIN |
  PART_LAST |

Definition at line 51 of file rpmbuild.h.