4 /** \file build/rpmspec.h
5 * The Spec and Package data structures used during build.
8 typedef struct SpecStruct *Spec;
12 struct ReqProvTrigger {
16 int index; /* Only used for triggers */
17 struct ReqProvTrigger *next;
22 struct TriggerFileEntry {
25 /*@only@*/ char *fileName;
26 /*@only@*/ char *script;
27 /*@only@*/ char *prog;
28 /*@owned@*/ struct TriggerFileEntry *next;
32 #define RPMBUILD_ISSOURCE 1
33 #define RPMBUILD_ISPATCH (1 << 1)
34 #define RPMBUILD_ISICON (1 << 2)
35 #define RPMBUILD_ISNO (1 << 3)
37 #define RPMBUILD_DEFAULT_LANG "C"
42 /*@owned@*/ char *fullSource;
43 /*@dependent@*/ char *source; /* Pointer into fullSource */
46 /*@owned@*/ struct Source *next;
51 typedef struct ReadLevelEntry {
54 /*@dependent@*/ struct ReadLevelEntry *next;
59 typedef struct OpenFileInfo {
61 /*@only@*/ char *fileName;
65 /*@dependent@*/ char *readPtr;
66 /*@owned@*/ struct OpenFileInfo *next;
76 /*@only@*/ const char *t_lang;
77 /*@only@*/ const char *t_msgid;
84 /*@owned@*/ struct spectag *st_t;
93 /*@only@*/ char **sl_lines;
99 /** The structure used to store values parsed from a spec file. */
102 /*@only@*/ const char *specFile; /*!< Name of the spec file. */
103 /*@only@*/ const char *sourceRpmName;
105 /*@owned@*/ struct speclines *sl;
106 /*@owned@*/ struct spectags *st;
108 /*@owned@*/ struct OpenFileInfo *fileStack;
111 /*@dependent@*/ char *nextline;
112 /*@dependent@*/ char *line;
115 /*@owned@*/ struct ReadLevelEntry *readStack;
117 /*@refcounted@*/ Header buildRestrictions;
118 /*@owned@*/ struct SpecStruct **buildArchitectureSpecs;
119 /*@only@*/ const char ** buildArchitectures;
120 int buildArchitectureCount;
121 int inBuildArchitectures;
127 /*@only@*/ const char *buildRootURL;
128 /*@only@*/ const char *buildSubdir;
134 /*@owned@*/ struct Source *sources;
138 /*@refcounted@*/ Header sourceHeader;
140 /*@owned@*/ struct cpioFileMapping *sourceCpioList;
142 /*@dependent@*/ struct MacroContext *macros;
144 /*@only@*/ const char *rootURL;
145 /*@only@*/ StringBuf prep; /*!< %prep scriptlet. */
146 /*@only@*/ StringBuf build; /*!< %build scriptlet. */
147 /*@only@*/ StringBuf install; /*!< %install scriptlet. */
148 /*@only@*/ StringBuf clean; /*!< %clean scriptlet. */
150 /*@owned@*/ struct PackageStruct *packages; /*!< Package list. */
154 /** The structure used to store values for a package. */
155 struct PackageStruct {
157 /*@refcounted@*/ Header header;
160 /*@owned@*/ struct cpioFileMapping *cpioList;
162 /*@owned@*/ struct Source *icon;
167 char *preInFile; /*!< %pre scriptlet. */
168 char *postInFile; /*!< %post scriptlet. */
169 char *preUnFile; /*!< %preun scriptlet. */
170 char *postUnFile; /*!< %postun scriptlet. */
171 char *verifyFile; /*!< %verifyscript scriptlet. */
173 /*@only@*/ StringBuf specialDoc;
176 struct ReqProvTrigger *triggers;
177 char *triggerScripts;
180 /*@only@*/ struct TriggerFileEntry *triggerFiles;
182 /*@only@*/ const char *fileFile;
183 /*@only@*/ StringBuf fileList; /* If NULL, package will not be written */
185 /*@dependent@*/ struct PackageStruct *next;
190 typedef struct PackageStruct *Package;
196 /*@only@*/ Spec newSpec(void);
197 void freeSpec(/*@only@*/ Spec spec);
198 extern void (*freeSpecVec) (Spec spec); /* XXX FIXME */
200 struct OpenFileInfo * newOpenFileInfo(void);
201 struct spectag *stashSt(Spec spec, Header h, int tag, const char *lang);
203 int addSource(Spec spec, Package pkg, const char *field, int tag);
204 int parseNoSource(Spec spec, const char *field, int tag);
210 #endif /* _H_SPEC_ */