Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

build/rpmbuild.h

Go to the documentation of this file.
00001 #ifndef _H_RPMBUILD_
00002 #define _H_RPMBUILD_
00003 
00009 #include "rpmlib.h"
00010 
00011 /* and it shouldn't need these :-( */
00012 #include "stringbuf.h"
00013 #include "misc.h"
00014 
00015 /* but this will be needed */
00016 #include "rpmspec.h"
00017 
00021 /*@-typeuse@*/
00022 typedef enum rpmBuildFlags_e {
00023 /*@-enummemuse@*/
00024     RPMBUILD_NONE       = 0,
00025 /*@=enummemuse@*/
00026     RPMBUILD_PREP       = (1 << 0),     
00027     RPMBUILD_BUILD      = (1 << 1),     
00028     RPMBUILD_INSTALL    = (1 << 2),     
00029     RPMBUILD_CLEAN      = (1 << 3),     
00030     RPMBUILD_FILECHECK  = (1 << 4),     
00031     RPMBUILD_PACKAGESOURCE = (1 << 5),  
00032     RPMBUILD_PACKAGEBINARY = (1 << 6),  
00033     RPMBUILD_RMSOURCE   = (1 << 7),     
00034     RPMBUILD_RMBUILD    = (1 << 8),     
00035     RPMBUILD_STRINGBUF  = (1 << 9),     
00036     RPMBUILD_RMSPEC     = (1 << 10)     
00037 } rpmBuildFlags;
00038 /*@=typeuse@*/
00039 
00040 #include <ctype.h>
00041 
00042 #define SKIPSPACE(s) { while (*(s) && xisspace(*(s))) (s)++; }
00043 #define SKIPNONSPACE(s) { while (*(s) && !xisspace(*(s))) (s)++; }
00044 
00045 #define PART_SUBNAME  0
00046 #define PART_NAME     1
00047 
00051 typedef enum rpmParseState_e {
00052     PART_NONE           = 0,    
00053     PART_PREAMBLE       = 1,    
00054     PART_PREP           = 2,    
00055     PART_BUILD          = 3,    
00056     PART_INSTALL        = 4,    
00057     PART_CLEAN          = 5,    
00058     PART_FILES          = 6,    
00059     PART_PRE            = 7,    
00060     PART_POST           = 8,    
00061     PART_PREUN          = 9,    
00062     PART_POSTUN         = 10,   
00063     PART_DESCRIPTION    = 11,   
00064     PART_CHANGELOG      = 12,   
00065     PART_TRIGGERIN      = 13,   
00066     PART_TRIGGERUN      = 14,   
00067     PART_VERIFYSCRIPT   = 15,   
00068     PART_BUILDARCHITECTURES= 16,
00069     PART_TRIGGERPOSTUN  = 17,   
00070     PART_LAST           = 18    
00071 } rpmParseState;
00072 
00073 #define STRIP_NOTHING             0
00074 #define STRIP_TRAILINGSPACE (1 << 0)
00075 #define STRIP_COMMENTS      (1 << 1)
00076 
00077 #ifdef __cplusplus
00078 extern "C" {
00079 #endif
00080 
00084 void freeNames(void)
00085         /*@modifies internalState */;
00086 
00093 /*@observer@*/ const char * getUname(uid_t uid) /*@*/;
00094 
00101 /*@observer@*/ const char * getUnameS(const char * uname)       /*@*/;
00102 
00109 uid_t getUidS(const char * uname)       /*@*/;
00110 
00117 /*@observer@*/ const char * getGname(gid_t gid)         /*@*/;
00118 
00125 /*@observer@*/ const char * getGnameS(const char * gname)       /*@*/;
00126 
00133 gid_t getGidS(const char * gname)       /*@*/;
00134 
00139 /*@observer@*/ const char * const buildHost(void)       /*@*/;
00140 
00145 /*@observer@*/ int_32 * const getBuildTime(void)        /*@*/;
00146 
00153 int readLine(Spec spec, int strip)
00154         /*@modifies spec->fileStack, spec->readStack, spec->line, spec->lineNum,
00155                 spec->sl, fileSystem @*/;
00156 
00161 void closeSpec(/*@partial@*/ Spec spec)
00162         /*@modifies spec->fileStack @*/;
00163 
00168 void handleComments(char * s)
00169         /*@modifies s @*/;
00170 
00176 rpmParseState isPart(const char * line) /*@*/;
00177 
00184 int parseNum(/*@null@*/ const char * line, /*@null@*/ /*@out@*/int * res)
00185         /*@modifies *res @*/;
00186 
00194 void addChangelogEntry(Header h, time_t time, const char * name,
00195         const char * text)
00196         /*@modifies h @*/;
00197 
00204 int parseBuildInstallClean(Spec spec, rpmParseState parsePart)
00205         /*@modifies spec->build, spec->install, spec->clean, spec->macros,
00206                 spec->fileStack, spec->readStack, spec->line, spec->lineNum,
00207                 spec->sl @*/;
00208 
00214 int parseChangelog(Spec spec)
00215         /*@modifies spec->fileStack, spec->readStack, spec->line, spec->lineNum,
00216                 spec->sl,
00217                 spec->packages->header @*/;
00218 
00224 int parseDescription(Spec spec)
00225         /*@modifies spec->packages,
00226                 spec->fileStack, spec->readStack, spec->line, spec->lineNum,
00227                 spec->sl, spec->st @*/;
00228 
00234 int parseFiles(Spec spec)
00235         /*@modifies spec->packages,
00236                 spec->fileStack, spec->readStack, spec->line, spec->lineNum,
00237                 spec->sl @*/;
00238 
00245 int parsePreamble(Spec spec, int initialPackage)
00246         /*@modifies spec->packages,
00247                 spec->fileStack, spec->readStack, spec->line, spec->lineNum,
00248                 spec->buildSubdir, spec->sl,
00249                 spec->macros, spec->st, spec->buildRootURL,
00250                 spec->sources, spec->numSources, spec->noSource,
00251                 spec->buildRestrictions, spec->BANames, spec->BACount,
00252                 spec->gotBuildRootURL @*/;
00253 
00259 int parsePrep(Spec spec)
00260         /*@modifies spec->prep, spec->buildSubdir, spec->macros,
00261                 spec->fileStack, spec->readStack, spec->line, spec->lineNum,
00262                 spec->sl @*/;
00263 
00274 int parseRCPOT(Spec spec, Package pkg, const char * field, int tag, int index,
00275                rpmsenseFlags flags)
00276         /*@modifies nothing @*/;
00277 
00284 int parseScript(Spec spec, int parsePart)
00285         /*@modifies spec->packages,
00286                 spec->fileStack, spec->readStack, spec->line, spec->lineNum,
00287                 spec->sl @*/;
00288 
00295 int parseExpressionBoolean(Spec spec, const char * expr)        /*@*/;
00296 
00303 /*@unused@*/
00304 char * parseExpressionString(Spec spec, const char * expr)
00305         /*@modifies nothing @*/;
00306 
00317 int doScript(Spec spec, int what, const char * name, StringBuf sb, int test)
00318                 /*@modifies spec->macros, fileSystem @*/;
00319 
00328 int lookupPackage(Spec spec, /*@null@*/ const char * name, int flag,
00329         /*@out@*/ Package * pkg)
00330                 /*@modifies spec->packages, *pkg @*/;
00331 
00337 /*@only@*/ Package newPackage(Spec spec)
00338         /*@modifies spec->packages, spec->packages->next @*/;
00339 
00345 /*@null@*/ Package freePackages(/*@only@*/ /*@null@*/ Package packages)
00346         /*@modifies packages @*/;
00347 
00353 /*@null@*/ Package  freePackage(/*@only@*/ /*@null@*/ Package pkg)
00354         /*@modifies pkg @*/;
00355 
00366 int addReqProv(/*@unused@*/Spec spec, Header h,
00367                 rpmsenseFlags flag, const char * depName, const char * depEVR,
00368                 int index)
00369         /*@modifies h @*/;
00370 
00378 int rpmlibNeedsFeature(Header h, const char * feature, const char * featureEVR)
00379         /*@modifies h @*/;
00380 
00388 int processBinaryFiles(Spec spec, int installSpecialDoc, int test)
00389         /*@modifies spec->macros,
00390                 spec->packages->cpioList, spec->packages->fileList,
00391                 spec->packages->specialDoc, spec->packages->header,
00392                 fileSystem @*/;
00393 
00398 void initSourceHeader(Spec spec)
00399         /*@modifies spec->sourceHeader,
00400                 spec->buildRestrictions, spec->BANames,
00401                 spec->packages->header @*/;
00402 
00408 int processSourceFiles(Spec spec)
00409         /*@modifies spec->sourceHeader, spec->sourceCpioList,
00410                 spec->buildRestrictions, spec->BANames,
00411                 spec->packages->header @*/;
00412 
00413 /* global entry points */
00414 
00428 int parseSpec(/*@out@*/ Spec * specp, const char * specFile,
00429                 /*@null@*/ const char * rootdir,
00430                 /*@null@*/ const char * buildRoot,
00431                 int recursing,
00432                 /*@null@*/ const char * passPhrase,
00433                 /*@null@*/ char * cookie,
00434                 int anyarch, int force)
00435         /*@modifies *specp,
00436                 fileSystem @*/;
00437 
00450 /*@-declundef@*/
00451 extern int (*parseSpecVec) (Spec * specp, const char * specFile,
00452                 const char * rootdir,
00453                 /*@null@*/ const char * buildRoot,
00454                 int recursing,
00455                 /*@null@*/ const char * passPhrase,
00456                 /*@null@*/ char * cookie,
00457                 int anyarch, int force)
00458         /*@modifies *specp,
00459                 fileSystem @*/;
00460 /*@=declundef@*/
00461 
00469 int buildSpec(Spec spec, int what, int test)
00470         /*@modifies spec->sourceHeader, spec->sourceCpioList, spec->cookie,
00471                 spec->sourceRpmName, spec->macros,
00472                 spec->BASpecs,
00473                 spec->buildRestrictions, spec->BANames,
00474                 spec->packages->cpioList, spec->packages->fileList,
00475                 spec->packages->specialDoc, spec->packages->header,
00476                 fileSystem @*/;
00477 
00483 int packageBinaries(Spec spec)
00484         /*@modifies spec->packages->header,
00485                 spec->sourceRpmName,
00486                 fileSystem @*/;
00487 
00493 int packageSources(Spec spec)
00494         /*@modifies spec->sourceHeader, spec->cookie,
00495                 spec->sourceRpmName,
00496                 fileSystem @*/;
00497 
00498 #ifdef __cplusplus
00499 }
00500 #endif
00501 
00502 #endif  /* _H_RPMBUILD_ */

Generated at Wed Mar 27 03:56:48 2002 for rpm by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001