2 * \file build/parseBuildInstallClean.c
3 * Parse %build/%install/%clean section from spec file.
7 #include <rpm/rpmbuild.h>
8 #include <rpm/rpmlog.h>
12 int parseBuildInstallClean(rpmSpec spec, rpmParseState parsePart)
14 int nextPart, rc, res = PART_ERROR;
15 StringBuf *sbp = NULL;
16 const char *name = NULL;
18 if (parsePart == PART_BUILD) {
21 } else if (parsePart == PART_INSTALL) {
22 sbp = &(spec->install);
24 } else if (parsePart == PART_CHECK) {
27 } else if (parsePart == PART_CLEAN) {
31 goto exit; /* programmer error */
35 rpmlog(RPMLOG_ERR, _("line %d: second %s\n"),
40 *sbp = newStringBuf();
42 /* There are no options to %build, %install, %check, or %clean */
43 if ((rc = readLine(spec, STRIP_NOTHING)) > 0) {
50 while (! (nextPart = isPart(spec->line))) {
51 appendStringBuf(*sbp, spec->line);
52 if ((rc = readLine(spec, STRIP_NOTHING)) > 0) {