Main Page   Modules   Compound List   File List   Compound Members   File Members   Related Pages  

RPMBUILD.


Files

file  build.c
 Top-level build dispatcher.

file  buildio.h
 XXX this information will move elsewhere eventually.

file  expression.c
 Simple logical expression parser.

file  files.c
 The post-build, pre-packaging file tree walk to assemble the package manifest.

file  misc.c
file  myftw.c
 Modified ftw() -- uses Lstat() instead of stat().

file  myftw.h
 Portable ftw(3) using lstat() instead of stat().

file  names.c
 Simple user/group name/id cache (plus hostname and buildtime).

file  pack.c
 Assemble components of an RPM package.

file  parseBuildInstallClean.c
 Parse build/install/clean section from spec file.

file  parseChangelog.c
 Parse changelog section from spec file.

file  parseDescription.c
 Parse description section from spec file.

file  parseFiles.c
 Parse files section from spec file.

file  parsePreamble.c
 Parse tags in global section from spec file.

file  parsePrep.c
 Parse prep section from spec file.

file  parseReqs.c
 Parse dependency tag from spec file or from auto-dependency generator.

file  parseScript.c
 Parse install-time script section from spec file.

file  parseSpec.c
 Top level dispatcher for spec file parsing.

file  reqprov.c
 Add dependency tags to package header(s).

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

file  rpmspec.h
 The Spec and Package data structures used during build.

file  spec.c
 Handle spec data structure.


Compounds

struct  OpenFileInfo
struct  PackageStruct
struct  ReadLevelEntry
struct  Source
struct  speclines
struct  SpecStruct
struct  spectag
struct  spectags
struct  TriggerFileEntry

Enumerations

enum  rpmBuildFlags_e {
  RPMBUILD_PREP = (1 << 0), RPMBUILD_BUILD = (1 << 1), RPMBUILD_INSTALL = (1 << 2), RPMBUILD_CLEAN = (1 << 3),
  RPMBUILD_FILECHECK = (1 << 4), RPMBUILD_PACKAGESOURCE = (1 << 5), RPMBUILD_PACKAGEBINARY = (1 << 6), RPMBUILD_RMSOURCE = (1 << 7),
  RPMBUILD_RMBUILD = (1 << 8), RPMBUILD_STRINGBUF = (1 << 9), RPMBUILD_RMSPEC = (1 << 10)
}
enum  rpmParseState_e {
  PART_NONE = 0, PART_PREAMBLE = 1, PART_PREP = 2, PART_BUILD = 3,
  PART_INSTALL = 4, PART_CLEAN = 5, PART_FILES = 6, PART_PRE = 7,
  PART_POST = 8, PART_PREUN = 9, PART_POSTUN = 10, PART_DESCRIPTION = 11,
  PART_CHANGELOG = 12, PART_TRIGGERIN = 13, PART_TRIGGERUN = 14, PART_VERIFYSCRIPT = 15,
  PART_BUILDARCHITECTURES = 16, PART_TRIGGERPOSTUN = 17, PART_LAST = 18
}

Functions

int parseTrigger (Spec spec, Package pkg, char *field, int tag)
int lookupPackage (Spec spec, const char *name, int flag, Package *pkg)
Package newPackage (Spec spec)
void freePackages (Spec spec)
void freePackage ( Package pkg)
Spec newSpec (void)
void freeSpec ( Spec spec)
struct OpenFileInfonewOpenFileInfo (void)
int addSource (Spec spec, Package pkg, const char *field, int tag)
int parseNoSource (Spec spec, const char *field, int tag)
void freeNames (void)
const char* getUname (uid_t uid)
const char* getUnameS (const char *uname)
const char* getGname (gid_t gid)
const char* getGnameS (const char *gname)
const char* const buildHost (void)
time_t* const getBuildTime (void)
int readLine (Spec spec, int strip)
void closeSpec (Spec spec)
void handleComments (char *s)
rpmParseState isPart (const char *line)
int parseNum (const char *line, int *res)
void addChangelogEntry (Header h, time_t time, const char *name, const char *text)
int parseBuildInstallClean (Spec spec, rpmParseState parsePart)
int parseChangelog (Spec spec)
int parseDescription (Spec spec)
int parseFiles (Spec spec)
int parsePreamble (Spec spec, int initialPackage)
int parsePrep (Spec spec)
int parseRCPOT (Spec spec, Package pkg, const char *field, int tag, int index, int tagflags)
int parseScript (Spec spec, int parsePart)
int parseExpressionBoolean (Spec spec, const char *expr)
char* parseExpressionString (Spec spec, const char *expr)
int doScript (Spec spec, int what, const char *name, StringBuf sb, int test)
int addReqProv ( Spec spec, Header h, int depFlags, const char *depName, const char *depEVR, int index)
int rpmlibNeedsFeature (Header h, const char * feature, const char * featureEVR)
int processBinaryFiles (Spec spec, int installSpecialDoc, int test)
void initSourceHeader (Spec spec)
int processSourceFiles (Spec spec)
int parseSpec (Spec *specp, const char *specFile, const char *rootURL, const char *buildRootURL, int inBuildArch, const char *passPhrase, char *cookie, int anyarch, int force)
int buildSpec (Spec spec, int what, int test)
int packageBinaries (Spec spec)
int packageSources (Spec spec)
struct spectagstashSt (Spec spec, Header h, int tag, const char *lang)

