rpm  5.4.10
Macros | Typedefs | Enumerations | Functions | Variables
rpmbuild.h File Reference

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

#include <rpmiotypes.h>
#include <rpmmacro.h>
#include <rpmtypes.h>
#include <rpmtag.h>
#include <rpmfi.h>
#include <rpmcli.h>
#include "rpmspec.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.

Macros

#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 PART_BASE   100
 Spec file parser states. More...
 
#define freePackage(_pkg)   ((Package)rpmioFreePoolItem((rpmioItem)(_pkg), __FUNCTION__, __FILE__, __LINE__))
 

Typedefs

typedef enum rpmBuildFlags_e rpmBuildFlags
 Bit(s) to control buildSpec() operation. More...
 
typedef enum rpmParseState_e rpmParseState
 
typedef enum rpmStripFlags_e rpmStripFlags
 Spec file parser stripping flags. More...
 

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_TRACK = (1 << 11), RPMBUILD_RMSPEC = (1 << 12), RPMBUILD_FETCHSOURCE = (1 << 13)
}
 Bit(s) to control buildSpec() operation. More...
 
enum  rpmParseState_e {
  PART_NONE = 0+ 100, PART_PREAMBLE = 11+ 100, PART_PREP = 12+ 100, PART_BUILD = 13+ 100,
  PART_INSTALL = 14+ 100, PART_CHECK = 15+ 100, PART_CLEAN = 16+ 100, PART_FILES = 17+ 100,
  PART_PRE = 18+ 100, PART_POST = 19+ 100, PART_PREUN = 20+ 100, PART_POSTUN = 21+ 100,
  PART_PRETRANS = 22+ 100, PART_POSTTRANS = 23+ 100, PART_DESCRIPTION = 24+ 100, PART_CHANGELOG = 25+ 100,
  PART_TRIGGERIN = 26+ 100, PART_TRIGGERUN = 27+ 100, PART_VERIFYSCRIPT = 28+ 100, PART_BUILDARCHITECTURES = 29+ 100,
  PART_TRIGGERPOSTUN = 30+ 100, PART_TRIGGERPREIN = 31+ 100, PART_TRIGGERPRETRANSIN = 32+ 100, PART_TRIGGERPRETRANSUN = 33+ 100,
  PART_TRIGGERPOSTTRANSIN = 34+ 100, PART_TRIGGERPOSTTRANSUN = 35+ 100, PART_SANITYCHECK = 36+ 100, PART_ARBITRARY = 37+ 100,
  PART_LAST = 38+ 100
}
 
enum  rpmStripFlags_e { STRIP_NOTHING = 0, STRIP_TRAILINGSPACE = (1 << 0), STRIP_COMMENTS = (1 << 1), STRIP_NOEXPAND = (1 << 2) }
 Spec file parser stripping flags. More...
 

Functions

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

Variables

int _rpmbuildFlags
 

Detailed Description

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

Definition in file rpmbuild.h.

Macro Definition Documentation

§ freePackage

#define freePackage (   _pkg)    ((Package)rpmioFreePoolItem((rpmioItem)(_pkg), __FUNCTION__, __FILE__, __LINE__))

Definition at line 436 of file rpmbuild.h.

§ PART_BASE

#define PART_BASE   100

Spec file parser states.

Definition at line 54 of file rpmbuild.h.

§ PART_NAME

#define PART_NAME   1

Definition at line 49 of file rpmbuild.h.

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

§ PART_SUBNAME

#define PART_SUBNAME   0

§ SKIPNONSPACE

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

Definition at line 46 of file rpmbuild.h.

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

§ SKIPSPACE

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

Typedef Documentation

§ rpmBuildFlags

Bit(s) to control buildSpec() operation.

§ rpmParseState

§ rpmStripFlags

Spec file parser stripping flags.

Enumeration Type Documentation

§ rpmBuildFlags_e

Bit(s) to control buildSpec() operation.

