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
|
|
|
};
|
|
|
|
|
|
|
|
struct ReadLevelEntry {
|
|
|
|
int reading;
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@dependent@*/ struct ReadLevelEntry *next;
|
1998-01-13 05:31:29 +08:00
|
|
|
};
|
|
|
|
|
1998-10-07 01:34:58 +08:00
|
|
|
struct OpenFileInfo {
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@only@*/ char *fileName;
|
|
|
|
/*@dependent@*/ FILE *file;
|
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;
|
1998-10-07 01:34:58 +08:00
|
|
|
};
|
|
|
|
|
1998-01-13 05:31:29 +08:00
|
|
|
struct SpecStruct {
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@only@*/ char *specFile;
|
|
|
|
/*@only@*/ char *sourceRpmName;
|
1998-01-13 05:31:29 +08:00
|
|
|
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@owned@*/ struct OpenFileInfo *fileStack;
|
1998-01-13 05:31:29 +08:00
|
|
|
char line[BUFSIZ];
|
|
|
|
int lineNum;
|
|
|
|
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@only@*/ struct ReadLevelEntry *readStack;
|
1998-01-13 05:31:29 +08:00
|
|
|
|
|
|
|
Header buildRestrictions;
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@owned@*/ struct SpecStruct **buildArchitectureSpecs;
|
1998-01-13 05:31:29 +08:00
|
|
|
char ** buildArchitectures;
|
|
|
|
int buildArchitectureCount;
|
|
|
|
int inBuildArchitectures;
|
1998-07-25 23:10:58 +08:00
|
|
|
|
1998-11-20 08:29:46 +08:00
|
|
|
int force;
|
|
|
|
int anyarch;
|
|
|
|
|
1998-01-13 05:31:29 +08:00
|
|
|
int gotBuildRoot;
|
1998-11-25 08:42:36 +08:00
|
|
|
/*@only@*/ const char *buildRoot;
|
|
|
|
/*@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;
|
|
|
|
|
|
|
|
Header sourceHeader;
|
|
|
|
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
|
|
|
|
1998-04-17 12:25:27 +08:00
|
|
|
int autoReq;
|
|
|
|
int autoProv;
|
1998-07-25 23:10:58 +08:00
|
|
|
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@only@*/ StringBuf prep;
|
|
|
|
/*@only@*/ StringBuf build;
|
|
|
|
/*@only@*/ StringBuf install;
|
|
|
|
/*@only@*/ StringBuf clean;
|
1998-01-13 05:31:29 +08:00
|
|
|
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@owned@*/ struct PackageStruct *packages;
|
1998-01-13 05:31:29 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct PackageStruct {
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@only@*/ Header header;
|
1998-01-13 05:31:29 +08:00
|
|
|
|
|
|
|
int cpioCount;
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@only@*/ 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
|
|
|
|
|
|
|
int autoReqProv;
|
|
|
|
|
|
|
|
char *preInFile;
|
|
|
|
char *postInFile;
|
|
|
|
char *preUnFile;
|
|
|
|
char *postUnFile;
|
|
|
|
char *verifyFile;
|
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
|
|
|
|
1998-11-21 04:18:22 +08:00
|
|
|
/*@keep@*/ 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);
|
1995-12-28 00:39:10 +08:00
|
|
|
|
1998-10-07 01:34:58 +08:00
|
|
|
struct OpenFileInfo * newOpenFileInfo(void);
|
|
|
|
|
1998-01-13 05:31:29 +08:00
|
|
|
int addSource(Spec spec, Package pkg, char *field, int tag);
|
|
|
|
int parseNoSource(Spec spec, 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_ */
|