Variables

int (* parseSpecVec )(Spec *specp, const char *specFile, const char *rootdir, const char *buildRoot, int inBuildArch, const char *passPhrase, char *cookie, int anyarch, int force)
void (* freeSpecVec )(Spec spec)

Enumeration Type Documentation

enum rpmBuildFlags_e
 

Bit(s) to control buildSpec() operation.

Enumeration values:
RPMBUILD_PREP   Execute %prep.
RPMBUILD_BUILD   Execute %build.
RPMBUILD_INSTALL   Execute %install.
RPMBUILD_CLEAN   Execute %clean.
RPMBUILD_FILECHECK   Check %files manifest.
RPMBUILD_PACKAGESOURCE   Create source package.
RPMBUILD_PACKAGEBINARY   Create binary package(s).
RPMBUILD_RMSOURCE   Remove source(s) and patch(s).
RPMBUILD_RMBUILD   Remove build sub-tree.
RPMBUILD_STRINGBUF   only for doScript()
RPMBUILD_RMSPEC   Remove spec file.

Definition at line 21 of file rpmbuild.h.

enum rpmParseState_e
 

Spec file parser states.

Enumeration values:
PART_NONE  
PART_PREAMBLE  
PART_PREP  
PART_BUILD  
PART_INSTALL  
PART_CLEAN  
PART_FILES  
PART_PRE  
PART_POST  
PART_PREUN  
PART_POSTUN  
PART_DESCRIPTION  
PART_CHANGELOG  
PART_TRIGGERIN  
PART_TRIGGERUN  
PART_VERIFYSCRIPT  
PART_BUILDARCHITECTURES  
PART_TRIGGERPOSTUN  
PART_LAST  

Definition at line 47 of file rpmbuild.h.


Function Documentation

void addChangelogEntry ( Header h,
time_t time,
const char * name,
const char * text )
 

Add changelog entry to header.

Parameters:
h   header
time   time of change
name   person who made the change
text   description of change

Definition at line 11 of file parseChangelog.c.

Referenced by STRIP_COMMENTS(), addChangelog(), and headerInject().

int addReqProv ( Spec spec,
Header h,
int flag,
const char * depName,
const char * depEVR,
int index )
 

Add dependency to header, filtering duplicates.

Parameters:
spec   spec file control structure
h   header
depFlags   (e.g. Requires: foo < 0:1.2-3, both "Requires:" and "<")
depName   (e.g. Requires: foo < 0:1.2-3, "foo")
depEVR   (e.g. Requires: foo < 0:1.2-3, "0:1.2-3")
index   (0 always)
Returns:
0 always

Definition at line 11 of file reqprov.c.

Referenced by STRIP_COMMENTS(), parseRCPOT(), parseScript(), and rpmlibNeedsFeature().

int addSource ( Spec spec,
Package pkg,
const char * field,
int tag )
 

Parameters:
spec   spec file control structure

Definition at line 246 of file spec.c.

Referenced by handlePreambleTag().

const char *const buildHost ( void )
 

Return build hostname.

Returns:
build hostname

Definition at line 144 of file names.c.

Referenced by STRIP_COMMENTS(), headerInject(), packageBinaries(), and writeRPM().

