5 * \file build/rpmspec.h
6 * The Spec and Package data structures used during build.
11 typedef struct SpecStruct *Spec;
17 struct TriggerFileEntry {
19 /*@only@*/ char *fileName;
20 /*@only@*/ char *script;
21 /*@only@*/ char *prog;
22 /*@owned@*/ struct TriggerFileEntry *next;
25 #define RPMBUILD_ISSOURCE 1
26 #define RPMBUILD_ISPATCH (1 << 1)
27 #define RPMBUILD_ISICON (1 << 2)
28 #define RPMBUILD_ISNO (1 << 3)
30 #define RPMBUILD_DEFAULT_LANG "C"
35 /*@owned@*/ char * fullSource;
36 /*@dependent@*/ char * source; /* Pointer into fullSource */
39 /*@owned@*/ struct Source * next;
44 typedef struct ReadLevelEntry {
46 /*@dependent@*/ struct ReadLevelEntry * next;
51 typedef struct OpenFileInfo {
52 /*@only@*/ const char * fileName;
56 /*@dependent@*/ char *readPtr;
57 /*@owned@*/ struct OpenFileInfo * next;
66 /*@only@*/ const char * t_lang;
67 /*@only@*/ const char * t_msgid;
73 /*@owned@*/ struct spectag *st_t;
81 /*@only@*/ char **sl_lines;
87 * The structure used to store values parsed from a spec file.
90 /*@only@*/ const char * specFile; /*!< Name of the spec file. */
91 /*@only@*/ const char * sourceRpmName;
92 /*@only@*/ const char * buildRootURL;
93 /*@only@*/ const char * buildSubdir;
94 /*@only@*/ const char * rootURL;
96 /*@owned@*/ /*@null@*/ struct speclines * sl;
97 /*@owned@*/ /*@null@*/ struct spectags * st;
99 /*@owned@*/ struct OpenFileInfo * fileStack;
102 /*@dependent@*/ char * nextline;
103 /*@dependent@*/ char * line;
106 /*@owned@*/ struct ReadLevelEntry * readStack;
108 /*@refcounted@*/ Header buildRestrictions;
109 /*@owned@*/ /*@null@*/ struct SpecStruct ** buildArchitectureSpecs;
110 /*@only@*/ /*@null@*/ const char ** buildArchitectures;
111 int buildArchitectureCount;
112 int inBuildArchitectures;
119 /*@null@*/ char * passPhrase;
121 /*@null@*/ const char * cookie;
123 /*@owned@*/ struct Source * sources;
127 /*@refcounted@*/ Header sourceHeader;
128 /*@owned@*/ void * sourceCpioList;
130 /*@dependent@*/ /*@null@*/ MacroContext macros;
132 /*@only@*/ StringBuf prep; /*!< %prep scriptlet. */
133 /*@only@*/ StringBuf build; /*!< %build scriptlet. */
134 /*@only@*/ StringBuf install; /*!< %install scriptlet. */
135 /*@only@*/ StringBuf clean; /*!< %clean scriptlet. */
137 /*@owned@*/ struct PackageStruct * packages; /*!< Package list. */
140 /** \ingroup rpmbuild
141 * The structure used to store values for a package.
143 struct PackageStruct {
144 /*@refcounted@*/ Header header;
146 /*@owned@*/ void * cpioList;
148 /*@owned@*/ struct Source * icon;
153 /*@only@*/ const char * preInFile; /*!< %pre scriptlet. */
154 /*@only@*/ const char * postInFile; /*!< %post scriptlet. */
155 /*@only@*/ const char * preUnFile; /*!< %preun scriptlet. */
156 /*@only@*/ const char * postUnFile; /*!< %postun scriptlet. */
157 /*@only@*/ const char * verifyFile; /*!< %verifyscript scriptlet. */
159 /*@only@*/ StringBuf specialDoc;
161 /*@only@*/ struct TriggerFileEntry * triggerFiles;
163 /*@only@*/ const char * fileFile;
164 /*@only@*/ StringBuf fileList; /* If NULL, package will not be written */
166 /*@dependent@*/ struct PackageStruct * next;
169 /** \ingroup rpmbuild
171 typedef struct PackageStruct * Package;
177 /** \ingroup rpmbuild
178 * Create and initialize Spec structure.
180 /*@only@*/ Spec newSpec(void) /*@*/;
182 /** \ingroup rpmbuild
183 * Destroy Spec structure.
184 * @param spec spec file control structure
186 void freeSpec(/*@only@*/ Spec spec)
187 /*@modifies spec @*/;
189 /** \ingroup rpmbuild
190 * @param spec spec file control structure
192 extern void (*freeSpecVec) (Spec spec) /* XXX FIXME */
193 /*@modifies spec @*/;
195 /** \ingroup rpmbuild
197 struct OpenFileInfo * newOpenFileInfo(void) /*@*/;
199 /** \ingroup rpmbuild
200 * @param spec spec file control structure
202 struct spectag * stashSt(Spec spec, Header h, int tag, const char * lang)
203 /*@modifies spec->st @*/;
205 /** \ingroup rpmbuild
206 * @param spec spec file control structure
208 int addSource(Spec spec, Package pkg, const char * field, int tag)
209 /*@modifies spec->sources, spec->numSources,
210 spec->st, spec->macros,
213 /** \ingroup rpmbuild
214 * @param spec spec file control structure
216 int parseNoSource(Spec spec, const char * field, int tag)
217 /*@modifies nothing @*/;
223 #endif /* _H_SPEC_ */