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[4*BUFSIZ];
00110 char nextpeekc;
00111
00112 char * nextline;
00113
00114 char * line;
00115 int lineNum;
00116
00117
00118 struct ReadLevelEntry * readStack;
00119
00120
00121 Header buildRestrictions;
00122
00123 Spec * BASpecs;
00124
00125 const char ** BANames;
00126 int BACount;
00127 int recursing;
00129 int force;
00130 int anyarch;
00131
00132 int gotBuildRootURL;
00133
00134
00135 char * passPhrase;
00136 int timeCheck;
00137
00138 const char * cookie;
00139
00140
00141 struct Source * sources;
00142 int numSources;
00143 int noSource;
00144
00145
00146 const char * sourceRpmName;
00147
00148 unsigned char * sourcePkgId;
00149
00150 Header sourceHeader;
00151
00152 rpmfi sourceCpioList;
00153
00154
00155 MacroContext macros;
00156
00157
00158 StringBuf prep;
00159
00160 StringBuf build;
00161
00162 StringBuf install;
00163
00164 StringBuf check;
00165
00166 StringBuf clean;
00168
00169 Package packages;
00170 };
00171
00175 struct Package_s {
00176
00177 Header header;
00178
00179 rpmds ds;
00180
00181 rpmfi cpioList;
00182
00183
00184 struct Source * icon;
00185
00186 int autoReq;
00187 int autoProv;
00188
00189
00190 const char * preInFile;
00191
00192 const char * postInFile;
00193
00194 const char * preUnFile;
00195
00196 const char * postUnFile;
00197
00198 const char * verifyFile;
00200
00201 StringBuf specialDoc;
00202
00203
00204 struct TriggerFileEntry * triggerFiles;
00205
00206
00207 const char * fileFile;
00208
00209 StringBuf fileList;
00210
00211
00212 Package next;
00213 };
00214
00215 #ifdef __cplusplus
00216 extern "C" {
00217 #endif
00218
00223 Spec newSpec(void)
00224
00225 ;
00226
00232 Spec freeSpec( Spec spec)
00233
00234 ;
00235
00243 int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg)
00244
00245
00246
00247 ;
00248
00251 struct OpenFileInfo * newOpenFileInfo(void)
00252 ;
00253
00260 spectag stashSt(Spec spec, Header h, int tag, const char * lang)
00261 ;
00262
00269 int addSource(Spec spec, Package pkg, const char * field, int tag)
00270
00271
00272
00273
00274 ;
00275
00281 int parseNoSource(Spec spec, const char * field, int tag)
00282 ;
00283
00284 #ifdef __cplusplus
00285 }
00286 #endif
00287
00288 #endif