Enumerator
RPMBUILD_NONE 
RPMBUILD_PREP 

Execute %prep.

RPMBUILD_BUILD 

Execute %build.

RPMBUILD_INSTALL 

Execute %install.

RPMBUILD_CHECK 

Execute %check.

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_TRACK 

Execute %track.

RPMBUILD_RMSPEC 

Remove spec file.

RPMBUILD_FETCHSOURCE 

Fetch source(s) and patch(s).

Definition at line 24 of file rpmbuild.h.

§ rpmParseState_e

Enumerator
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_TRIGGERPRETRANSIN 
PART_TRIGGERPRETRANSUN 
PART_TRIGGERPOSTTRANSIN 
PART_TRIGGERPOSTTRANSUN 
PART_SANITYCHECK 
PART_ARBITRARY 
PART_LAST 

Definition at line 55 of file rpmbuild.h.

§ rpmStripFlags_e

Spec file parser stripping flags.

Enumerator
STRIP_NOTHING 
STRIP_TRAILINGSPACE 
STRIP_COMMENTS 
STRIP_NOEXPAND 

Definition at line 92 of file rpmbuild.h.

Function Documentation

§ addChangelogEntry()

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

Add changelog entry to header.

Todo:
addChangelogEntry should be static.
Parameters
hheader
timetime of change
nameperson who made the change
textdescription of change

Definition at line 17 of file parseChangelog.c.

References alloca(), _HE_s::append, rpmDataType_u::argv, _HE_s::c, headerPut(), name, _HE_s::p, RPM_STRING_ARRAY_TYPE, RPM_UINT32_TYPE, RPMTAG_CHANGELOGNAME, RPMTAG_CHANGELOGTEXT, RPMTAG_CHANGELOGTIME, _HE_s::t, _HE_s::tag, and rpmDataType_u::ui32p.

Referenced by addChangelog().

§ addReqProv()

int addReqProv ( Spec  spec,
Header  h,
rpmTag  tagN,
const char *  N,
const char *  EVR,
rpmsenseFlags  Flags,
rpmuint32_t  index 
)

§ buildHost()

const char* buildHost ( void  )

Return build hostname.

Returns
build hostname

Definition at line 206 of file names.c.

References _, rpmlog(), and RPMLOG_WARNING.

Referenced by rpmlibMarkers(), and writeRPM().

§ buildSpec()

rpmRC buildSpec ( rpmts  ts,
Spec  spec,
int  what,
int  test 
)

§ closeSpec()

void closeSpec ( Spec  spec)

Stop reading from spec file, freeing resources.

Parameters
specspec file control structure

Definition at line 484 of file parseSpec.c.

References _free(), Fclose(), OpenFileInfo::fd, OpenFileInfo::fileName, Spec_s::fileStack, and OpenFileInfo::next.

Referenced by parseSpec(), and specFini().

§ doScript()

rpmRC doScript ( Spec  spec,
int  what,
const char *  name,
rpmiob  iob,
int  test 
)

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

Parameters
specspec file control structure
whattype of script
namename of scriptlet section
ioblines that compose script body
testdon't execute scripts or package if testing
Returns
RPMRC_OK on success, RPMRC_FAIL on failure

Definition at line 89 of file build.c.

References alloca(), Spec_s::prep, Spec_s::rootURL, RPMBUILD_PREP, rpmGenPath(), and RPMSCRIPT_PREP.

Referenced by buildSpec(), and processPackageFiles().

§ freeNames()

void freeNames ( void  )

Destroy uid/gid caches.

Definition at line 32 of file names.c.

References _free(), gid_used, gnames, uid_used, and unames.

Referenced by main().

§ freePackage()

Package freePackage ( Package  pkg)

Destroy a package control structure.

Todo:
Rename to pkgFree.
Parameters
pkgpackage control structure
Returns
NULL on last dereference

Referenced by freePackages().

§ freePackages()

Package freePackages ( Package  packages)

Destroy all packages associated with spec file.

