build/pack.c File Reference

Assemble components of an RPM package. More...

#include "system.h"
#include <rpmio_internal.h>
#include <rpmbuild.h>
#include "signature.h"
#include "cpio.h"
#include "fsm.h"
#include "buildio.h"
#include <pkgio.h>
#include "debug.h"
Include dependency graph for pack.c:

Go to the source code of this file.

Defines

#define _RPMFI_INTERNAL
#define _RPMEVR_INTERNAL
#define _RPMTAG_INTERNAL

Functions

static int genSourceRpmName (Spec spec)
static rpmRC cpio_doio (FD_t fdo, Header h, CSA_t csa, const char *payload_format, const char *fmodeMacro)
static rpmRC cpio_copy (FD_t fdo, CSA_t csa)
static StringBuf addFileToTagAux (Spec spec, const char *file, StringBuf sb)
static int addFileToTag (Spec spec, const char *file, Header h, rpmTag tag)
static int addFileToArrayTag (Spec spec, const char *file, Header h, int tag)
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.
rpmRC writeRPM (Header *hdrp, unsigned char **pkgidp, const char *fileName, CSA_t csa, char *passPhrase, const char **cookie)
 Write rpm package to file.
static int rpmlibMarkers (Header h)
rpmRC packageBinaries (Spec spec)
 Generate binary package(s).
rpmRC packageSources (Spec spec)
 Generate source package.

Variables

static uint32_t copyTags []

Detailed Description

Assemble components of an RPM package.

Definition in file pack.c.


Define Documentation

#define _RPMEVR_INTERNAL

Definition at line 10 of file pack.c.

#define _RPMFI_INTERNAL

Definition at line 9 of file pack.c.

#define _RPMTAG_INTERNAL

Definition at line 11 of file pack.c.


Function Documentation

static int addFileToArrayTag ( Spec  spec,
const char *  file,
Header  h,
int  tag 
) [static]
static int addFileToTag ( Spec  spec,
const char *  file,
Header  h,
rpmTag  tag 
) [static]
static StringBuf addFileToTagAux ( Spec  spec,
const char *  file,
StringBuf  sb 
) [static]
static rpmRC cpio_copy ( FD_t  fdo,
CSA_t  csa 
) [static]
static rpmRC cpio_doio ( FD_t  fdo,
Header  h,
CSA_t  csa,
const char *  payload_format,
const char *  fmodeMacro 
) [static]
static int genSourceRpmName ( Spec  spec  )  [inline, static]
rpmRC processScriptFiles ( Spec  spec,
Package  pkg 
)
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.

Parameters:
h header

Definition at line 463 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(), _HE_s::t, _HE_s::tag, and rpmDataType_u::ui32p.

Referenced by processBinaryFiles().

static int rpmlibMarkers ( Header  h  )  [static]
rpmRC writeRPM ( Header hdrp,
unsigned char **  pkgidp,
const char *  fileName,
CSA_t  csa,
char *  passPhrase,
const char **  cookie 
)

Write rpm package to file.

Warning:
The first argument (header) is now passed by reference in order to return a reloaded contiguous header to the caller.
Return values:
*hdrp header to write (final header is returned).
*pkgidp header+payload MD5 of package (NULL to disable).
Parameters:
fileName file name of package
csa 
passPhrase 
Return values:
cookie generated cookie (i.e build host/time)
Returns:
RPMRC_OK on success

Definition at line 588 of file pack.c.

References _, _free(), alloca(), buildHost(), _HE_s::c, cpio_copy(), cpio_doio(), cpioSourceArchive_s::cpioArchiveSize, cpioSourceArchive_s::cpioFdIn, cpioSourceArchive_s::cpioList, Fclose(), fdFiniDigest(), fdInitDigest(), Ferror(), Fflush(), Fileno(), Fopen(), Fread(), Fstrerror(), Fwrite(), getBuildTime(), headerFree(), headerGet(), headerIsEntry(), headerLink(), headerMergeLegacySigs(), headerNEVRA(), headerNew(), headerPut(), headerReload(), _HE_s::p, PGPHASHALGO_SHA1, rpmDataType_u::ptr, RPM_BIN_TYPE, RPM_STRING_TYPE, RPM_UINT32_TYPE, rpmAddSignature(), rpmExpand(), rpmlibNeedsFeature(), rpmlog(), RPMLOG_ERR, RPMLOG_NOTICE, rpmpkgRead(), rpmpkgSizeof(), rpmpkgWrite(), RPMRC_FAIL, RPMRC_OK, RPMSIGTAG_GPG, RPMSIGTAG_MD5, RPMSIGTAG_PAYLOADSIZE, RPMSIGTAG_SHA1, RPMSIGTAG_SIZE, RPMTAG_HEADERIMMUTABLE, RPMTAG_HEADERSIGNATURES, rpmTempFile(), rpmDataType_u::str, _HE_s::t, _HE_s::tag, rpmDataType_u::ui32p, rpmDataType_u::ui8p, Unlink(), and xstrdup().

Referenced by packageBinaries(), and packageSources().


Variable Documentation

uint32_t copyTags[] [static]
Initial value:
 {
    RPMTAG_CHANGELOGTIME,
    RPMTAG_CHANGELOGNAME,
    RPMTAG_CHANGELOGTEXT,
    0
}

Definition at line 995 of file pack.c.

Generated on Fri Feb 26 01:53:33 2010 for rpm by  doxygen 1.6.3