# build.c File Reference

`#include "system.h"`
`#include <rpmcli.h>`
`#include <rpmbuild.h>`
`#include "build.h"`
`#include "debug.h"`

Go to the source code of this file.

## Defines

#define | _anyarch(_f) (((_f)&(RPMBUILD_PREP|RPMBUILD_BUILD|RPMBUILD_INSTALL|RPMBUILD_PACKAGEBINARY)) == 0)
#define | buildCleanMask (RPMBUILD_RMSOURCE|RPMBUILD_RMSPEC)

## Functions

int | checkSpec (Header h)
int | isSpecFile (const char *specfile)
int | buildForTarget (const char *arg, BTA_t ba, const char *passPhrase, char *cookie)
int | build (const char *arg, BTA_t ba, const char *passPhrase, char *cookie, const char *rcfile)

## Define Documentation

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

| Referenced by buildForTarget().

#define buildCleanMask (RPMBUILD_RMSOURCE|RPMBUILD_RMSPEC)

| Referenced by build().

## Function Documentation

int build | ( | const char * | arg,
|  | BTA_t | ba,
|  | const char * | passPhrase,
|  | char * | cookie,
|  | const char * | rcfile
| ) |

| Definition at line 301 of file build.c. References _, alloca(), BTA_t, rpmBuildArguments_s::buildAmount, buildCleanMask, buildForTarget(), rpmFreeMacros(), rpmReadConfigFiles(), and rpmBuildArguments_s::targets. Referenced by main().

int buildForTarget | ( | const char * | arg,
|  | BTA_t | ba,
|  | const char * | passPhrase,
|  | char * | cookie
| ) | `[static]`

Definition at line 108 of file build.c.

References _, _anyarch, _free(), addMacro(), alloca(), BTA_t, rpmBuildArguments_s::buildAmount, rpmBuildArguments_s::buildMode, rpmBuildArguments_s::buildRootOverride, buildSpec(), checkSpec(), COMPRESSED_OTHER, rpmBuildArguments_s::force, freeSpec(), initSourceHeader(), isCompressed(), isSpecFile(), rpmBuildArguments_s::noBuild, rpmBuildArguments_s::noDeps, parseSpec(), RMIL_TARBALL, rpmBuildArguments_s::rootdir, RPM_MACHTABLE_BUILDARCH, RPM_MACHTABLE_BUILDOS, rpmCompressedMagic, RPMERR_BADSPEC, RPMERR_NOTREG, RPMERR_POPEN, RPMERR_READ, RPMERR_RENAME, RPMERR_STAT, rpmError, rpmGenPath(), rpmGetPath(), rpmSetTables(), SpecStruct::sourceHeader, Spec, Stat(), Unlink(), URL_IS_DASH, and urlPath().

Referenced by build().

int isSpecFile | ( | const char * | specfile | ) | `[static]`

| Definition at line 69 of file build.c. References _, Fclose(), FD_t, Ferror(), Fopen(), Fread(), Fstrerror(), RPMERR_OPEN, and rpmError. Referenced by buildForTarget().