Parameters
packagespackage control structure chain
Returns
NULL

Definition at line 245 of file spec.c.

References freePackage(), and Package_s::next.

Referenced by parsePreamble(), and specFini().

§ getBuildTime()

rpmuint32_t* getBuildTime ( void  )

Return build time stamp.

Returns
build time stamp

Definition at line 197 of file names.c.

Referenced by rpmlibMarkers(), and writeRPM().

§ getGidS()

gid_t getGidS ( const char *  gname)

Return cached group id.

Todo:
Implement using hash.
Parameters
gnamegroup name
Returns
cached gid

Definition at line 170 of file names.c.

References _, gid_used, gids, gnames, rpmlog(), RPMLOG_CRIT, and xstrdup().

§ getGname()

const char* getGname ( gid_t  gid)

Return cached group name from group id.

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

Definition at line 119 of file names.c.

References _, gid_used, gids, gnames, rpmlog(), RPMLOG_CRIT, and xstrdup().

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

§ getGnameS()

const char* getGnameS ( const char *  gname)

Return cached group name.

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

Definition at line 143 of file names.c.

References _, gid_used, gids, gnames, rpmlog(), RPMLOG_CRIT, and xstrdup().

Referenced by addFile(), and processSourceFiles().

§ getUidS()

uid_t getUidS ( const char *  uname)

Return cached user id.

Todo:
Implement using hash.
Parameters
unameuser name
Returns
cached uid

Definition at line 92 of file names.c.

References _, rpmlog(), RPMLOG_CRIT, uid_used, uids, unames, and xstrdup().

§ getUname()

const char* getUname ( uid_t  uid)

Return cached user name from user id.

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

Definition at line 41 of file names.c.

References _, rpmlog(), RPMLOG_CRIT, uid_used, uids, unames, and xstrdup().

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

§ getUnameS()

const char* getUnameS ( const char *  uname)

Return cached user name.

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

Definition at line 65 of file names.c.

References _, rpmlog(), RPMLOG_CRIT, uid_used, uids, unames, and xstrdup().

Referenced by addFile(), and processSourceFiles().

§ handleComments()

void handleComments ( char *  s)

Truncate comment lines.

Parameters
sskip white space, truncate line at '#'

Definition at line 144 of file parseSpec.c.

References SKIPSPACE.

Referenced by copyNextLineFinish(), and processPackageFiles().

§ initSourceHeader()

int initSourceHeader ( Spec  spec,
rpmiob sfp 
)

§ isPart()

rpmParseState isPart ( Spec  spec)

Check line for section separator, return next parser state.

Parameters
specspec file control structure
Returns
next parser state

Definition at line 68 of file parseSpec.c.

References _free(), argvSearch(), argvStrcasecmp(), Spec_s::foo, initParts(), PartRec::len, Spec_s::line, Spec_s::nfoo, PartRec::part, PART_ARBITRARY, PART_NONE, partList, rpmTags, tagCanonicalize(), tagGenerate(), tagName(), PartRec::token, xisspace(), xrealloc, xstrdup(), and xstrncasecmp().

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

§ lookupPackage()

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

Find sub-package control structure by name.

Parameters
specspec file control structure
name(sub-)package name
flagif PART_SUBNAME, then 1st package name is prepended
Return values
pkgpackage control structure
Returns
RPMRC_OK on success

Definition at line 82 of file spec.c.

References _free(), alloca(), Package_s::header, headerGet(), Package_s::next, _HE_s::p, Spec_s::packages, PART_SUBNAME, rpmDataType_u::ptr, rpmExpand(), RPMRC_FAIL, RPMRC_OK, RPMTAG_NAME, RPMTAG_VERSION, rpmDataType_u::str, _HE_s::tag, xisdigit(), and xstrdup().

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

§ newPackage()

Package newPackage ( Spec  spec)

§ packageBinaries()

rpmRC packageBinaries ( Spec  spec)

§ packageSources()

