rpm
5.2.1
|
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"
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 | PART_BASE 100 |
Spec file parser states. | |
Typedefs | |
typedef enum rpmBuildFlags_e | rpmBuildFlags |
Bit(s) to control buildSpec() operation. | |
typedef enum rpmParseState_e | rpmParseState |
typedef enum rpmStripFlags_e | rpmStripFlags |
Spec file parser stripping flags. | |
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_SANITYCHECK = 32+ 100, PART_ARBITRARY = 33+ 100, PART_LAST = 34+ 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. | |
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. | |
rpmuint32_t * | getBuildTime (void) |
Return build time stamp. | |
int | readLine (Spec spec, rpmStripFlags 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 (Spec spec) |
Check line for section separator, return next parser state. | |
int | parseNum (const char *line, rpmuint32_t *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. | |
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. | |
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. | |
rpmRC | doScript (Spec spec, int what, const char *name, rpmiob iob, int test) |
Run a build script, assembled from spec file scriptlet section. | |
rpmRC | 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, rpmuint32_t index) |
Add dependency to header, filtering duplicates. | |
rpmRC | 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. | |
rpmRC | processBinaryFiles (Spec spec, int installSpecialDoc, int test) |
Post-build processing for binary package(s). | |
int | initSourceHeader (Spec spec, rpmiob *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, const char *cookie, int anyarch, int force, int verify) |
Parse spec file into spec control structure. | |
rpmRC | buildSpec (rpmts ts, Spec spec, int what, int test) |
Build stages state machine driver. | |
rpmRC | packageBinaries (Spec spec) |
Generate binary package(s). | |
rpmRC | packageSources (Spec spec) |
Generate source package. | |
Variables | |
int | _rpmbuildFlags |
This is the *only* module users of librpmbuild should need to include.
Definition in file rpmbuild.h.
#define PART_NAME 1 |
Definition at line 49 of file rpmbuild.h.
Referenced by parseDescription(), parseFiles(), parseScript(), and parseSimplePart().
#define PART_SUBNAME 0 |
Definition at line 48 of file rpmbuild.h.
Referenced by lookupPackage(), parseDescription(), parseFiles(), parsePreamble(), parseScript(), and parseSimplePart().
#define SKIPNONSPACE | ( | s | ) | { while (*(s) && !xisspace(*(s))) (s)++; } |
Definition at line 46 of file rpmbuild.h.
Referenced by handlePreambleTag(), matchTok(), and readLine().
#define SKIPSPACE | ( | s | ) | { while (*(s) && xisspace(*(s))) (s)++; } |
Definition at line 45 of file rpmbuild.h.
Referenced by addSource(), findPreambleTag(), handleComments(), handlePreambleTag(), matchTok(), parseForAttr(), parseForConfig(), parseForDev(), parseForLang(), parseForVerify(), parsePreamble(), processPackageFiles(), processSourceFiles(), and readLine().
typedef enum rpmParseState_e rpmParseState |
enum rpmParseState_e |
Definition at line 55 of file rpmbuild.h.
Append files (if any) to scriptlet tags.
spec | spec file control structure |
pkg | package control structure |
Definition at line 212 of file pack.c.
References _, addFileToArrayTag(), addFileToTag(), alloca(), _HE_s::append, rpmDataType_u::argv, _HE_s::c, TriggerFileEntry::fileName, Package_s::header, headerPut(), TriggerFileEntry::next, _HE_s::p, Package_s::postInFile, Package_s::postTransFile, Package_s::postUnFile, Package_s::preInFile, Package_s::preTransFile, Package_s::preUnFile, TriggerFileEntry::prog, RPM_STRING_ARRAY_TYPE, rpmlog(), RPMLOG_ERR, RPMRC_FAIL, RPMRC_OK, Package_s::sanityCheckFile, TriggerFileEntry::script, _HE_s::t, _HE_s::tag, 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.
h | header |
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, stpcpy(), rpmDataType_u::str, _HE_s::t, _HE_s::tag, and rpmDataType_u::ui32p.
Referenced by processBinaryFiles().
int _rpmbuildFlags |
Definition at line 57 of file poptBT.c.
Referenced by genCpioListAndHeader(), newPackage(), packageBinaries(), and rpmlibMarkers().