Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

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>

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
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)
}
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_DESCRIPTION = 12, PART_CHANGELOG = 13, PART_TRIGGERIN = 14, PART_TRIGGERUN = 15,
  PART_VERIFYSCRIPT = 16, PART_BUILDARCHITECTURES = 17, PART_TRIGGERPOSTUN = 18, PART_LAST = 19
}

Functions

void freeNames (void)
const char * getUname (uid_t uid)
const char * getUnameS (const char *uname)
uid_t getUidS (const char *uname)
const char * getGname (gid_t gid)
const char * getGnameS (const char *gname)
gid_t getGidS (const char *gname)
const char *const buildHost (void)
int_32 *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, rpmsenseFlags 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 lookupPackage (Spec spec, const char *name, int flag, Package *pkg)
Package newPackage (Spec spec)
Package freePackages (Package packages)
Package freePackage (Package pkg)
int addReqProv (Spec spec, Header h, rpmsenseFlags 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 (rpmts ts, const char *specFile, const char *rootURL, const char *buildRootURL, int recursing, const char *passPhrase, char *cookie, int anyarch, int force)
int buildSpec (rpmts ts, Spec spec, int what, int test)
int packageBinaries (Spec spec)
int packageSources (Spec spec)


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 addChangelog(), dateToTimet(), handlePreambleTag(), matchTok(), and readLine().

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

Definition at line 43 of file rpmbuild.h.

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

#define STRIP_COMMENTS   (1 << 1)
 

Definition at line 77 of file rpmbuild.h.

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

#define STRIP_NOTHING   0
 

Definition at line 75 of file rpmbuild.h.

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

#define STRIP_TRAILINGSPACE   (1 << 0)
 

Definition at line 76 of file rpmbuild.h.

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


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.

References headerAddEntry(), headerAppendEntry(), headerIsEntry(), int_32, RPM_INT32_TYPE, RPM_STRING_ARRAY_TYPE, RPMTAG_CHANGELOGNAME, RPMTAG_CHANGELOGTEXT, and RPMTAG_CHANGELOGTIME.

Referenced by addChangelog(), and headerInject().

int addReqProv Spec    spec,
Header    h,
rpmsenseFlags    depFlags,
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.

References _ALL_REQUIRES_MASK, headerAddOrAppendEntry(), HFD_t, HGE_t, RPM_INT32_TYPE, RPM_STRING_ARRAY_TYPE, RPMSENSE_ANY, RPMSENSE_CONFLICTS, RPMSENSE_FIND_PROVIDES, RPMSENSE_OBSOLETES, RPMSENSE_PREREQ, RPMSENSE_PROVIDES, RPMSENSE_SENSEMASK, RPMSENSE_TRIGGER, rpmsenseFlags, rpmTag, RPMTAG_CONFLICTFLAGS, RPMTAG_CONFLICTNAME, RPMTAG_CONFLICTVERSION, RPMTAG_OBSOLETEFLAGS, RPMTAG_OBSOLETENAME, RPMTAG_OBSOLETEVERSION, RPMTAG_PROVIDEFLAGS, RPMTAG_PROVIDENAME, RPMTAG_PROVIDEVERSION, RPMTAG_REQUIREFLAGS, RPMTAG_REQUIRENAME, RPMTAG_REQUIREVERSION, RPMTAG_TRIGGERFLAGS, RPMTAG_TRIGGERINDEX, RPMTAG_TRIGGERNAME, RPMTAG_TRIGGERVERSION, and rpmTagType.

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

const char* const buildHost void   
 

Return build hostname.

Returns:
build hostname

Definition at line 196 of file names.c.

References _, RPMMESS_WARNING, and rpmMessage.

Referenced by headerInject(), and writeRPM().

int buildSpec rpmts    ts,
Spec    spec,
int    what,
int    test
 

Build stages state machine driver.

Parameters:
ts  transaction set
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 273 of file build.c.

References _, Spec_s::BACount, Spec_s::BASpecs, doRmSource(), doScript(), packageBinaries(), packageSources(), processBinaryFiles(), processSourceFiles(), Spec_s::recursing, RPMBUILD_BUILD, RPMBUILD_CHECK, RPMBUILD_CLEAN, RPMBUILD_FILECHECK, RPMBUILD_INSTALL, RPMBUILD_PACKAGEBINARY, RPMBUILD_PACKAGESOURCE, RPMBUILD_PREP, RPMBUILD_RMBUILD, RPMBUILD_RMSOURCE, RPMBUILD_RMSPEC, rpmlogGetNrecs(), rpmlogPrint(), RPMMESS_NORMAL, rpmMessage, rpmts, Spec_s::specFile, and Unlink().

Referenced by buildForTarget().

void closeSpec Spec    spec
 

Stop reading from spec file, freeing resources.

Parameters:
spec  spec file control structure

Definition at line 376 of file parseSpec.c.

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

Referenced by 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 56 of file build.c.

References _, _free(), addMacro(), argv, Spec_s::build, Spec_s::buildSubdir, Spec_s::check, Spec_s::clean, delMacro(), errno, Fclose(), fdGetFp(), Fdopen(), Ferror(), Fileno(), getStringBuf(), urlinfo_s::host, Spec_s::install, Spec_s::macros, makeTempFile(), poptParseArgvString(), Spec_s::prep, RMIL_SPEC, Spec_s::rootURL, RPMBUILD_BUILD, RPMBUILD_CHECK, RPMBUILD_CLEAN, RPMBUILD_INSTALL, RPMBUILD_PREP, RPMBUILD_RMBUILD, RPMBUILD_STRINGBUF, RPMERR_SCRIPT, rpmError, rpmExpand(), rpmGenPath(), RPMMESS_NORMAL, rpmMessage, strerror(), Unlink(), URL_IS_FTP, URL_IS_HTTP, URL_IS_PATH, URL_IS_UNKNOWN, urlPath(), urlSplit(), and urlinfo_s::urltype.

Referenced by buildSpec(), and processPackageFiles().

void freeNames void   
 

Destroy uid/gid caches.

Definition at line 30 of file names.c.

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

Referenced by main().

int_32* const getBuildTime void   
 

Return build time stamp.

Returns:
build time stamp

Definition at line 184 of file names.c.

References int_32.

Referenced by headerInject(), and writeRPM().

gid_t getGidS const char *    gname
 

Return cached group id.

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

Definition at line 161 of file names.c.

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

Referenced by genCpioListAndHeader().

const char* getGname gid_t    gid
 

Return cached group name from group id.

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

Definition at line 113 of file names.c.

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

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

const char* getGnameS const char *    gname
 

Return cached group name.

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

Definition at line 137 of file names.c.

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

Referenced by addFile().

uid_t getUidS const char *    uname
 

Return cached user id.

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

Definition at line 89 of file names.c.

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

Referenced by genCpioListAndHeader().

const char* getUname uid_t    uid
 

Return cached user name from user id.

Todo:
Implement using hash.
Parameters:
uid  user 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(), headerInject(), and processSourceFiles().

const char* getUnameS const char *    uname
 

Return cached user name.

Todo:
Implement using hash.
Parameters:
uname  user 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().

void handleComments char *    s
 

Truncate comment lines.

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

Definition at line 108 of file parseSpec.c.

References SKIPSPACE.

Referenced by copyNextLine(), and processPackageFiles().

void initSourceHeader Spec    spec
 

Create and initialize header for source package.

Parameters:
spec  spec file control structure

Definition at line 2153 of file files.c.

References Spec_s::BACount, Spec_s::BANames, Spec_s::buildRestrictions, Package_s::header, HEADER_I18NTABLE, headerAddEntry(), headerFreeData(), headerFreeIterator(), headerInitIterator(), headerNew(), headerNextIterator(), int_32, Spec_s::packages, RPM_STRING_ARRAY_TYPE, RPMTAG_ARCH, RPMTAG_BUILDARCHS, RPMTAG_CHANGELOGNAME, RPMTAG_CHANGELOGTEXT, RPMTAG_CHANGELOGTIME, RPMTAG_DESCRIPTION, RPMTAG_DISTRIBUTION, RPMTAG_DISTURL, RPMTAG_EPOCH, RPMTAG_GROUP, RPMTAG_LICENSE, RPMTAG_NAME, RPMTAG_OS, RPMTAG_PACKAGER, RPMTAG_RELEASE, RPMTAG_SUMMARY, RPMTAG_URL, RPMTAG_VENDOR, RPMTAG_VERSION, and Spec_s::sourceHeader.

Referenced by 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 58 of file parseSpec.c.

References initParts(), PartRec::len, PartRec::part, PART_NONE, partList, rpmParseState, PartRec::token, xisspace(), and xstrncasecmp().

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

int packageBinaries Spec    spec
 

Generate binary package(s).

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

Definition at line 742 of file pack.c.

References _, _free(), Spec_s::cookie, copyTags, Package_s::cpioList, errno, fdFree, fdNew, Package_s::fileList, genSourceRpmName(), Package_s::header, headerAddEntry(), headerCopyTags(), headerNVR(), headerSprintf(), Mkdir(), Package_s::next, Spec_s::packages, Spec_s::passPhrase, processScriptFiles(), providePackageNVR(), RPM_BIN_TYPE, RPM_INT32_TYPE, RPM_STRING_TYPE, RPMERR_BADFILENAME, rpmError, rpmExpand(), rpmfiFree(), rpmfiLink, rpmGetPath(), RPMLEAD_BINARY, RPMTAG_BUILDHOST, RPMTAG_BUILDTIME, RPMTAG_COOKIE, RPMTAG_OPTFLAGS, RPMTAG_RPMVERSION, RPMTAG_SOURCEPKGID, RPMTAG_SOURCERPM, Spec_s::sourcePkgId, Spec_s::sourceRpmName, Stat(), strerror(), VERSION, and writeRPM().

Referenced by buildSpec().

int packageSources Spec    spec
 

Generate source package.

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

Definition at line 849 of file pack.c.

References _free(), Spec_s::cookie, fdFree, fdNew, genSourceRpmName(), headerAddEntry(), Spec_s::passPhrase, RPM_INT32_TYPE, RPM_STRING_TYPE, rpmfiFree(), rpmfiLink, rpmGetPath(), RPMLEAD_SOURCE, RPMTAG_BUILDHOST, RPMTAG_BUILDTIME, RPMTAG_RPMVERSION, Spec_s::sourceCpioList, Spec_s::sourceHeader, Spec_s::sourcePkgId, Spec_s::sourceRpmName, VERSION, and writeRPM().

Referenced by 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 13 of file parseBuildInstallClean.c.

References _, appendStringBuf, Spec_s::build, Spec_s::check, Spec_s::clean, Spec_s::install, isPart(), Spec_s::line, Spec_s::lineNum, newStringBuf(), PART_BUILD, PART_CHECK, PART_CLEAN, PART_INSTALL, PART_NONE, readLine(), RPMERR_BADSPEC, rpmError, rpmParseState, and STRIP_NOTHING.

Referenced by 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 209 of file parseChangelog.c.

References addChangelog(), appendStringBuf, freeStringBuf(), Package_s::header, isPart(), Spec_s::line, newStringBuf(), Spec_s::packages, PART_NONE, readLine(), and STRIP_COMMENTS.

Referenced by 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 29 of file parseDescription.c.

References _, _free(), appendLineStringBuf, argv, freeStringBuf(), Package_s::header, headerAddI18NString(), headerIsEntry(), isPart(), lang, Spec_s::line, Spec_s::lineNum, lookupPackage(), name, newStringBuf(), noLang, PART_NAME, PART_NONE, PART_SUBNAME, POPT_BADOPTION_NOALIAS, poptFreeContext(), poptGetArg(), poptGetContext(), poptGetNextOpt(), poptParseArgvString(), poptPeekArg(), readLine(), RPMBUILD_DEFAULT_LANG, RPMERR_BADSPEC, rpmError, RPMTAG_DESCRIPTION, stashSt(), STRIP_COMMENTS, STRIP_TRAILINGSPACE, stripTrailingBlanksStringBuf(), and spectag_s::t_nlines.

Referenced by 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 678 of file expression.c.

References _, _free(), _value::data, DEBUG, doLogical(), _parseState::nextToken, _parseState::p, rdToken(), RPMERR_BADSPEC, rpmError, _parseState::spec, _parseState::str, TOK_EOF, _parseState::tokenValue, _value::type, valueFree(), and xstrdup().

Referenced by 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 727 of file expression.c.

References _, _free(), _value::data, DEBUG, doLogical(), _parseState::nextToken, _parseState::p, rdToken(), RPMERR_BADSPEC, rpmError, _parseState::spec, _parseState::str, TOK_EOF, _parseState::tokenValue, _value::type, valueFree(), and xstrdup().

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 26 of file parseFiles.c.

References _, _free(), appendStringBuf, argv, file, Package_s::fileFile, Package_s::fileList, isPart(), Spec_s::line, Spec_s::lineNum, lookupPackage(), name, newStringBuf(), PART_NAME, PART_NONE, PART_SUBNAME, POPT_BADOPTION_NOALIAS, poptFreeContext(), poptGetArg(), poptGetContext(), poptGetNextOpt(), poptParseArgvString(), poptPeekArg(), readLine(), RPMERR_BADSPEC, rpmError, rpmGetPath(), and STRIP_COMMENTS.

Referenced by parseSpec().

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 10 of file misc.c.

Referenced by 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 855 of file parsePreamble.c.

References _, Spec_s::anyarch, Spec_s::BANames, Spec_s::buildRootURL, checkForDuplicates(), checkForRequired(), checkForValidArchitectures(), copyTagsDuringParse, fillOutMainPackage(), findPreambleTag(), Spec_s::gotBuildRootURL, handlePreambleTag(), Package_s::header, headerAddEntry(), headerCopyTags(), headerNVR(), int_32, isPart(), Spec_s::line, Spec_s::lineNum, lookupPackage(), newPackage(), Spec_s::packages, parseSimplePart(), PART_BUILDARCHITECTURES, PART_NONE, PART_SUBNAME, readLine(), Spec_s::recursing, RPM_STRING_TYPE, RPMERR_BADSPEC, rpmError, RPMTAG_NAME, SKIPSPACE, STRIP_COMMENTS, and STRIP_TRAILINGSPACE.

Referenced by 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 550 of file parsePrep.c.

References _, appendLineStringBuf, appendStringBuf, doPatchMacro(), doSetupMacro(), Spec_s::force, freeSplitString(), freeStringBuf(), getStringBuf(), isPart(), Spec_s::line, Spec_s::lineNum, newStringBuf(), PART_NONE, Spec_s::prep, readLine(), RPMERR_BADSPEC, rpmError, splitString(), and STRIP_NOTHING.

Referenced by parseSpec().

int parseRCPOT Spec    spec,
Package    pkg,
const char *    field,
int    tag,
int    index,
rpmsenseFlags    tagflags
 

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)
tagflags  dependency flags already known from context
Returns:
0 on success, RPMERR_BADSPEC on failure