rpmRC packageSources ( Spec  spec)

§ parseBuildInstallClean()

int parseBuildInstallClean ( Spec  spec,
rpmParseState  parsePart 
)

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

Parameters
specspec file control structure
parsePartcurrent rpmParseState
Returns
>= 0 next rpmParseState, < 0 on error

Definition at line 14 of file parseBuildInstallClean.c.

References _, _free(), Spec_s::build, Spec_s::check, Spec_s::clean, Spec_s::foo, Spec_s::install, isPart(), Spec_s::line, Spec_s::lineNum, name, Spec_s::nfoo, PART_ARBITRARY, PART_BUILD, PART_CHECK, PART_CLEAN, PART_INSTALL, PART_NONE, readLine(), rpmExpand(), rpmiobAppend(), rpmiobNew(), rpmlog(), RPMLOG_ERR, RPMRC_FAIL, RPMRC_OK, and STRIP_NOTHING.

Referenced by parseSpec().

§ parseChangelog()

int parseChangelog ( Spec  spec)

Parse %changelog section of a spec file.

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

Definition at line 263 of file parseChangelog.c.

References _free(), addChangelog(), Spec_s::clean, Package_s::header, isPart(), Spec_s::line, Spec_s::packages, PART_CLEAN, PART_NONE, readLine(), rpmiobAppend(), rpmiobFree(), rpmiobNew(), RPMRC_OK, STRIP_COMMENTS, STRIP_NOEXPAND, xstrdup(), and xstrtolocale().

Referenced by parseSpec().

§ parseDescription()

int parseDescription ( Spec  spec)

§ parseExpressionBoolean()

int parseExpressionBoolean ( Spec  spec,
const char *  expr 
)

Evaluate boolean expression.

Parameters
specspec file control structure
exprexpression to parse
Returns

Definition at line 679 of file expression.c.

References _, _free(), _value::data, DEBUG, doLogical(), _value::i, _parseState::nextToken, _parseState::p, rdToken(), rpmlog(), RPMLOG_ERR, _value::s, _parseState::spec, _parseState::str, TOK_EOF, _parseState::tokenValue, _value::type, _value::VALUE_TYPE_INTEGER, _value::VALUE_TYPE_STRING, valueFree(), and xstrdup().

Referenced by readLine().

§ parseExpressionString()

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

Evaluate string expression.

Parameters
specspec file control structure
exprexpression to parse
Returns

Definition at line 726 of file expression.c.

References _, _free(), _value::data, DEBUG, doLogical(), _value::i, _parseState::nextToken, _parseState::p, rdToken(), rpmlog(), RPMLOG_ERR, _value::s, _parseState::spec, _parseState::str, TOK_EOF, _parseState::tokenValue, _value::type, _value::VALUE_TYPE_INTEGER, _value::VALUE_TYPE_STRING, valueFree(), and xstrdup().

§ parseFiles()

int parseFiles ( Spec  spec)

Parse %files section of a spec file.

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

Definition at line 28 of file parseFiles.c.

References _, _free(), Spec_s::clean, file, Package_s::fileFile, Package_s::fileList, isPart(), Spec_s::line, Spec_s::lineNum, lookupPackage(), name, optionsTable, PART_CLEAN, PART_NAME, PART_NONE, PART_SUBNAME, readLine(), rpmGetPath(), rpmiobAppend(), rpmiobNew(), rpmlog(), RPMLOG_ERR, RPMRC_FAIL, RPMRC_OK, and STRIP_COMMENTS.

Referenced by parseSpec().

§ parseNum()

int parseNum ( const char *  line,
rpmuint32_t res 
)

Parse a number.

Parameters
linefrom spec file
Return values
respointer to int
Returns
0 on success, 1 on failure

Definition at line 11 of file misc.c.

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

§ parsePreamble()

int parsePreamble ( Spec  spec,
int  initialPackage 
)

§ parsePrep()

int parsePrep ( Spec  spec,
int  verify 
)

