00001 #ifndef _H_SPEC_
00002 #define _H_SPEC_
00003 
00011 typedef struct Package_s * Package;
00012 
00015 struct TriggerFileEntry {
00016     int index;
00017  char * fileName;
00018  char * script;
00019  char * prog;
00020  struct TriggerFileEntry * next;
00021 };
00022 
00023 #define RPMBUILD_ISSOURCE       (1 << 0)
00024 #define RPMBUILD_ISPATCH        (1 << 1)
00025 #define RPMBUILD_ISICON         (1 << 2)
00026 #define RPMBUILD_ISNO           (1 << 3)
00027 
00028 #define RPMBUILD_DEFAULT_LANG "C"
00029 
00032 struct Source {
00033  char * fullSource;
00034  char * source;     
00035     int flags;
00036     int num;
00037  struct Source * next;
00038 };
00039 
00042 
00043 typedef struct ReadLevelEntry {
00044     int reading;
00045 
00046     struct ReadLevelEntry * next;
00047 } RLE_t;
00048 
00049 
00052 typedef struct OpenFileInfo {
00053  const char * fileName;
00054     FD_t fd;
00055     int lineNum;
00056     char readBuf[BUFSIZ];
00057 
00058     char * readPtr;
00059 
00060     struct OpenFileInfo * next;
00061 } OFI_t;
00062 
00065 typedef struct spectag_s {
00066     int t_tag;
00067     int t_startx;
00068     int t_nlines;
00069  const char * t_lang;
00070  const char * t_msgid;
00071 } * spectag;
00072 
00075 typedef struct spectags_s {
00076  spectag st_t;
00077     int st_nalloc;
00078     int st_ntags;
00079 } * spectags;
00080 
00083 typedef struct speclines_s {
00084  char **sl_lines;
00085     int sl_nalloc;
00086     int sl_nlines;
00087 } * speclines;
00088 
00092 struct Spec_s {
00093 
00094     const char * specFile;      
00095 
00096     const char * buildRootURL;
00097 
00098     const char * buildSubdir;
00099 
00100     const char * rootURL;
00101 
00102  
00103     speclines sl;
00104  
00105     spectags st;
00106 
00107 
00108     struct OpenFileInfo * fileStack;
00109     char lbuf[10*BUFSIZ];
00110 
00111     char *lbufPtr;
00112     char nextpeekc;
00113 
00114     char * nextline;
00115 
00116     char * line;
00117     int lineNum;
00118 
00119 
00120     struct ReadLevelEntry * readStack;
00121 
00122 
00123     Header buildRestrictions;
00124  
00125     Spec * BASpecs;
00126  
00127     const char ** BANames;
00128     int BACount;
00129     int recursing;              
00131     int force;
00132     int anyarch;
00133 
00134     int gotBuildRootURL;
00135 
00136 
00137     char * passPhrase;
00138     int timeCheck;
00139 
00140     const char * cookie;
00141 
00142 
00143     struct Source * sources;
00144     int numSources;
00145     int noSource;
00146 
00147 
00148     const char * sourceRpmName;
00149 
00150     unsigned char * sourcePkgId;
00151 
00152     Header sourceHeader;
00153 
00154     rpmfi sourceCpioList;
00155 
00156  
00157     MacroContext macros;
00158 
00159 
00160     StringBuf prep;             
00161 
00162     StringBuf build;            
00163 
00164     StringBuf install;          
00165 
00166     StringBuf check;            
00167 
00168     StringBuf clean;            
00170 
00171     Package packages;           
00172 };
00173 
00177 struct Package_s {
00178 
00179     Header header;
00180 
00181     rpmds ds;                   
00182 
00183     rpmfi cpioList;
00184 
00185 
00186     struct Source * icon;
00187 
00188     int autoReq;
00189     int autoProv;
00190 
00191 
00192     const char * preInFile;     
00193 
00194     const char * postInFile;    
00195 
00196     const char * preUnFile;     
00197 
00198     const char * postUnFile;    
00199 
00200     const char * preTransFile;  
00201 
00202     const char * postTransFile; 
00203 
00204     const char * verifyFile;    
00206 
00207     StringBuf specialDoc;
00208 
00209 
00210     struct TriggerFileEntry * triggerFiles;
00211 
00212 
00213     const char * fileFile;
00214 
00215     StringBuf fileList;         
00216 
00217 
00218     Package next;
00219 };
00220 
00221 #ifdef __cplusplus
00222 extern "C" {
00223 #endif
00224 
00229  Spec newSpec(void)
00230         
00231         ;
00232 
00238  Spec freeSpec(  Spec spec)
00239         
00240         ;
00241 
00249 int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg)
00250         
00251 
00252         
00253 ;
00254 
00257 struct OpenFileInfo * newOpenFileInfo(void)
00258         ;
00259 
00266 spectag stashSt(Spec spec, Header h, int tag, const char * lang)
00267         ;
00268 
00275 int addSource(Spec spec, Package pkg, const char * field, int tag)
00276         
00277         
00278 
00279 
00280 ;
00281 
00287 int parseNoSource(Spec spec, const char * field, int tag)
00288         ;
00289 
00290 #ifdef __cplusplus
00291 }
00292 #endif
00293 
00294 #endif