Definition at line 35 of file parseReqs.c.

References _, _free(), addReqProv(), Spec_s::buildRestrictions, Package_s::header, Spec_s::line, Spec_s::lineNum, ReqComparisons, RPMERR_BADSPEC, rpmError, rpmExpandNumeric(), rpmlibNeedsFeature(), RPMSENSE_ANY, RPMSENSE_CONFLICTS, RPMSENSE_OBSOLETES, RPMSENSE_PREREQ, RPMSENSE_PROVIDES, RPMSENSE_SENSEMASK, RPMSENSE_TRIGGERIN, RPMSENSE_TRIGGERPOSTUN, RPMSENSE_TRIGGERUN, rpmsenseFlags, RPMTAG_BUILDCONFLICTS, RPMTAG_BUILDPREREQ, RPMTAG_BUILDREQUIRES, RPMTAG_CONFLICTFLAGS, RPMTAG_OBSOLETEFLAGS, RPMTAG_PREREQ, RPMTAG_PROVIDEFLAGS, RPMTAG_REQUIREFLAGS, RPMTAG_TRIGGERIN, RPMTAG_TRIGGERPOSTUN, RPMTAG_TRIGGERUN, ReqComp::sense, SKIPNONWHITE, SKIPWHITE, ReqComp::token, xisalnum(), and xmalloc().

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

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 70 of file parseScript.c.