int buildSpec ( Spec spec,
int what,
int test )
 

Build stages state machine driver.

Parameters:
spec   spec file control structure
what   bit(s) to enable stages of build
test   don't execute scripts or package if testing
Returns:
0 on success

Definition at line 244 of file build.c.

Referenced by STRIP_COMMENTS(), and buildForTarget().

void closeSpec ( Spec spec )
 

Stop reading from spec file, freeing resources.

Parameters:
spec   spec file control structure

Definition at line 339 of file parseSpec.c.

Referenced by STRIP_COMMENTS(), freeSpec(), and parseSpec().

int doScript ( Spec spec,
int what,
const char * name,
StringBuf sb,
int test )
 

Run a build script, assembled from spec file scriptlet section.

Parameters:
spec   spec file control structure
what   type of script
name   name of scriptlet section
sb   lines that compose script body
test   don't execute scripts or package if testing
Returns:
0 on success, RPMERR_SCRIPT on failure

Definition at line 48 of file build.c.

Referenced by STRIP_COMMENTS(), buildSpec(), and processPackageFiles().

void freeNames ( void )
 

Destroy uid/gid caches.

Definition at line 20 of file names.c.

Referenced by STRIP_COMMENTS(), and main().

void freePackage ( Package p )
 

Destroy package control structure.

Parameters:
pkg   package control structure

Definition at line 151 of file spec.c.

Referenced by STRIP_COMMENTS(), and freePackages().

void freePackages ( Spec spec )
 

Destroy all packages associated with spec file.

Parameters:
spec   spec file control structure

Definition at line 176 of file spec.c.

Referenced by STRIP_COMMENTS(), and freeSpec().

void freeSpec ( Spec spec )
 

Destroy Spec structure.

Parameters:
spec   spec file control structure

Definition at line 453 of file spec.c.

Referenced by buildForTarget(), parseSpec(), and readRPM().

time_t *const getBuildTime ( void )
 

Return build time stamp.

Returns:
build time stamp

Definition at line 135 of file names.c.

Referenced by STRIP_COMMENTS(), headerInject(), and packageBinaries().

const char * getGname ( gid_t gid )
 

Return cached group name from group id.

Todo:
Implement using hash.
Parameters:
group   id
Returns:
cached group name

Definition at line 82 of file names.c.

Referenced by STRIP_COMMENTS(), addFile(), checkOwners(), and processSourceFiles().

const char * getGnameS ( const char * gname )
 

Return cached group name.

Todo:
Implement using hash.
Parameters:
group   name
Returns:
cached group name

Definition at line 108 of file names.c.

Referenced by STRIP_COMMENTS(), and addFile().

const char * getUname ( uid_t uid )
 

Return cached user name from user id.

Todo:
Implement using hash.
Parameters:
user   id
Returns:
cached user name

Definition at line 29 of file names.c.

Referenced by STRIP_COMMENTS(), addFile(), checkOwners(), headerInject(), and processSourceFiles().

const char * getUnameS ( const char * uname )
 

Return cached user name.

Todo:
Implement using hash.
Parameters:
user   name
Returns:
cached user name

Definition at line 55 of file names.c.

Referenced by STRIP_COMMENTS(), and addFile().

void handleComments ( char * s )
 

Truncate comment lines.

Parameters:
s   skip white space, truncate line at '#'

Definition at line 91 of file parseSpec.c.

Referenced by STRIP_COMMENTS(), copyNextLine(), and processPackageFiles().

void initSourceHeader ( Spec spec )
 

Create and initialize header for source package.

Parameters:
spec   spec file control structure

Definition at line 1562 of file files.c.

Referenced by STRIP_COMMENTS(), buildForTarget(), and processSourceFiles().

rpmParseState isPart ( const char * line )
 

Check line for section separator, return next parser state.

Parameters:
line   from spec file
Returns:
next parser state

Definition at line 49 of file parseSpec.c.

Referenced by STRIP_COMMENTS(), parseBuildInstallClean(), parseChangelog(), parseDescription(), parseFiles(), parsePreamble(), parsePrep(), and parseScript().

int lookupPackage ( Spec spec,
const char * name,
int flag,
Package * pkg )
 

Find sub-package control structure by name.

