rpm  5.4.15
Macros | Functions
build.c File Reference

Top-level build dispatcher. More...

#include "system.h"
#include <rpmio.h>
#include <rpmiotypes.h>
#include <rpmcb.h>
#include <rpmurl.h>
#include <rpmtypes.h>
#include <rpmtag.h>
#include <rpmbuild.h>
#include "rpmps.h"
#include "rpmte.h"
#include "rpmts.h"
#include "build.h"
#include <rpmcli.h>
#include "debug.h"
#include <rpmio_internal.h>
#include <rpmsq.h>
#include "signature.h"
Include dependency graph for build.c:

Go to the source code of this file.

Macros

#define QVA_ISSET(_qvaflags, _FLAG)   ((_qvaflags) & (VERIFY_##_FLAG))
 
#define VSF_ISSET(_vsflags, _FLAG)   ((_vsflags) & (RPMVSF_##_FLAG))
 
#define VSF_SET(_vsflags, _FLAG)   (_vsflags) |= (RPMVSF_##_FLAG)
 
#define VSF_CLR(_vsflags, _FLAG)   (_vsflags) &= ~(RPMVSF_##_FLAG)
 
#define _anyarch(_f)   (((_f)&(RPMBUILD_PREP|RPMBUILD_BUILD|RPMBUILD_INSTALL|RPMBUILD_PACKAGEBINARY)) == 0)
 
#define buildCleanMask   (RPMBUILD_RMSOURCE|RPMBUILD_RMSPEC)
 
#define _RPMBC_INTERNAL
 
#define _RPMTAG_INTERNAL
 

Functions

static int checkSpec (rpmts ts, Header h)
 
static int isSpecFile (const char *specfile)
 
static int buildForTarget (rpmts ts, BTA_t ba)
 
int build (rpmts ts, BTA_t ba, const char *rcfile)
 
const char * getSourceDir (rpmfileAttrs attr)
 Return the macro directory location from source file flags. More...
 
static void doRmSource (Spec spec)
 
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 buildSpec (rpmts ts, Spec spec, int what, int test)
 Build stages state machine driver. More...
 

Detailed Description

Top-level build dispatcher.

Definition in file build.c.

Macro Definition Documentation

#define _anyarch (   _f)    (((_f)&(RPMBUILD_PREP|RPMBUILD_BUILD|RPMBUILD_INSTALL|RPMBUILD_PACKAGEBINARY)) == 0)
#define _RPMBC_INTERNAL

Definition at line 8 of file build.c.

#define _RPMTAG_INTERNAL

Definition at line 13 of file build.c.

#define buildCleanMask   (RPMBUILD_RMSOURCE|RPMBUILD_RMSPEC)
#define QVA_ISSET (   _qvaflags,
  _FLAG 
)    ((_qvaflags) & (VERIFY_##_FLAG))
#define VSF_CLR (   _vsflags,
  _FLAG 
)    (_vsflags) &= ~(RPMVSF_##_FLAG)
#define VSF_ISSET (   _vsflags,
  _FLAG 
)    ((_vsflags) & (RPMVSF_##_FLAG))
#define VSF_SET (   _vsflags,
  _FLAG 
)    (_vsflags) |= (RPMVSF_##_FLAG)

Function Documentation

int build ( rpmts  ts,
BTA_t  ba,
const char *  rcfile 
)

Definition at line 281 of file build.c.

References _, rpmlog(), RPMLOG_ERR, and RPMRC_FAIL.

Referenced by main().

static int buildForTarget ( rpmts  ts,
BTA_t  ba 
)
static

Definition at line 122 of file build.c.

rpmRC buildSpec ( rpmts  ts,
Spec  spec,
int  what,
int  test 
)
static int checkSpec ( rpmts  ts,
Header  h 
)
static

Definition at line 53 of file build.c.

static void doRmSource ( Spec  spec)
static
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(), i, op, Spec_s::prep, Spec_s::rootURL, RPMBUILD_PREP, rpmGenPath(), and RPMSCRIPT_PREP.

Referenced by buildSpec(), and processPackageFiles().

const char* getSourceDir ( rpmfileAttrs  attr)

Return the macro directory location from source file flags.

Parameters
attrrpmfileAttrs from source
Returns
string containings macros about location, NULL on failure

Definition at line 24 of file build.c.

References _free(), F_OK, RPMFILE_ICON, RPMFILE_PATCH, RPMFILE_SOURCE, and rpmGetPath().

Referenced by addSource(), doRmSource(), doUntar(), initSourceHeader(), and prepFetch().

static int isSpecFile ( const char *  specfile)
static

Definition at line 80 of file build.c.