References _, _free(), addReqProv(), addTriggerIndex(), appendStringBuf, argv, file, freeStringBuf(), getStringBuf(), Package_s::header, headerAddEntry(), headerIsEntry(), isPart(), Spec_s::line, Spec_s::lineNum, lookupPackage(), name, newStringBuf(), parseRCPOT(), PART_NAME, PART_NONE, PART_POST, PART_POSTUN, PART_PRE, PART_PREUN, PART_SUBNAME, PART_TRIGGERIN, PART_TRIGGERPOSTUN, PART_TRIGGERUN, PART_VERIFYSCRIPT, POPT_BADOPTION_NOALIAS, poptFreeContext(), poptGetArg(), poptGetContext(), poptGetNextOpt(), poptParseArgvString(), poptPeekArg(), Package_s::postInFile, Package_s::postUnFile, Package_s::preInFile, Package_s::preUnFile, prog, readLine(), RPM_STRING_ARRAY_TYPE, RPM_STRING_TYPE, RPMERR_BADSPEC, rpmError, rpmlibNeedsFeature(), RPMSENSE_INTERP, RPMSENSE_SCRIPT_POST, RPMSENSE_SCRIPT_POSTUN, RPMSENSE_SCRIPT_PRE, RPMSENSE_SCRIPT_PREUN, RPMSENSE_SCRIPT_VERIFY, RPMTAG_POSTIN, RPMTAG_POSTINPROG, RPMTAG_POSTUN, RPMTAG_POSTUNPROG, RPMTAG_PREIN, RPMTAG_PREINPROG, RPMTAG_PREUN, RPMTAG_PREUNPROG, RPMTAG_TRIGGERIN, RPMTAG_TRIGGERPOSTUN, RPMTAG_TRIGGERSCRIPTPROG, RPMTAG_TRIGGERSCRIPTS, RPMTAG_TRIGGERUN, RPMTAG_VERIFYSCRIPT, RPMTAG_VERIFYSCRIPTPROG, STRIP_NOTHING, stripTrailingBlanksStringBuf(), Package_s::verifyFile, and xstrdup().

