build/rpmbuild.h File Reference

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

#include "rpmcli.h"
#include "stringbuf.h"
#include "misc.h"
#include "rpmspec.h"
#include <ctype.h>

Include dependency graph for rpmbuild.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define SKIPSPACE(s)   { while (*(s) && xisspace(*(s))) (s)++; }
#define SKIPNONSPACE(s)   { while (*(s) && !xisspace(*(s))) (s)++; }
#define PART_SUBNAME   0
#define PART_NAME   1
#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
 Spec file parser states.

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_NONE = 0, PART_PREAMBLE = 1, PART_PREP = 2, PART_BUILD = 3,
  PART_INSTALL = 4, PART_CHECK = 5, PART_CLEAN = 6, PART_FILES = 7,
  PART_PRE = 8, PART_POST = 9, PART_PREUN = 10, PART_POSTUN = 11,
  PART_PRETRANS = 12, PART_POSTTRANS = 13, PART_DESCRIPTION = 14, PART_CHANGELOG = 15,
  PART_TRIGGERIN = 16, PART_TRIGGERUN = 17, PART_VERIFYSCRIPT = 18, PART_BUILDARCHITECTURES = 19,
  PART_TRIGGERPOSTUN = 20, PART_TRIGGERPREIN = 21, PART_LAST = 22
}
 Spec file parser states. More...

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.
int_32getBuildTime (void)
 Return build time stamp.
int readLine (Spec spec, int strip)
 Read next line from spec file.
void closeSpec (Spec 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.
int parseNum (const char *line, int *res)
 Parse a number.
void addChangelogEntry (Header h, time_t time, const char *name, const char *text)
 Add changelog entry to header.
int parseBuildInstallClean (Spec spec, rpmParseState parsePart)
 Parse %build/%install/%clean section(s) of a spec file.
int parseChangelog (Spec spec)
 Parse %changelog section of a spec file.
int parseDescription (Spec spec)
 Parse %description section of a spec file.
int parseFiles (Spec spec)
 Parse %files section of a spec file.
int parsePreamble (Spec spec, int initialPackage)
 Parse tags from preamble of a spec file.
int parsePrep (Spec spec, int verify)
 Parse %prep section of a spec file.
int parseRCPOT (Spec 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 (Spec spec, int parsePart)
 Parse %pre et al scriptlets from a spec file.
int parseExpressionBoolean (Spec spec, const char *expr)
 Evaluate boolean expression.
char * parseExpressionString (Spec spec, const char *expr)
 Evaluate string expression.
int doScript (Spec spec, int what, const char *name, StringBuf sb, int test)
 Run a build script, assembled from spec file scriptlet section.
int lookupPackage (Spec spec, const char *name, int flag, Package *pkg)
 Find sub-package control structure by name.
Package newPackage (Spec 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 (Spec spec, Header h, rpmTag tagN, const char *N, const char *EVR, rpmsenseFlags Flags, int index)
 Add dependency to header, filtering duplicates.
int processScriptFiles (Spec spec, Package pkg)
 Append files (if any) to scriptlet tags.
void providePackageNVR (Header h)
 Retrofit an explicit Provides: N = E:V-R dependency into package headers.
int rpmlibNeedsFeature (Header h, const char *feature, const char *featureEVR)
 Add rpmlib feature dependency.
int processBinaryFiles (Spec spec, int installSpecialDoc, int test)
 Post-build processing for binary package(s).
int initSourceHeader (Spec spec, StringBuf *sfp)
 Create and initialize header for source package.
int processSourceFiles (Spec spec)
 Post-build processing for source package.
int parseSpec (rpmts ts, const char *specFile, const char *rootURL, int recursing, const char *passPhrase, char *cookie, int anyarch, int force, int verify)
 Parse spec file into spec control structure.
int buildSpec (rpmts ts, Spec spec, int what, int test)
 Build stages state machine driver.
int packageBinaries (Spec spec)
 Generate binary package(s).
int packageSources (Spec 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 47 of file rpmbuild.h.

Referenced by parseDescription(), parseFiles(), parseScript(), and parseSimplePart().

#define PART_SUBNAME   0

Definition at line 46 of file rpmbuild.h.

Referenced by lookupPackage(), parseDescription(), parseFiles(), parsePreamble(), parseScript(), and parseSimplePart().

#define SKIPNONSPACE (  )     { while (*(s) && !xisspace(*(s))) (s)++; }

Definition at line 44 of file rpmbuild.h.

Referenced by handlePreambleTag(), matchTok(), and readLine().

#define SKIPSPACE (  )     { while (*(s) && xisspace(*(s))) (s)++; }

Definition at line 43 of file rpmbuild.h.

Referenced by addSource(), handleComments(), handlePreambleTag(), matchTok(), parseForAttr(), parseForConfig(), parseForDev(), parseForLang(), parseForVerify(), parsePreamble(), processPackageFiles(), processSourceFiles(), and readLine().

#define STRIP_COMMENTS   (1 << 1)

Definition at line 80 of file rpmbuild.h.

Referenced by copyNextLine(), parseChangelog(), parseDescription(), parseFiles(), and parsePreamble().

#define STRIP_NOTHING   0

Definition at line 78 of file rpmbuild.h.

Referenced by parseBuildInstallClean(), parsePrep(), and parseScript().

#define STRIP_TRAILINGSPACE   (1 << 0)

Definition at line 79 of file rpmbuild.h.

Referenced by copyNextLine(), parseDescription(), and parsePreamble().


Function Documentation

int processScriptFiles ( Spec  spec,
Package  pkg 
)

Append files (if any) to scriptlet tags.

Parameters:
spec spec file control structure
pkg package control structure
Returns:
0 on success

Definition at line 209 of file pack.c.

References _, addFileToArrayTag(), addFileToTag(), TriggerFileEntry::fileName, Package_s::header, headerAddOrAppendEntry(), TriggerFileEntry::next, Package_s::postInFile, Package_s::postTransFile, Package_s::postUnFile, Package_s::preInFile, Package_s::preTransFile, Package_s::preUnFile, TriggerFileEntry::prog, RPM_STRING_ARRAY_TYPE, RPMERR_BADFILENAME, rpmError, RPMTAG_POSTIN, RPMTAG_POSTTRANS, RPMTAG_POSTUN, RPMTAG_PREIN, RPMTAG_PRETRANS, RPMTAG_PREUN, RPMTAG_TRIGGERSCRIPTPROG, RPMTAG_TRIGGERSCRIPTS, RPMTAG_VERIFYSCRIPT, TriggerFileEntry::script, Package_s::triggerFiles, and Package_s::verifyFile.

Referenced by processBinaryFiles().

void providePackageNVR ( Header  h  ) 

Retrofit an explicit Provides: N = E:V-R dependency into package headers.

Up to rpm 3.0.4, packages implicitly provided their own name-version-release.

Parameters:
h header

Definition at line 418 of file pack.c.

References alloca(), headerAddOrAppendEntry(), headerFreeData(), headerGetEntryMinMemory(), headerNVR(), RPM_INT32_TYPE, RPM_STRING_ARRAY_TYPE, RPMSENSE_EQUAL, RPMTAG_EPOCH, RPMTAG_PROVIDEFLAGS, RPMTAG_PROVIDENAME, RPMTAG_PROVIDEVERSION, and stpcpy().

Referenced by hdrLoad(), processBinaryFiles(), and rpmReadHeaders().


Generated on Fri May 25 21:18:35 2007 for rpm by  doxygen 1.5.2