Parse %prep section of a spec file.

Parameters
specspec file control structure
verifyverify existence of sources/patches?
Returns
>= 0 next rpmParseState, < 0 on error

Definition at line 887 of file parsePrep.c.

References _, argvFree(), argvSplit(), doPatchMacro(), doSetupMacro(), Spec_s::force, isPart(), Spec_s::line, Spec_s::lineNum, PART_NONE, Spec_s::prep, prepFetch(), readLine(), rpmiobAppend(), rpmiobFree(), rpmiobNew(), rpmiobStr(), rpmlog(), RPMLOG_ERR, RPMRC_FAIL, and STRIP_NOTHING.

Referenced by parseSpec().

§ parseRCPOT()

rpmRC parseRCPOT ( Spec  spec,
Package  pkg,
const char *  field,
rpmTag  tagN,
rpmuint32_t  index,
rpmsenseFlags  tagflags 
)

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

Parameters
specspec file control structure
pkgpackage control structure
fieldtext to parse (e.g. "foo < 0:1.2-3, bar = 5:6.7")
tagNtag, identifies type of dependency
index(0 always)
tagflagsdependency flags already known from context
Returns
RPMRC_OK on success

Definition at line 20 of file parseReqs.c.

References _, _free(), addReqProv(), alloca(), Package_s::header, Spec_s::line, Spec_s::lineNum, rpmEVRflags(), rpmEVRparse(), rpmlog(), RPMLOG_ERR, RPMRC_FAIL, RPMRC_OK, RPMSENSE_SENSEMASK, RPMTAG_BUILDCONFLICTS, RPMTAG_BUILDENHANCES, RPMTAG_BUILDOBSOLETES, RPMTAG_BUILDPREREQ, RPMTAG_BUILDPROVIDES, RPMTAG_BUILDREQUIRES, RPMTAG_BUILDSUGGESTS, RPMTAG_CONFLICTFLAGS, RPMTAG_OBSOLETEFLAGS, RPMTAG_PREREQ, RPMTAG_PROVIDEFLAGS, RPMTAG_REQUIREFLAGS, RPMTAG_TRIGGERIN, RPMTAG_TRIGGERPOSTTRANSIN, RPMTAG_TRIGGERPOSTTRANSUN, RPMTAG_TRIGGERPOSTUN, RPMTAG_TRIGGERPREIN, RPMTAG_TRIGGERPRETRANSIN, RPMTAG_TRIGGERPRETRANSUN, RPMTAG_TRIGGERUN, SKIPNONWHITE, SKIPWHITE, Spec_s::sourceHeader, xisalnum(), and xmalloc.

Referenced by handlePreambleTag(), newSpec(), and parseScript().

§ parseScript()

int parseScript ( Spec  spec,
int  parsePart 
)

Parse %pre et al scriptlets from a spec file.

Parameters
specspec file control structure
parsePartcurrent rpmParseState
Returns
>= 0 next rpmParseState, < 0 on error

Definition at line 74 of file parseScript.c.