Parameters:
spec   spec file control structure
name   (sub-)package name
flag   if PART_SUBNAME, then 1st package name is prepended
Return values:
pkg   package control structure
Returns:
0 on success, 1 on failure

Definition at line 64 of file spec.c.

Referenced by STRIP_COMMENTS(), parseDescription(), parseFiles(), parsePreamble(), and parseScript().

struct OpenFileInfo * newOpenFileInfo ( void )
 

Definition at line 517 of file spec.c.

Referenced by forceIncludeFile(), and parseSpec().

Package newPackage ( Spec spec )
 

Create and initialize package control structure.

Parameters:
spec   spec file control structure
Returns:
package control structure

Definition at line 103 of file spec.c.

Referenced by STRIP_COMMENTS(), parsePreamble(), and readRPM().

Spec newSpec ( void )
 

Create and initialize Spec structure.

Definition at line 393 of file spec.c.

Referenced by parseSpec(), and readRPM().

int packageBinaries ( Spec spec )
 

Generate binary package(s).

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

Definition at line 566 of file pack.c.

Referenced by STRIP_COMMENTS(), and buildSpec().

int packageSources ( Spec spec )
 

Generate source package.

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

Definition at line 661 of file pack.c.

Referenced by STRIP_COMMENTS(), and buildSpec().

int parseBuildInstallClean ( Spec spec,
rpmParseState parsePart )
 

Parse %build/%install/%clean section(s) of a spec file.

Parameters:
spec   spec file control structure
parsePart   current rpmParseState
Returns:
>= 0 next rpmParseState, < 0 on error

Definition at line 10 of file parseBuildInstallClean.c.

Referenced by STRIP_COMMENTS(), and parseSpec().

int parseChangelog ( Spec spec )
 

Parse %changelog section of a spec file.

Parameters:
spec   spec file control structure
Returns:
>= 0 next rpmParseState, < 0 on error

Definition at line 199 of file parseChangelog.c.

Referenced by STRIP_COMMENTS(), and parseSpec().

int parseDescription ( Spec spec )
 

Parse %description section of a spec file.

Parameters:
spec   spec file control structure
Returns:
>= 0 next rpmParseState, < 0 on error

Definition at line 23 of file parseDescription.c.

Referenced by STRIP_COMMENTS(), and parseSpec().

int parseExpressionBoolean ( Spec spec,
const char * expr )
 

Evaluate boolean expression.

Parameters:
spec   spec file control structure
expr   expression to parse
Returns:

Definition at line 634 of file expression.c.

Referenced by STRIP_COMMENTS(), and readLine().

char * parseExpressionString ( Spec spec,
const char * expr )
 

Evaluate string expression.

Parameters:
spec   spec file control structure
expr   expression to parse
Returns:

Definition at line 681 of file expression.c.

Referenced by STRIP_COMMENTS().

int parseFiles ( Spec spec )
 

Parse %files section of a spec file.

Parameters:
spec   spec file control structure
Returns:
>= 0 next rpmParseState, < 0 on error

Definition at line 20 of file parseFiles.c.

Referenced by STRIP_COMMENTS(), and parseSpec().

int parseNoSource ( Spec spec,
const char * field,
int tag )
 

Parameters:
spec   spec file control structure

Definition at line 202 of file spec.c.

Referenced by handlePreambleTag().

int parseNum ( const char * line,
int * res )
 

Parse a number.

Parameters:
line   from spec file
Return values:
res   pointer to int
Returns:
0 on success, 1 on failure

Definition at line 9 of file misc.c.

Referenced by STRIP_COMMENTS(), addSource(), doPatchMacro(), doSetupMacro(), handlePreambleTag(), and parseNoSource().

int parsePreamble ( Spec spec,
int initialPackage )
 

Parse tags from preamble of a spec file.

Parameters:
spec   spec file control structure
initialPackage  
Returns:
>= 0 next rpmParseState, < 0 on error

Definition at line 766 of file parsePreamble.c.

Referenced by STRIP_COMMENTS(), and parseSpec().

int parsePrep ( Spec spec )
 

Parse %prep section of a spec file.

Parameters:
spec   spec file control structure
Returns:
>= 0 next rpmParseState, < 0 on error

Definition at line 514 of file parsePrep.c.

Referenced by STRIP_COMMENTS(), and parseSpec().

