Data Structures | |
struct | TriggerFileEntry |
struct | Source |
struct | ReadLevelEntry |
struct | OpenFileInfo |
struct | spectag_s |
struct | spectags_s |
struct | speclines_s |
struct | rpmSpec_s |
The structure used to store values parsed from a spec file. More... | |
struct | Package_s |
The structure used to store values for a package. More... | |
Files | |
file | rpmcli.h |
file | rpmbuild.h |
This is the *only* module users of librpmbuild should need to include. | |
file | rpmfc.h |
Structures and methods for build-time file classification. | |
file | rpmspec.h |
The rpmSpec and Package data structures used during build. | |
Defines | |
#define | PART_BASE 0 |
rpmSpec file parser states. | |
Typedefs | |
typedef enum rpmBuildFlags_e | rpmBuildFlags |
Bit(s) to control buildSpec() operation. | |
typedef struct Package_s * | Package |
typedef struct ReadLevelEntry | RLE_t |
typedef struct OpenFileInfo | OFI_t |
typedef struct spectag_s * | spectag |
typedef struct spectags_s * | spectags |
typedef struct speclines_s * | speclines |
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... | |
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 | rpmCharCheck (rpmSpec spec, char *field, size_t fsize, const char *whitelist) |
Check for inappropriate characters. | |
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 | doRmSource (rpmSpec spec) |
Remove all sources assigned to spec file. | |
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 | checkPackages (char *pkgcheck) |
Check package(s). | |
rpmRC | packageBinaries (rpmSpec spec) |
Generate binary package(s). | |
rpmRC | packageSources (rpmSpec spec) |
Generate source package. | |
rpmSpec | newSpec (void) |
Create and initialize rpmSpec structure. | |
rpmSpec | freeSpec (rpmSpec spec) |
Destroy Spec structure. | |
int | rpmspecQuery (rpmts ts, QVA_t qva, const char *arg) |
Function to query spec file(s). | |
struct OpenFileInfo * | newOpenFileInfo (void) |
spectag | stashSt (rpmSpec spec, Header h, rpmTag tag, const char *lang) |
stashSt. | |
int | addSource (rpmSpec spec, Package pkg, const char *field, rpmTag tag) |
addSource. | |
int | parseNoSource (rpmSpec spec, const char *field, rpmTag tag) |
parseNoSource. |
#define PART_BASE 0 |
typedef struct OpenFileInfo OFI_t |
typedef struct ReadLevelEntry RLE_t |
typedef enum rpmBuildFlags_e rpmBuildFlags |
Bit(s) to control buildSpec() operation.
typedef struct speclines_s * speclines |
typedef struct spectags_s * spectags |
enum rpmBuildFlags_e |
Bit(s) to control buildSpec() operation.
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_RMSPEC |
Remove spec file. |
Definition at line 25 of file rpmbuild.h.
void addChangelogEntry | ( | Header | h, | |
time_t | time, | |||
const char * | name, | |||
const char * | text | |||
) |
Add changelog entry to header.
h | header | |
time | time of change | |
name | person who made the change | |
text | description of change |
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.
spec | spec file control structure | |
h | header | |
tagN | tag, identifies type of dependency | |
N | (e.g. Requires: foo < 0:1.2-3, "foo") | |
EVR | (e.g. Requires: foo < 0:1.2-3, "0:1.2-3") | |
Flags | (e.g. Requires: foo < 0:1.2-3, both "Requires:" and "<") | |
index | (0 always) |
addSource.
spec | spec file control structure | |
pkg | package control | |
field | field to parse | |
tag | tag |
const char* buildHost | ( | void | ) |
Return build hostname.
Build stages state machine driver.
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 |
Referenced by buildForTarget().
rpmRC checkPackages | ( | char * | pkgcheck | ) |
Check package(s).
pkgcheck | program to run |
void closeSpec | ( | rpmSpec | spec | ) |
Stop reading from spec file, freeing resources.
spec | spec file control structure |
Remove all sources assigned to spec file.
spec | spec file control structure |
Referenced by buildForTarget().
rpmRC doScript | ( | rpmSpec | spec, | |
rpmBuildFlags | what, | |||
const char * | name, | |||
StringBuf | sb, | |||
int | test | |||
) |
Run a build script, assembled from spec file scriptlet section.
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 |
void freeNames | ( | void | ) |
Destroy uid/gid caches.
Referenced by main().
Destroy package control structure.
pkg | package control structure |
Destroy all packages associated with spec file.
packages | package control structure chain |
Destroy Spec structure.
spec | spec file control structure |
Referenced by buildForTarget().
rpm_time_t* getBuildTime | ( | void | ) |
Return build time stamp.
gid_t getGidS | ( | const char * | gname | ) |
const char* getGname | ( | gid_t | gid | ) |
Return cached group name from group id.
gid | group id |
const char* getGnameS | ( | const char * | gname | ) |
Return cached group name.
gname | group name |
uid_t getUidS | ( | const char * | uname | ) |
const char* getUname | ( | uid_t | uid | ) |
Return cached user name from user id.
uid | user id |
const char* getUnameS | ( | const char * | uname | ) |
Return cached user name.
uname | user name |
void handleComments | ( | char * | s | ) |
Truncate comment lines.
s | skip white space, truncate line at '#' |
void initSourceHeader | ( | rpmSpec | spec | ) |
Create and initialize header for source package.
spec | spec file control structure |
Referenced by buildForTarget().
rpmParseState isPart | ( | const char * | line | ) |
Check line for section separator, return next parser state.
line | from spec file |
Find sub-package control structure by name.
spec | spec file control structure | |
name | (sub-)package name | |
flag | if PART_SUBNAME, then 1st package name is prepended |
pkg | package control structure |
struct OpenFileInfo* newOpenFileInfo | ( | void | ) | [read] |
Create and initialize package control structure.
spec | spec file control structure |
rpmSpec newSpec | ( | void | ) |
Create and initialize rpmSpec structure.
Generate binary package(s).
spec | spec file control structure |
Generate source package.
spec | spec file control structure |
int parseBuildInstallClean | ( | rpmSpec | spec, | |
rpmParseState | parsePart | |||
) |
Parse %build/%install/%clean section(s) of a spec file.
spec | spec file control structure | |
parsePart | current rpmParseState |
int parseChangelog | ( | rpmSpec | spec | ) |
Parse %changelog section of a spec file.
spec | spec file control structure |
int parseDescription | ( | rpmSpec | spec | ) |
Parse %description section of a spec file.
spec | spec file control structure |
int parseExpressionBoolean | ( | rpmSpec | spec, | |
const char * | expr | |||
) |
Evaluate boolean expression.
spec | spec file control structure | |
expr | expression to parse |
char* parseExpressionString | ( | rpmSpec | spec, | |
const char * | expr | |||
) |
Evaluate string expression.
spec | spec file control structure | |
expr | expression to parse |
int parseFiles | ( | rpmSpec | spec | ) |
Parse %files section of a spec file.
spec | spec file control structure |
parseNoSource.
spec | spec file control structure | |
field | field to parse | |
tag | tag |
int parsePreamble | ( | rpmSpec | spec, | |
int | initialPackage | |||
) |
Parse tags from preamble of a spec file.
spec | spec file control structure | |
initialPackage |
int parsePrep | ( | rpmSpec | spec | ) |
Parse %prep section of a spec file.
spec | spec file control structure |
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.
spec | spec file control structure | |
pkg | package control structure | |
field | text to parse (e.g. "foo < 0:1.2-3, bar = 5:6.7") | |
tagN | tag, identifies type of dependency | |
index | (0 always) | |
tagflags | dependency flags already known from context |
int parseScript | ( | rpmSpec | spec, | |
int | parsePart | |||
) |
Parse %pre et al scriptlets from a spec file.
spec | spec file control structure | |
parsePart | current rpmParseState |
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.
ts | transaction set (spec file control in ts->spec) | |
specFile | ||
rootDir | ||
buildRoot | ||
recursing | parse is recursive? | |
passPhrase | ||
cookie | ||
anyarch | ||
force |
Referenced by buildForTarget().
uint32_t parseUnsignedNum | ( | const char * | line, | |
uint32_t * | res | |||
) |
Parse an unsigned number.
line | from spec file |
res | pointer to uint32_t |
int processBinaryFiles | ( | rpmSpec | spec, | |
int | installSpecialDoc, | |||
int | test | |||
) |
Post-build processing for binary package(s).
spec | spec file control structure | |
installSpecialDoc | ||
test | don't execute scripts or package if testing |
int processSourceFiles | ( | rpmSpec | spec | ) |
Post-build processing for source package.
spec | spec file control structure |
int readLine | ( | rpmSpec | spec, | |
int | strip | |||
) |
Read next line from spec file.
spec | spec file control structure | |
strip | truncate comments? |
Check for inappropriate characters.
All alphanums are considered sane.
spec | spec | |
field | string to check | |
fsize | size of string to check | |
whitelist | string of permitted characters |
int rpmlibNeedsFeature | ( | Header | h, | |
const char * | feature, | |||
const char * | featureEVR | |||
) |
Add rpmlib feature dependency.
h | header | |
feature | rpm feature name (i.e. "rpmlib(Foo)" for feature Foo) | |
featureEVR | rpm feature epoch/version/release |
Function to query spec file(s).
ts | transaction set | |
qva | parsed query/verify options | |
arg | query argument |
Referenced by main().