1998-07-25 23:10:58 +08:00
|
|
|
#ifndef _H_SPEC_
|
|
|
|
#define _H_SPEC_
|
1996-06-08 02:29:21 +08:00
|
|
|
|
1998-07-09 01:30:37 +08:00
|
|
|
typedef struct SpecStruct *Spec;
|
1998-07-31 06:42:18 +08:00
|
|
|
#include "rpmmacro.h"
|
1998-01-13 05:31:29 +08:00
|
|
|
|
|
|
|
#if 0
|
|
|
|
struct ReqProvTrigger {
|
|
|
|
int flags;
|
|
|
|
char *name;
|
|
|
|
char *version;
|
|
|
|
int index; /* Only used for triggers */
|
|
|
|
struct ReqProvTrigger *next;
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
1998-03-21 06:38:00 +08:00
|
|
|
struct TriggerFileEntry {
|
|
|
|
int index;
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@only@*/ char *fileName;
|
|
|
|
/*@only@*/ char *script;
|
|
|
|
/*@only@*/ char *prog;
|
|
|
|
/*@owned@*/ struct TriggerFileEntry *next;
|
1998-03-21 06:38:00 +08:00
|
|
|
};
|
|
|
|
|
1998-01-13 05:31:29 +08:00
|
|
|
#define RPMBUILD_ISSOURCE 1
|
|
|
|
#define RPMBUILD_ISPATCH (1 << 1)
|
|
|
|
#define RPMBUILD_ISICON (1 << 2)
|
|
|
|
#define RPMBUILD_ISNO (1 << 3)
|
|
|
|
|
|
|
|
#define RPMBUILD_DEFAULT_LANG "C"
|
|
|
|
|
|
|
|
struct Source {
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@owned@*/ char *fullSource;
|
|
|
|
/*@dependent@*/ char *source; /* Pointer into fullSource */
|
1998-01-13 05:31:29 +08:00
|
|
|
int flags;
|
|
|
|
int num;
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@owned@*/ struct Source *next;
|
1998-01-13 05:31:29 +08:00
|
|
|
};
|
|
|
|
|
1999-07-20 02:39:48 +08:00
|
|
|
typedef struct ReadLevelEntry {
|
1998-01-13 05:31:29 +08:00
|
|
|
int reading;
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@dependent@*/ struct ReadLevelEntry *next;
|
1999-07-20 02:39:48 +08:00
|
|
|
} RLE_t;
|
1998-01-13 05:31:29 +08:00
|
|
|
|
1999-07-20 02:39:48 +08:00
|
|
|
typedef struct OpenFileInfo {
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@only@*/ char *fileName;
|
1999-12-08 05:14:51 +08:00
|
|
|
FD_t fd;
|
1998-10-07 01:34:58 +08:00
|
|
|
int lineNum;
|
|
|
|
char readBuf[BUFSIZ];
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@dependent@*/ char *readPtr;
|
|
|
|
/*@owned@*/ struct OpenFileInfo *next;
|
1999-07-20 02:39:48 +08:00
|
|
|
} OFI_t;
|
1998-10-07 01:34:58 +08:00
|
|
|
|
1999-02-23 01:44:57 +08:00
|
|
|
struct spectag {
|
|
|
|
int t_tag;
|
|
|
|
int t_startx;
|
|
|
|
int t_nlines;
|
1999-10-05 03:40:03 +08:00
|
|
|
/*@only@*/ const char *t_lang;
|
|
|
|
/*@only@*/ const char *t_msgid;
|
1999-02-23 01:44:57 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct spectags {
|
1999-10-05 03:40:03 +08:00
|
|
|
/*@owned@*/ struct spectag *st_t;
|
1999-02-23 01:44:57 +08:00
|
|
|
int st_nalloc;
|
|
|
|
int st_ntags;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct speclines {
|
1999-09-18 06:23:33 +08:00
|
|
|
/*@only@*/ char **sl_lines;
|
1999-02-23 01:44:57 +08:00
|
|
|
int sl_nalloc;
|
|
|
|
int sl_nlines;
|
|
|
|
};
|
|
|
|
|
2000-01-20 06:51:39 +08:00
|
|
|
/*! The structure used to store values parsed from a spec file. */
|
1998-01-13 05:31:29 +08:00
|
|
|
struct SpecStruct {
|
2000-01-20 06:51:39 +08:00
|
|
|
/*@only@*/ const char *specFile; /*!< Name of the spec file. */
|
1999-10-05 03:40:03 +08:00
|
|
|
/*@only@*/ const char *sourceRpmName;
|
1998-01-13 05:31:29 +08:00
|
|
|
|
1999-10-05 03:40:03 +08:00
|
|
|
/*@owned@*/ struct speclines *sl;
|
|
|
|
/*@owned@*/ struct spectags *st;
|
1999-02-23 01:44:57 +08:00
|
|
|
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@owned@*/ struct OpenFileInfo *fileStack;
|
1999-07-20 02:39:48 +08:00
|
|
|
char lbuf[BUFSIZ];
|
1999-07-20 05:25:53 +08:00
|
|
|
char nextpeekc;
|
1999-10-21 23:04:25 +08:00
|
|
|
/*@dependent@*/ char *nextline;
|
|
|
|
/*@dependent@*/ char *line;
|
1998-01-13 05:31:29 +08:00
|
|
|
int lineNum;
|
|
|
|
|
1999-10-21 23:04:25 +08:00
|
|
|
/*@owned@*/ struct ReadLevelEntry *readStack;
|
1998-01-13 05:31:29 +08:00
|
|
|
|
1999-10-05 03:40:03 +08:00
|
|
|
/*@refcounted@*/ Header buildRestrictions;
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@owned@*/ struct SpecStruct **buildArchitectureSpecs;
|
1999-10-28 07:18:10 +08:00
|
|
|
/*@only@*/ const char ** buildArchitectures;
|
1998-01-13 05:31:29 +08:00
|
|
|
int buildArchitectureCount;
|
|
|
|
int inBuildArchitectures;
|
1998-07-25 23:10:58 +08:00
|
|
|
|
1998-11-20 08:29:46 +08:00
|
|
|
int force;
|
|
|
|
int anyarch;
|
|
|
|
|
1999-11-24 08:03:54 +08:00
|
|
|
int gotBuildRootURL;
|
|
|
|
/*@only@*/ const char *buildRootURL;
|
1998-11-25 08:42:36 +08:00
|
|
|
/*@only@*/ const char *buildSubdir;
|
1998-01-13 05:31:29 +08:00
|
|
|
|
|
|
|
char *passPhrase;
|
|
|
|
int timeCheck;
|
|
|
|
char *cookie;
|
|
|
|
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@owned@*/ struct Source *sources;
|
1998-01-13 05:31:29 +08:00
|
|
|
int numSources;
|
|
|
|
int noSource;
|
|
|
|
|
1999-10-05 03:40:03 +08:00
|
|
|
/*@refcounted@*/ Header sourceHeader;
|
1998-01-13 05:31:29 +08:00
|
|
|
int sourceCpioCount;
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@owned@*/ struct cpioFileMapping *sourceCpioList;
|
1998-07-25 23:10:58 +08:00
|
|
|
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@dependent@*/ struct MacroContext *macros;
|
1998-01-13 05:31:29 +08:00
|
|
|
|
1999-11-20 02:19:41 +08:00
|
|
|
/*@only@*/ const char *rootURL;
|
2000-01-20 06:51:39 +08:00
|
|
|
/*@only@*/ StringBuf prep; /*!< %prep scriptlet. */
|
|
|
|
/*@only@*/ StringBuf build; /*!< %build scriptlet. */
|
|
|
|
/*@only@*/ StringBuf install; /*!< %install scriptlet. */
|
|
|
|
/*@only@*/ StringBuf clean; /*!< %clean scriptlet. */
|
1998-01-13 05:31:29 +08:00
|
|
|
|
2000-01-20 06:51:39 +08:00
|
|
|
/*@owned@*/ struct PackageStruct *packages; /*!< Package list. */
|
1998-01-13 05:31:29 +08:00
|
|
|
};
|
|
|
|
|
2000-01-20 06:51:39 +08:00
|
|
|
/*! The structure used to store values for a package. */
|
1998-01-13 05:31:29 +08:00
|
|
|
struct PackageStruct {
|
1999-10-05 01:29:58 +08:00
|
|
|
/*@refcounted@*/ Header header;
|
1998-01-13 05:31:29 +08:00
|
|
|
|
|
|
|
int cpioCount;
|
1999-10-21 23:04:25 +08:00
|
|
|
/*@owned@*/ struct cpioFileMapping *cpioList;
|
1998-01-13 05:31:29 +08:00
|
|
|
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@owned@*/ struct Source *icon;
|
1998-01-13 05:31:29 +08:00
|
|
|
|
1999-03-27 04:07:34 +08:00
|
|
|
int autoReq;
|
|
|
|
int autoProv;
|
1998-01-13 05:31:29 +08:00
|
|
|
|
2000-01-20 06:51:39 +08:00
|
|
|
char *preInFile; /*!< %pre scriptlet. */
|
|
|
|
char *postInFile; /*!< %post scriptlet. */
|
|
|
|
char *preUnFile; /*!< %preun scriptlet. */
|
|
|
|
char *postUnFile; /*!< %postun scriptlet. */
|
|
|
|
char *verifyFile; /*!< %verifyscript scriptlet. */
|
1995-11-28 06:31:21 +08:00
|
|
|
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@only@*/ StringBuf specialDoc;
|
1998-07-25 23:10:58 +08:00
|
|
|
|
|
|
|
#if 0
|
1998-01-13 05:31:29 +08:00
|
|
|
struct ReqProvTrigger *triggers;
|
|
|
|
char *triggerScripts;
|
|
|
|
#endif
|
1998-03-21 06:38:00 +08:00
|
|
|
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@only@*/ struct TriggerFileEntry *triggerFiles;
|
1998-07-25 23:10:58 +08:00
|
|
|
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@only@*/ char *fileFile;
|
|
|
|
/*@only@*/ StringBuf fileList; /* If NULL, package will not be written */
|
1995-11-28 06:31:21 +08:00
|
|
|
|
1999-10-21 23:04:25 +08:00
|
|
|
/*@dependent@*/ struct PackageStruct *next;
|
1998-01-13 05:31:29 +08:00
|
|
|
};
|
1995-11-28 06:31:21 +08:00
|
|
|
|
1998-01-13 05:31:29 +08:00
|
|
|
typedef struct PackageStruct *Package;
|
1995-12-14 23:50:00 +08:00
|
|
|
|
1998-07-25 23:10:58 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@only@*/ Spec newSpec(void);
|
|
|
|
void freeSpec(/*@only@*/ Spec spec);
|
1999-07-01 05:18:43 +08:00
|
|
|
extern void (*freeSpecVec) (Spec spec); /* XXX FIXME */
|
1995-12-28 00:39:10 +08:00
|
|
|
|
1998-10-07 01:34:58 +08:00
|
|
|
struct OpenFileInfo * newOpenFileInfo(void);
|
1999-02-23 01:44:57 +08:00
|
|
|
struct spectag *stashSt(Spec spec, Header h, int tag, const char *lang);
|
1998-10-07 01:34:58 +08:00
|
|
|
|
1999-07-20 00:20:02 +08:00
|
|
|
int addSource(Spec spec, Package pkg, const char *field, int tag);
|
|
|
|
int parseNoSource(Spec spec, const char *field, int tag);
|
1996-05-18 02:35:55 +08:00
|
|
|
|
1998-07-25 23:10:58 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _H_SPEC_ */
|