int parseRCPOT ( Spec spec,
Package pkg,
const char * field,
int tag,
int index,
int flags )
 

Parse dependency relations from spec file and/or autogenerated output buffer.

Parameters:
spec   spec file control structure
pkg   package control structure
field   text to parse (e.g. "foo < 0:1.2-3, bar = 5:6.7")
tag   tag, identifies type of dependency
index   (0 always)
flags   dependency flags already known from context
Returns:
0 on success, RPMERR_BADSPEC on failure

Definition at line 34 of file parseReqs.c.

Referenced by STRIP_COMMENTS(), generateDepends(), handlePreambleTag(), and parseScript().

int parseScript ( Spec spec,
int parsePart )
 

Parse %pre et al scriptlets from a spec file.

Parameters:
spec   spec file control structure
parsePart   current rpmParseState
Returns:
>= 0 next rpmParseState, < 0 on error

Definition at line 62 of file parseScript.c.

Referenced by STRIP_COMMENTS(), and parseSpec().

int parseSpec ( Spec * specp,
const char * specFile,
const char * rootdir,
const char * buildRoot,
int inBuildArch,
const char * passPhrase,
char * cookie,
int anyarch,
int force )
 

Parse spec file into spec control structure.

Return values:
specp   spec file control structure
Parameters:
specFile  
rootdir  
buildRoot  
inBuildArch  
passPhrase  
cookie  
anyarch  
force  
Returns:

Definition at line 354 of file parseSpec.c.

Referenced by STRIP_COMMENTS(), and buildForTarget().

int parseTrigger ( Spec spec,
Package pkg,
char * field,
int tag )
 

Parse %trigger et al scriptlets from a spec file.

Parameters:
spec   spec file control structure
pkg   package control structure
field  
tag  
Returns:

Referenced by STRIP_COMMENTS().

int processBinaryFiles ( Spec spec,
int installSpecialDoc,
int test )
 

Post-build processing for binary package(s).

Parameters:
spec   spec file control structure
installSpecialDoc  
test   don't execute scripts or package if testing
Returns:
0 on success

Definition at line 2147 of file files.c.

Referenced by STRIP_COMMENTS(), and buildSpec().

int processSourceFiles ( Spec spec )
 

Post-build processing for source package.

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

Definition at line 1619 of file files.c.

Referenced by STRIP_COMMENTS(), and buildSpec().

int readLine ( Spec spec,
int strip )
 

Read next line from spec file.

Parameters:
spec   spec file control structure
strip   truncate comments?
Returns:
0 on success, 1 on EOF, <0 on error

Definition at line 167 of file parseSpec.c.

Referenced by STRIP_COMMENTS(), parseBuildInstallClean(), parseChangelog(), parseDescription(), parseFiles(), parsePreamble(), parsePrep(), and parseScript().

int rpmlibNeedsFeature ( Header h,
const char * feature,
const char * featureEVR )
 

Add rpmlib feature dependency.

Parameters:
h   header
feature   rpm feature name (i.e. "rpmlib(Foo)" for feature Foo)
featureEVR   rpm feature epoch/version/release
Returns:
0 always

Definition at line 112 of file reqprov.c.

Referenced by STRIP_COMMENTS(), genCpioListAndHeader(), parseRCPOT(), and writeRPM().

struct spectag * stashSt ( Spec spec,
Header h,
int tag,
const char * lang )
 

Parameters:
spec   spec file control structure

Definition at line 367 of file parsePreamble.c.

Referenced by handlePreambleTag(), and parseDescription().


Variable Documentation

void(* freeSpecVec)(Spec spec)=NULL
 

Parameters:
spec   spec file control structure

Definition at line 508 of file query.c.

Referenced by rpmQueryVerify().

int(* parseSpecVec)(Spec *specp,const char *specFile,const char *rootdir,const char *buildRoot,int inBuildArch,const char *passPhrase,char *cookie,int anyarch,int force)=NULL
 

Return values:
specp   spec file control structure
Parameters:
specFile  
rootdir  
buildRoot  
inBuildArch  
passPhrase  
cookie  
anyarch  
force  
Returns:

Definition at line 502 of file query.c.

Referenced by rpmQueryVerify().


Generated at Sun Apr 8 18:43:07 2001 for rpm by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000