5 * \file build/rpmspec.h
6 * The rpmSpec and Package data structures used during build.
9 #include <rpm/rpmstring.h> /* StringBuf */
10 #include <rpm/rpmcli.h> /* for QVA_t */
18 typedef struct Package_s * Package;
22 struct TriggerFileEntry {
27 struct TriggerFileEntry * next;
30 #define RPMBUILD_ISSOURCE (1 << 0)
31 #define RPMBUILD_ISPATCH (1 << 1)
32 #define RPMBUILD_ISICON (1 << 2)
33 #define RPMBUILD_ISNO (1 << 3)
35 #define RPMBUILD_DEFAULT_LANG "C"
41 char * source; /* Pointer into fullSource */
49 typedef struct ReadLevelEntry {
51 struct ReadLevelEntry * next;
56 typedef struct OpenFileInfo {
62 struct OpenFileInfo * next;
67 typedef struct spectag_s {
77 typedef struct spectags_s {
85 typedef struct speclines_s {
92 * The structure used to store values parsed from a spec file.
95 char * specFile; /*!< Name of the spec file. */
103 struct OpenFileInfo * fileStack;
104 char lbuf[10*BUFSIZ];
111 struct ReadLevelEntry * readStack;
113 Header buildRestrictions;
115 const char ** BANames;
117 int recursing; /*!< parse is recursive? */
128 struct Source * sources;
132 char * sourceRpmName;
133 unsigned char * sourcePkgId;
135 rpmfi sourceCpioList;
137 rpmMacroContext macros;
139 StringBuf prep; /*!< %prep scriptlet. */
140 StringBuf build; /*!< %build scriptlet. */
141 StringBuf install; /*!< %install scriptlet. */
142 StringBuf check; /*!< %check scriptlet. */
143 StringBuf clean; /*!< %clean scriptlet. */
145 Package packages; /*!< Package list. */
148 /** \ingroup rpmbuild
149 * The structure used to store values for a package.
153 rpmds ds; /*!< Requires: N = EVR */
156 struct Source * icon;
161 char * preInFile; /*!< %pre scriptlet. */
162 char * postInFile; /*!< %post scriptlet. */
163 char * preUnFile; /*!< %preun scriptlet. */
164 char * postUnFile; /*!< %postun scriptlet. */
165 char * preTransFile; /*!< %pretrans scriptlet. */
166 char * postTransFile; /*!< %posttrans scriptlet. */
167 char * verifyFile; /*!< %verifyscript scriptlet. */
169 StringBuf specialDoc;
171 struct TriggerFileEntry * triggerFiles;
174 StringBuf fileList; /* If NULL, package will not be written */
179 /** \ingroup rpmbuild
180 * Create and initialize rpmSpec structure.
181 * @return spec spec file control structure
183 rpmSpec newSpec(void);
185 /** \ingroup rpmbuild
186 * Destroy Spec structure.
187 * @param spec spec file control structure
188 * @return NULL always
190 rpmSpec freeSpec(rpmSpec spec);
192 /** \ingroup rpmbuild
193 * Function to query spec file(s).
194 * @param ts transaction set
195 * @param qva parsed query/verify options
196 * @param arg query argument
197 * @return 0 on success, else no. of failures
199 int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg);
201 /** \ingroup rpmbuild
203 struct OpenFileInfo * newOpenFileInfo(void);
205 /** \ingroup rpmbuild
207 * @param spec spec file control structure
212 spectag stashSt(rpmSpec spec, Header h, rpmTag tag, const char * lang);
214 /** \ingroup rpmbuild
216 * @param spec spec file control structure
217 * @param pkg package control
218 * @param field field to parse
221 int addSource(rpmSpec spec, Package pkg, const char * field, rpmTag tag);
223 /** \ingroup rpmbuild
225 * @param spec spec file control structure
226 * @param field field to parse
229 int parseNoSource(rpmSpec spec, const char * field, rpmTag tag);
235 #endif /* _H_SPEC_ */