Referenced by parseSpec().

int parseSpec rpmts    ts,
const char *    specFile,
const char *    rootURL,
const char *    buildRootURL,
int    recursing,
const char *    passPhrase,
char *    cookie,
int    anyarch,
int    force
 

Parse spec file into spec control structure.

Parameters:
ts  transaction set (spec file control in ts->spec)
specFile 
rootURL 
buildRootURL 
recursing  parse is recursive?
passPhrase 
cookie 
anyarch 
force 
Returns:

Definition at line 396 of file parseSpec.c.

References _, _free(), addMacro(), Spec_s::anyarch, Spec_s::BACount, Spec_s::BANames, Spec_s::BASpecs, Spec_s::buildRootURL, closeSpec(), Spec_s::cookie, delMacro(), Package_s::ds, OpenFileInfo::fileName, Spec_s::fileStack, Spec_s::force, freeSpec(), Spec_s::gotBuildRootURL, Package_s::header, headerAddEntry(), headerIsEntry(), headerNVR(), Spec_s::macros, newOpenFileInfo(), newSpec(), Package_s::next, Spec_s::packages, parseBuildInstallClean(), parseChangelog(), parseDescription(), parseFiles(), parsePreamble(), parsePrep(), parseScript(), PART_BUILD, PART_BUILDARCHITECTURES, PART_CHANGELOG, PART_CHECK, PART_CLEAN, PART_DESCRIPTION, PART_FILES, PART_INSTALL, PART_LAST, PART_NONE, PART_POST, PART_POSTUN, PART_PRE, PART_PREAMBLE, PART_PREP, PART_PREUN, PART_TRIGGERIN, PART_TRIGGERPOSTUN, PART_TRIGGERUN, PART_VERIFYSCRIPT, Spec_s::passPhrase, Spec_s::recursing, RMIL_RPMRC, RMIL_SPEC, Spec_s::rootURL, RPM_MACHTABLE_BUILDARCH, RPM_STRING_TYPE, rpmdsThis(), RPMERR_BADSPEC, rpmError, rpmExpand(), rpmExpandNumeric(), rpmGetArchInfo(), rpmGetMachine(), rpmGetOsInfo(), rpmGetPath(), rpmMachineScore(), rpmParseState, RPMSENSE_EQUAL, rpmSetMachine(), RPMTAG_ARCH, RPMTAG_DESCRIPTION, RPMTAG_OS, RPMTAG_PLATFORM, RPMTAG_REQUIRENAME, RPMTAG_RHNPLATFORM, rpmts, rpmtsSetSpec(), Spec_s::specFile, Spec_s::timeCheck, urlPath(), xcalloc(), and xstrdup().