References _, _free(), addReqProv(), addTriggerIndex(), alloca(), rpmDataType_u::argv, _HE_s::c, file, Package_s::header, headerIsEntry(), headerPut(), isPart(), Spec_s::line, Spec_s::lineNum, lookupPackage(), name, optionsTable, _HE_s::p, parseRCPOT(), PART_NAME, PART_NONE, PART_POST, PART_POSTTRANS, PART_POSTUN, PART_PRE, PART_PRETRANS, PART_PREUN, PART_SANITYCHECK, PART_SUBNAME, PART_TRIGGERIN, PART_TRIGGERPOSTTRANSIN, PART_TRIGGERPOSTTRANSUN, PART_TRIGGERPOSTUN, PART_TRIGGERPREIN, PART_TRIGGERPRETRANSIN, PART_TRIGGERPRETRANSUN, PART_TRIGGERUN, PART_VERIFYSCRIPT, Package_s::postInFile, Package_s::postTransFile, Package_s::postUnFile, Package_s::preInFile, Package_s::preTransFile, Package_s::preUnFile, prog, readLine(), RPM_STRING_ARRAY_TYPE, RPM_STRING_TYPE, rpmExpandNumeric(), rpmiobAppend(), rpmiobFree(), rpmiobNew(), rpmiobRTrim(), rpmiobStr(), rpmlibNeedsFeature(), rpmlog(), RPMLOG_ERR, rpmluaCheckScript(), RPMRC_FAIL, RPMRC_OK, RPMTAG_POSTIN, RPMTAG_POSTINPROG, RPMTAG_POSTTRANS, RPMTAG_POSTTRANSPROG, RPMTAG_POSTUN, RPMTAG_POSTUNPROG, RPMTAG_PREIN, RPMTAG_PREINPROG, RPMTAG_PRETRANS, RPMTAG_PRETRANSPROG, RPMTAG_PREUN, RPMTAG_PREUNPROG, RPMTAG_REQUIRENAME, RPMTAG_SANITYCHECK, RPMTAG_SANITYCHECKPROG, RPMTAG_TRIGGERIN, RPMTAG_TRIGGERPOSTTRANSIN, RPMTAG_TRIGGERPOSTTRANSUN, RPMTAG_TRIGGERPOSTUN, RPMTAG_TRIGGERPREIN, RPMTAG_TRIGGERPRETRANSIN, RPMTAG_TRIGGERPRETRANSUN, RPMTAG_TRIGGERSCRIPTPROG, RPMTAG_TRIGGERSCRIPTS, RPMTAG_TRIGGERUN, RPMTAG_VERIFYSCRIPT, RPMTAG_VERIFYSCRIPTPROG, Package_s::sanityCheckFile, SO_EXT, rpmDataType_u::str, STRIP_NOTHING, _HE_s::t, _HE_s::tag, Package_s::verifyFile, and xstrdup().

Referenced by parseSpec().

§ parseSpec()

int parseSpec ( rpmts  ts,
const char *  specFile,
const char *  rootURL,
int  recursing,
const char *  passPhrase,
const char *  cookie,
int  anyarch,
int  force,
int  verify 
)

Parse spec file into spec control structure.

Parameters
tstransaction set (spec file control in ts->spec)
specFile
rootURL
recursingparse is recursive?
passPhrase
cookie
anyarch
force
verify
Returns

Definition at line 527 of file parseSpec.c.

References _, _free(), addMacro(), alloca(), Spec_s::anyarch, Spec_s::BACount, Spec_s::BANames, Spec_s::BASpecs, _HE_s::c, closeSpec(), Spec_s::cookie, delMacro(), Package_s::ds, OpenFileInfo::fileName, Spec_s::fileStack, Spec_s::force, freeSpec(), genSourceRpmName(), Package_s::header, headerGet(), headerIsEntry(), headerPut(), Spec_s::macros, newOpenFileInfo(), newSpec(), Package_s::next, Package_s::noarch, _HE_s::p, Spec_s::packages, parseBuildInstallClean(), parseChangelog(), parseDescription(), parseFiles(), parsePreamble(), parsePrep(), parseScript(), parseSpec(), PART_ARBITRARY, PART_BUILD, PART_BUILDARCHITECTURES, PART_CHANGELOG, PART_CHECK, PART_CLEAN, PART_DESCRIPTION, PART_FILES, PART_INSTALL, PART_LAST, PART_NONE, PART_POST, PART_POSTTRANS, PART_POSTUN, PART_PRE, PART_PREAMBLE, PART_PREP, PART_PRETRANS, PART_PREUN, PART_SANITYCHECK, PART_TRIGGERIN, PART_TRIGGERPOSTTRANSIN, PART_TRIGGERPOSTTRANSUN, PART_TRIGGERPOSTUN, PART_TRIGGERPREIN, PART_TRIGGERPRETRANSIN, PART_TRIGGERPRETRANSUN, PART_TRIGGERUN, PART_VERIFYSCRIPT, Spec_s::passPhrase, platform, rpmDataType_u::ptr, Spec_s::recursing, RMIL_RPMRC, RMIL_SPEC, Spec_s::rootURL, RPM_STRING_TYPE, rpmdsThis(), rpmExpand(), rpmExpandNumeric(), rpmGetPath(), rpmlog(), RPMLOG_ERR, RPMRC_FAIL, RPMSENSE_EQUAL, RPMTAG_ARCH, RPMTAG_DESCRIPTION, RPMTAG_NVRA, RPMTAG_OS, RPMTAG_PLATFORM, RPMTAG_REQUIRENAME, RPMTAG_SOURCERPM, rpmtsSetSpec(), Spec_s::sourceRpmName, Spec_s::specFile, rpmDataType_u::str, _HE_s::t, _HE_s::tag, Spec_s::timeCheck, Spec_s::toplevel, xcalloc(), and xstrdup().

