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@*/ struct speclines *sl;
97 /*@owned@*/ 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@*/ struct SpecStruct **buildArchitectureSpecs;
110 /*@only@*/ const char ** buildArchitectures;
111 int buildArchitectureCount;
112 int inBuildArchitectures;
123 /*@owned@*/ struct Source *sources;
127 /*@refcounted@*/ Header sourceHeader;
129 /*@owned@*/ void * sourceCpioList;
131 /*@dependent@*/ struct MacroContext *macros;
133 /*@only@*/ StringBuf prep; /*!< %prep scriptlet. */
134 /*@only@*/ StringBuf build; /*!< %build scriptlet. */
135 /*@only@*/ StringBuf install; /*!< %install scriptlet. */
136 /*@only@*/ StringBuf clean; /*!< %clean scriptlet. */
138 /*@owned@*/ struct PackageStruct *packages; /*!< Package list. */
141 /** \ingroup rpmbuild
142 * The structure used to store values for a package.
144 struct PackageStruct {
145 /*@refcounted@*/ Header header;
148 /*@owned@*/ void * cpioList;
150 /*@owned@*/ struct Source *icon;
155 /*@only@*/ const char *preInFile; /*!< %pre scriptlet. */
156 /*@only@*/ const char *postInFile; /*!< %post scriptlet. */
157 /*@only@*/ const char *preUnFile; /*!< %preun scriptlet. */
158 /*@only@*/ const char *postUnFile; /*!< %postun scriptlet. */
159 /*@only@*/ const char *verifyFile; /*!< %verifyscript scriptlet. */
161 /*@only@*/ StringBuf specialDoc;
164 struct ReqProvTrigger *triggers;
165 char *triggerScripts;
168 /*@only@*/ struct TriggerFileEntry *triggerFiles;
170 /*@only@*/ const char *fileFile;
171 /*@only@*/ StringBuf fileList; /* If NULL, package will not be written */
173 /*@dependent@*/ struct PackageStruct *next;
176 /** \ingroup rpmbuild
178 typedef struct PackageStruct *Package;
184 /** \ingroup rpmbuild
185 * Create and initialize Spec structure.
187 /*@only@*/ Spec newSpec(void);
189 /** \ingroup rpmbuild
190 * Destroy Spec structure.
191 * @param spec spec file control structure
193 void freeSpec(/*@only@*/ Spec spec);
195 /** \ingroup rpmbuild
196 * @param spec spec file control structure
198 extern void (*freeSpecVec) (Spec spec); /* XXX FIXME */
200 /** \ingroup rpmbuild
202 struct OpenFileInfo * newOpenFileInfo(void);
204 /** \ingroup rpmbuild
205 * @param spec spec file control structure
207 struct spectag *stashSt(Spec spec, Header h, int tag, const char *lang);
209 /** \ingroup rpmbuild
210 * @param spec spec file control structure
212 int addSource(Spec spec, Package pkg, const char *field, int tag);
214 /** \ingroup rpmbuild
215 * @param spec spec file control structure
217 int parseNoSource(Spec spec, const char *field, int tag);
223 #endif /* _H_SPEC_ */