Referenced by buildForTarget(), and rpmspecQuery().

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 2408 of file files.c.

References _, checkFiles(), Package_s::fileList, freeStringBuf(), Package_s::header, headerNVR(), newStringBuf(), Package_s::next, Spec_s::packages, processPackageFiles(), rpmfcGenerateDepends(), RPMMESS_NORMAL, and rpmMessage.

Referenced by buildSpec().

int processSourceFiles Spec    spec
 

Post-build processing for source package.

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

Definition at line 2216 of file files.c.

References _, _free(), appendLineStringBuf, FileList_s::buildRootURL, FileListRec_s::diskURL, errno, FileList_s::fileList, FileList_s::fileListRecsUsed, FileListRec_s::fileURL, FileListRec_s::fl_st, FileListRec_s::flags, Source::flags, freeFileList(), freeSplitString(), freeStringBuf(), genCpioListAndHeader(), getGname(), getStringBuf(), getUname(), FileListRec_s::gname, headerAddOrAppendEntry(), Package_s::icon, initSourceHeader(), FileListRec_s::langs, newStringBuf(), Package_s::next, Source::next, Source::num, Spec_s::numSources, Spec_s::packages, FileList_s::prefix, FileList_s::processingFailed, RPM_INT32_TYPE, RPM_STRING_ARRAY_TYPE, RPMBUILD_ISNO, RPMBUILD_ISPATCH, RPMBUILD_ISSOURCE, RPMERR_BADSPEC, rpmError, RPMFILE_GHOST, RPMFILE_SPECFILE, rpmGetPath(), RPMTAG_NOPATCH, RPMTAG_NOSOURCE, RPMTAG_PATCH, RPMTAG_SOURCE, RPMVERIFY_ALL, SKIPSPACE, Source::source, Spec_s::sourceCpioList, Spec_s::sourceHeader, Spec_s::sources, Spec_s::specFile, splitString(), Stat(), strerror(), FileList_s::totalFileSize, FileListRec_s::uname, urlPath(), FileListRec_s::verifyFlags, xcalloc(), and xstrdup().

Referenced by 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 194 of file parseSpec.c.

References _, _free(), copyNextLine(), Fclose(), OpenFileInfo::fd, fdGetFp(), Ferror(), Spec_s::fileStack, Fopen(), forceIncludeFile(), Spec_s::line, Spec_s::lineNum, matchTok(), OpenFileInfo::next, ReadLevelEntry::next, parseExpressionBoolean(), ReadLevelEntry::reading, OpenFileInfo::readPtr, Spec_s::readStack, RPMERR_BADSPEC, RPMERR_UNMATCHEDIF, rpmError, rpmExpand(), rpmGetArchInfo(), rpmGetOsInfo(), SKIPNONSPACE, SKIPSPACE, Spec_s::sl, speclines_s::sl_lines, speclines_s::sl_nalloc, speclines_s::sl_nlines, xisspace(), xmalloc(), xrealloc(), and xstrdup().

Referenced by 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 118 of file reqprov.c.

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

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


Generated on Sun Oct 26 13:02:04 2003 for rpm by doxygen1.2.18