9 #define _MACRO_INTERNAL
64 if (spec !=
NULL && *buildRootURL)
66 buildRootURL =
_free(buildRootURL);
124 sourceList = PyList_New(0);
132 while (source !=
NULL) {
140 source = source->
next;
143 return PyList_AsTuple(sourceList);
159 macroDict = PyDict_New();
166 if (mc->macroTable !=
NULL) {
168 for (i = 0; i < mc->firstFree; i++) {
171 if ((me = mc->macroTable[i]) ==
NULL) {
175 macro = PyDict_New();
177 PyMapping_SetItemString(macro,
"used", PyInt_FromLong(me->used));
178 PyMapping_SetItemString(macro,
"level", PyInt_FromLong(me->level));
179 if (me->opts && *me->opts)
180 PyMapping_SetItemString(macro,
"opts", PyString_FromString(me->opts));
181 if (me->body && *me->body)
182 PyMapping_SetItemString(macro,
"body", PyString_FromString(me->body));
183 PyMapping_SetItemString(macroDict, strdup(me->name), macro);
204 {
"prep", (PyCFunction) spec_get_prep, METH_VARARGS,
NULL },
205 {
"build", (PyCFunction) spec_get_build, METH_VARARGS,
NULL },
206 {
"install", (PyCFunction) spec_get_install, METH_VARARGS,
NULL },
207 {
"check", (PyCFunction) spec_get_check, METH_VARARGS,
NULL },
208 {
"clean", (PyCFunction) spec_get_clean, METH_VARARGS,
NULL },
209 {
"buildRoot", (PyCFunction) spec_get_buildroot, METH_VARARGS,
NULL },
217 PyObject_HEAD_INIT(&PyType_Type)
222 (destructor) spec_dealloc,
specObject * spec_Wrap(Spec spec)
static PyObject *PyObject * macroDict
static int spec_print(specObject *s)
static VALUE spec_get_sources(VALUE self)
Returns an array of all sources defined in the spec file.
Spec freeSpec(Spec spec)
Destroy a spec file control structure.
static PyObject *static Py_BuildValue("s", rpmiobStr(spec->prep)) PyObject *static Py_BuildValue("s", rpmiobStr(spec->build)) PyObject *static Py_BuildValue("s", rpmiobStr(spec->install)) PyObject *static Py_BuildValue("s", rpmiobStr(spec->check)) PyObject *static Py_BuildValue("s", rpmiobStr(spec->clean)) PyObject *PyObject * srcUrl
static PyMethodDef spec_Spec_methods[]
PyList_Append(s->keyList, key)
struct specObject_s specObject
Spec specFromSpec(specObject *s)
The structure used to store values parsed from a spec file.
char * rpmExpand(const char *arg,...)
Return (malloc'ed) concatenated macro expansion(s).
static PyObject *static Py_BuildValue("s", rpmiobStr(spec->prep)) PyObject *static Py_BuildValue("s", rpmiobStr(spec->build)) PyObject *static Py_BuildValue("s", rpmiobStr(spec->install)) PyObject *static Py_BuildValue("s", rpmiobStr(spec->check)) PyObject *static Py_BuildValue("s", rpmiobStr(spec->clean)) PyObject *PyObject * sourceList
static VALUE spec_get_macros(VALUE self)
Returns the macro context of the spec file.
char * rpmiobStr(rpmiob iob)
Return I/O buffer (as string).
const char * buildRootURL
return Py_BuildValue("i", pkgKey)
struct MacroContext_s * MacroContext
struct MacroEntry_s * MacroEntry
static void * _free(const void *p)
Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.