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? */
126 struct Source * sources;
130 char * sourceRpmName;
131 unsigned char * sourcePkgId;
133 rpmfi sourceCpioList;
135 rpmMacroContext macros;
137 StringBuf prep; /*!< %prep scriptlet. */
138 StringBuf build; /*!< %build scriptlet. */
139 StringBuf install; /*!< %install scriptlet. */
140 StringBuf check; /*!< %check scriptlet. */
141 StringBuf clean; /*!< %clean scriptlet. */
143 Package packages; /*!< Package list. */
146 /** \ingroup rpmbuild
147 * The structure used to store values for a package.
151 rpmds ds; /*!< Requires: N = EVR */
154 struct Source * icon;
159 char * preInFile; /*!< %pre scriptlet. */
160 char * postInFile; /*!< %post scriptlet. */
161 char * preUnFile; /*!< %preun scriptlet. */
162 char * postUnFile; /*!< %postun scriptlet. */
163 char * preTransFile; /*!< %pretrans scriptlet. */
164 char * postTransFile; /*!< %posttrans scriptlet. */
165 char * verifyFile; /*!< %verifyscript scriptlet. */
167 StringBuf specialDoc;
170 struct TriggerFileEntry * triggerFiles;
173 StringBuf fileList; /* If NULL, package will not be written */
178 /** \ingroup rpmbuild
179 * Create and initialize rpmSpec structure.
180 * @return spec spec file control structure
182 rpmSpec newSpec(void);
184 /** \ingroup rpmbuild
185 * Destroy Spec structure.
186 * @param spec spec file control structure
187 * @return NULL always
189 rpmSpec freeSpec(rpmSpec spec);
191 /** \ingroup rpmbuild
192 * Function to query spec file(s).
193 * @param ts transaction set
194 * @param qva parsed query/verify options
195 * @param arg query argument
196 * @return 0 on success, else no. of failures
198 int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg);
200 /** \ingroup rpmbuild
202 struct OpenFileInfo * newOpenFileInfo(void);
204 /** \ingroup rpmbuild
206 * @param spec spec file control structure
211 spectag stashSt(rpmSpec spec, Header h, rpmTag tag, const char * lang);
213 /** \ingroup rpmbuild
215 * @param spec spec file control structure
216 * @param pkg package control
217 * @param field field to parse
220 int addSource(rpmSpec spec, Package pkg, const char * field, rpmTag tag);
222 /** \ingroup rpmbuild
224 * @param spec spec file control structure
225 * @param field field to parse
228 int parseNoSource(rpmSpec spec, const char * field, rpmTag tag);
234 #endif /* _H_SPEC_ */