8 #define _RPMBC_INTERNAL
13 #define _RPMTAG_INTERNAL
21 #if defined(RPM_VENDOR_OPENPKG)
27 const char * dir =
NULL;
28 #if defined(RPM_VENDOR_OPENPKG)
37 if (access(fn,
F_OK) == 0)
45 dir =
"%{_sourcedir}/";
47 dir =
"%{_patchdir}/";
74 #if defined(RPM_VENDOR_OPENPKG)
91 const char * rootURL = spec->
rootURL;
93 const char * scriptName =
NULL;
94 const char * buildDirURL =
rpmGenPath(rootURL,
"%{_builddir}",
"");
95 const char * buildScript;
96 const char * buildCmd =
NULL;
97 const char * buildTemplate =
NULL;
98 const char * buildPost =
NULL;
99 const char * mTemplate =
NULL;
100 const char * mCmd =
NULL;
101 const char * mPost =
NULL;
121 mTemplate =
"%{__spec_prep_template}";
122 mPost =
"%{__spec_prep_post}";
123 mCmd =
"%{__spec_prep_cmd}";
130 mTemplate =
"%{__spec_build_template}";
131 mPost =
"%{__spec_build_post}";
132 mCmd =
"%{__spec_build_cmd}";
139 mTemplate =
"%{__spec_install_template}";
140 mPost =
"%{__spec_install_post}";
141 mCmd =
"%{__spec_install_cmd}";
148 mTemplate =
"%{__spec_check_template}";
149 mPost =
"%{__spec_check_post}";
150 mCmd =
"%{__spec_check_cmd}";
155 mTemplate =
"%{__spec_clean_template}";
156 mPost =
"%{__spec_clean_post}";
157 mCmd =
"%{__spec_clean_cmd}";
161 mTemplate =
"%{__spec_clean_template}";
162 mPost =
"%{__spec_clean_post}";
163 mCmd =
"%{__spec_clean_cmd}";
170 for (i = 0; i < spec->
nfoo; i++) {
175 iob = spec->
foo[
i].iob;
178 mTemplate =
"%{__spec_track_template}";
179 mPost =
"%{__spec_track_post}";
180 mCmd =
"%{__spec_track_cmd}";
184 mTemplate =
"%{___build_template}";
185 mPost =
"%{___build_post}";
186 mCmd =
"%{___build_cmd}";
204 xfd =
Fdopen(fd,
"w.fpio");
216 if (*rootDir ==
'\0') rootDir =
"/";
223 (
void) fputs(buildTemplate, fp);
232 }
else if (iob !=
NULL)
235 (
void) fputs(buildPost, fp);
244 if (buildDirURL && buildDirURL[0] !=
'/' &&
269 (
void) poptParseArgvString(buildCmd, &argc, &argv);
283 if (!WIFEXITED(status) || WEXITSTATUS(status)) {
291 static unsigned int scale = 1000;
299 #if defined(RPM_VENDOR_OPENPKG)
309 scriptName =
_free(scriptName);
331 buildCmd =
_free(buildCmd);
332 buildTemplate =
_free(buildTemplate);
333 buildPost =
_free(buildPost);
334 buildDirURL =
_free(buildDirURL);
351 for (x = 0; x < spec->
BACount; x++) {
390 if (((what & RPMBUILD_PACKAGESOURCE) && !test) &&
394 if (((what & RPMBUILD_PACKAGEBINARY) && !test) &&
413 #if defined(RPM_VENDOR_OPENPKG)
421 if (what & RPMBUILD_RMSOURCE) {
427 if (what & RPMBUILD_RMSPEC) {
const char * getSourceDir(rpmfileAttrs attr)
Return the macro directory location from source file flags.
rpmRC doScript(Spec spec, int what, const char *name, rpmiob iob, int test)
Run a build script, assembled from spec file scriptlet section.
rpmlog(RPMLOG_ERR,"%s\n", buf)
char * rpmGetPath(const char *path,...)
Return (malloc'ed) expanded, canonicalized, file path.
struct rpmts_s * rpmts
The RPM Transaction Set.
urltype urlType(void *_u)
void addMacro(MacroContext mc, const char *n, const char *o, const char *b, int level)
Add macro to context.
int processSourceFiles(Spec spec)
Post-build processing for source package.
static void doRmSource(Spec spec)
rpmRC packageBinaries(Spec spec)
Generate binary package(s).
pgpDig pgpDigNew(pgpVSFlags vsflags, pgpPubkeyAlgo pubkey_algo)
Create a container for parsed OpenPGP packates.
enum rpmRC_e rpmRC
RPM return codes.
memset(_r, 0, sizeof(*_r))
assert(key->size==sizeof(hdrNum))
int Rmdir(const char *path)
rmdir(2) clone.
fprintf(stderr,"--> %s(%p,%p,%p) sig %p sigp %p\n", __FUNCTION__, dig, t, rsactx, sig, sigp)
int rpmlogGetNrecs(void)
Return number of messages.
int rpmTempFile(const char *prefix, const char **fnptr, void *fdptr)
Return file handle for a temporaray file.
rpmuint32_t sstates[RPMSCRIPT_MAX]
rpmRC processBinaryFiles(Spec spec, int installSpecialDoc, int test)
Post-build processing for binary package(s).
rpmuint32_t smetrics[RPMSCRIPT_MAX]
The FD_t File Handle data structure.
const char * rpmGenPath(const char *urlroot, const char *urlmdir, const char *urlfile)
Merge 3 args into path, any or all of which may be a url.
Generate and verify rpm package signatures.
The structure used to store values parsed from a spec file.
char * rpmExpand(const char *arg,...)
Return (malloc'ed) concatenated macro expansion(s).
int Fclose(FD_t fd)
fclose(3) clone.
Cumulative statistics for an operation.
enum rpmfileAttrs_e rpmfileAttrs
File Attributes.
int Ferror(FD_t fd)
ferror(3) clone.
char * rpmiobStr(rpmiob iob)
Return I/O buffer (as string).
int urlSplit(const char *url, urlinfo *uret)
Parse URL string into a control structure.
return strcmp(ame->name, bme->name)
urltype urlPath(const char *url, const char **pathp)
Return path component of URL.
This is the only module users of librpmbuild should need to include.
int xstrcasecmp(const char *s1, const char *s2)
Locale insensitive strcasecmp(3).
rpmRC packageSources(Spec spec)
Generate source package.
FD_t Fdopen(FD_t ofd, const char *fmode)
static void * fdGetFp(FD_t fd)
int rpmsqExecve(const char **argv)
Execute a command, returning its status.
void rpmlogPrint(FILE *f)
Print all rpmError() messages.
static void
Print copy of spec file, filling in Group/Description/Summary from specspo.
static void * _free(const void *p)
Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
rpmRC buildSpec(rpmts ts, Spec spec, int what, int test)
Build stages state machine driver.
int Unlink(const char *path)
unlink(2) clone.