Referenced by _specQuery(), parseSpec(), rpmts_parse_spec(), and spec_Parse().

§ processBinaryFiles()

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

Post-build processing for binary package(s).

Parameters
specspec file control structure
installSpecialDoc
testdon't execute scripts or package if testing
Returns
RPMRC_OK on success

Definition at line 3144 of file files.c.

References _, _free(), alloca(), checkDuplicateFiles(), checkUnpackagedFiles(), checkUnpackagedSubdirs(), Package_s::fileList, Package_s::header, headerGet(), headerMacrosLoad(), headerMacrosUnload(), Package_s::next, _HE_s::p, Spec_s::packages, processPackageFiles(), processScriptFiles(), providePackageNVR(), rpmDataType_u::ptr, rpmExpand(), rpmExpandNumeric(), rpmfcGenerateDepends(), rpmlog(), RPMLOG_NOTICE, RPMRC_FAIL, RPMRC_OK, RPMTAG_NVRA, rpmDataType_u::str, and _HE_s::tag.

Referenced by buildSpec().

§ processScriptFiles()

rpmRC processScriptFiles ( Spec  spec,
Package  pkg 
)

§ processSourceFiles()

int processSourceFiles ( Spec  spec)

§ providePackageNVR()

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
hheader

Definition at line 452 of file pack.c.

References _free(), alloca(), _HE_s::append, rpmDataType_u::argv, _HE_s::c, headerGet(), headerNEVRA(), headerPut(), _HE_s::p, rpmDataType_u::ptr, RPM_STRING_ARRAY_TYPE, RPM_UINT32_TYPE, RPMSENSE_EQUAL, RPMTAG_DISTEPOCH, RPMTAG_EPOCH, RPMTAG_PROVIDEFLAGS, RPMTAG_PROVIDENAME, RPMTAG_PROVIDEVERSION, stpcpy(), rpmDataType_u::str, _HE_s::t, _HE_s::tag, and rpmDataType_u::ui32p.

Referenced by processBinaryFiles().

§ readLine()

int readLine ( Spec  spec,
rpmStripFlags  strip 
)

§ rpmlibNeedsFeature()

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

Add rpmlib feature dependency.

Parameters
hheader
featurerpm feature name (i.e. "rpmlib(Foo)" for feature Foo)
featureEVRrpm feature epoch/version/release
Returns
0 always

Definition at line 258 of file reqprov.c.

References addReqProv(), alloca(), RPMSENSE_EQUAL, RPMSENSE_LESS, RPMTAG_REQUIRENAME, and stpcpy().

Referenced by genCpioListAndHeader(), getDigestAlgo(), parseScript(), processPackageFiles(), and writeRPM().

Variable Documentation

§ _rpmbuildFlags

int _rpmbuildFlags

Definition at line 53 of file poptBT.c.

Referenced by genCpioListAndHeader(), newPackage(), packageBinaries(), and rpmlibMarkers().