diff options
author | xuhy <huayong.xu@samsung.com> | 2023-08-29 16:20:00 +0800 |
---|---|---|
committer | xuhy <huayong.xu@samsung.com> | 2023-08-31 10:20:47 +0800 |
commit | 67c629d233b0e85a332652c93de16901aa469bfc (patch) | |
tree | 8bc31cb68824fdc648396218aa8f82ccf7aef5a5 /python | |
parent | 0fb104edc1e949fd224866aa900463aa2d6588d0 (diff) | |
download | librpm-tizen-67c629d233b0e85a332652c93de16901aa469bfc.tar.gz librpm-tizen-67c629d233b0e85a332652c93de16901aa469bfc.tar.bz2 librpm-tizen-67c629d233b0e85a332652c93de16901aa469bfc.zip |
Add librpm-tizen.spec file.
Change-Id: I0b2d02a582dfc2aecb95d4c0b817250fdd303ff0
Diffstat (limited to 'python')
-rw-r--r-- | python/Makefile.am | 3 | ||||
-rw-r--r-- | python/header-py.c | 4 | ||||
-rw-r--r-- | python/rpm/__init__.py.in (renamed from python/rpm/__init__.py) | 10 | ||||
-rw-r--r-- | python/rpm/transaction.py.in (renamed from python/rpm/transaction.py) | 4 | ||||
-rw-r--r-- | python/rpmds-py.c | 2 | ||||
-rw-r--r-- | python/rpmfd-py.c | 2 | ||||
-rw-r--r-- | python/rpmfi-py.c | 2 | ||||
-rw-r--r-- | python/rpmii-py.c | 2 | ||||
-rw-r--r-- | python/rpmkeyring-py.c | 4 | ||||
-rw-r--r-- | python/rpmmi-py.c | 2 | ||||
-rw-r--r-- | python/rpmps-py.c | 4 | ||||
-rw-r--r-- | python/rpmte-py.c | 4 | ||||
-rw-r--r-- | python/rpmts-py.c | 4 | ||||
-rw-r--r-- | python/setup.py.in | 8 | ||||
-rw-r--r-- | python/spec-py.c | 8 |
15 files changed, 32 insertions, 31 deletions
diff --git a/python/Makefile.am b/python/Makefile.am index a9bd34729..67502dd31 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -7,10 +7,11 @@ EXTRA_DIST = rpm/__init__.py rpm/transaction.py AM_CPPFLAGS = -I$(top_builddir)/include/ AM_CPPFLAGS += -I$(top_srcdir)/python -AM_CPPFLAGS += @PYTHON_CFLAGS@ +AM_CPPFLAGS += @PYTHON_CFLAGS@ -DPYTHON_MODULENAME=\"@PYTHON_MODULENAME@\" pkgpyexec_LTLIBRARIES = _rpmmodule.la _rpmbmodule.la _rpmsmodule.la pkgpyexec_DATA = rpm/__init__.py rpm/transaction.py +pkgpyexecdir = @pyexecdir@/@PYTHON_MODULENAME@ _rpmmodule_la_LDFLAGS = -module -avoid-version -shared _rpmmodule_la_LIBADD = \ diff --git a/python/header-py.c b/python/header-py.c index 45af51637..6c2ff54f7 100644 --- a/python/header-py.c +++ b/python/header-py.c @@ -377,7 +377,7 @@ static PyObject *hdr_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) if (obj == NULL) { h = headerNew(); } else if (CAPSULE_CHECK(obj)) { - h = CAPSULE_EXTRACT(obj, "rpm._C_Header"); + h = CAPSULE_EXTRACT(obj, PYTHON_MODULENAME"._C_Header"); headerLink(h); } else if (hdrObject_Check(obj)) { h = headerCopy(((hdrObject*) obj)->h); @@ -718,7 +718,7 @@ static char hdr_doc[] = PyTypeObject hdr_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) - "rpm.hdr", /* tp_name */ + PYTHON_MODULENAME".hdr", /* tp_name */ sizeof(hdrObject), /* tp_size */ 0, /* tp_itemsize */ (destructor) hdr_dealloc, /* tp_dealloc */ diff --git a/python/rpm/__init__.py b/python/rpm/__init__.py.in index 54728bbd4..e2a7a87af 100644 --- a/python/rpm/__init__.py +++ b/python/rpm/__init__.py.in @@ -35,9 +35,9 @@ is very useful for resolving dependencies. """ import warnings -from rpm._rpm import * -from rpm.transaction import * -import rpm._rpm as _rpm +from @PYTHON_MODULENAME@._rpm import * +from @PYTHON_MODULENAME@.transaction import * +import @PYTHON_MODULENAME@._rpm as _rpm _RPMVSF_NODIGESTS = _rpm._RPMVSF_NODIGESTS _RPMVSF_NOHEADER = _rpm._RPMVSF_NOHEADER _RPMVSF_NOPAYLOAD = _rpm._RPMVSF_NOPAYLOAD @@ -48,13 +48,13 @@ __version_info__ = tuple(__version__.split('.')) # try to import build bits but dont require it try: - from rpm._rpmb import * + from @PYTHON_MODULENAME@._rpmb import * except ImportError: pass # try to import signing bits but dont require it try: - from rpm._rpms import * + from @PYTHON_MODULENAME@._rpms import * except ImportError: pass diff --git a/python/rpm/transaction.py b/python/rpm/transaction.py.in index 675ecaf8e..6a4e7c8b7 100644 --- a/python/rpm/transaction.py +++ b/python/rpm/transaction.py.in @@ -1,8 +1,8 @@ from __future__ import with_statement import sys -import rpm -from rpm._rpm import ts as TransactionSetCore +import @PYTHON_MODULENAME@ as rpm +from @PYTHON_MODULENAME@._rpm import ts as TransactionSetCore if sys.version_info[0] == 3: _string_types = str, diff --git a/python/rpmds-py.c b/python/rpmds-py.c index 9eae9a228..7874a2524 100644 --- a/python/rpmds-py.c +++ b/python/rpmds-py.c @@ -339,7 +339,7 @@ static char rpmds_doc[] = PyTypeObject rpmds_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) - "rpm.ds", /* tp_name */ + PYTHON_MODULENAME".ds", /* tp_name */ sizeof(rpmdsObject), /* tp_basicsize */ 0, /* tp_itemsize */ /* methods */ diff --git a/python/rpmfd-py.c b/python/rpmfd-py.c index 85fb0cd24..8b69ecb82 100644 --- a/python/rpmfd-py.c +++ b/python/rpmfd-py.c @@ -350,7 +350,7 @@ static PyGetSetDef rpmfd_getseters[] = { PyTypeObject rpmfd_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) - "rpm.fd", /* tp_name */ + PYTHON_MODULENAME".fd", /* tp_name */ sizeof(rpmfdObject), /* tp_size */ 0, /* tp_itemsize */ /* methods */ diff --git a/python/rpmfi-py.c b/python/rpmfi-py.c index a1a743a1d..742919f5c 100644 --- a/python/rpmfi-py.c +++ b/python/rpmfi-py.c @@ -362,7 +362,7 @@ static char rpmfi_doc[] = PyTypeObject rpmfi_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) - "rpm.fi", /* tp_name */ + PYTHON_MODULENAME".fi", /* tp_name */ sizeof(rpmfiObject), /* tp_basicsize */ 0, /* tp_itemsize */ /* methods */ diff --git a/python/rpmii-py.c b/python/rpmii-py.c index 180741479..f096cbd22 100644 --- a/python/rpmii-py.c +++ b/python/rpmii-py.c @@ -115,7 +115,7 @@ static char rpmii_doc[] = PyTypeObject rpmii_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) - "rpm.ii", /* tp_name */ + PYTHON_MODULENAME".ii", /* tp_name */ sizeof(rpmiiObject), /* tp_size */ 0, /* tp_itemsize */ (destructor) rpmii_dealloc, /* tp_dealloc */ diff --git a/python/rpmkeyring-py.c b/python/rpmkeyring-py.c index d5f131e42..7df847db7 100644 --- a/python/rpmkeyring-py.c +++ b/python/rpmkeyring-py.c @@ -52,7 +52,7 @@ static char rpmPubkey_doc[] = ""; PyTypeObject rpmPubkey_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) - "rpm.pubkey", /* tp_name */ + PYTHON_MODULENAME".pubkey", /* tp_name */ sizeof(rpmPubkeyObject), /* tp_size */ 0, /* tp_itemsize */ (destructor) rpmPubkey_dealloc,/* tp_dealloc */ @@ -133,7 +133,7 @@ static char rpmKeyring_doc[] = PyTypeObject rpmKeyring_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) - "rpm.keyring", /* tp_name */ + PYTHON_MODULENAME".keyring", /* tp_name */ sizeof(rpmKeyringObject), /* tp_size */ 0, /* tp_itemsize */ (destructor) rpmKeyring_dealloc,/* tp_dealloc */ diff --git a/python/rpmmi-py.c b/python/rpmmi-py.c index 379cafb38..6988f37d6 100644 --- a/python/rpmmi-py.c +++ b/python/rpmmi-py.c @@ -201,7 +201,7 @@ static char rpmmi_doc[] = PyTypeObject rpmmi_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) - "rpm.mi", /* tp_name */ + PYTHON_MODULENAME".mi", /* tp_name */ sizeof(rpmmiObject), /* tp_size */ 0, /* tp_itemsize */ (destructor) rpmmi_dealloc, /* tp_dealloc */ diff --git a/python/rpmps-py.c b/python/rpmps-py.c index bdc899a60..567a632e0 100644 --- a/python/rpmps-py.c +++ b/python/rpmps-py.c @@ -72,8 +72,8 @@ static void rpmprob_dealloc(rpmProblemObject *s) PyTypeObject rpmProblem_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) - "rpm.prob", /* tp_name */ - sizeof(rpmProblemObject), /* tp_basicsize */ + PYTHON_MODULENAME".prob", /* tp_name */ + sizeof(rpmProblemObject), /* tp_basicsize */ 0, /* tp_itemsize */ /* methods */ (destructor)rpmprob_dealloc, /* tp_dealloc */ diff --git a/python/rpmte-py.c b/python/rpmte-py.c index 6936e757e..5c8be47c8 100644 --- a/python/rpmte-py.c +++ b/python/rpmte-py.c @@ -204,7 +204,7 @@ rpmte_Files(rpmteObject * s, PyObject * args, PyObject * kwds) } static struct PyMethodDef rpmte_methods[] = { {"Type", (PyCFunction)rpmte_TEType, METH_NOARGS, - "te.Type() -- Return element type (rpm.TR_ADDED | rpm.TR_REMOVED).\n" }, + "te.Type() -- Return element type ("PYTHON_MODULENAME".TR_ADDED | "PYTHON_MODULENAME".TR_REMOVED).\n" }, {"N", (PyCFunction)rpmte_N, METH_NOARGS, "te.N() -- Return element name.\n" }, {"E", (PyCFunction)rpmte_E, METH_NOARGS, @@ -257,7 +257,7 @@ static char rpmte_doc[] = PyTypeObject rpmte_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) - "rpm.te", /* tp_name */ + PYTHON_MODULENAME".te", /* tp_name */ sizeof(rpmteObject), /* tp_size */ 0, /* tp_itemsize */ (destructor)0, /* tp_dealloc */ diff --git a/python/rpmts-py.c b/python/rpmts-py.c index d56a09c22..98e1c6642 100644 --- a/python/rpmts-py.c +++ b/python/rpmts-py.c @@ -459,7 +459,7 @@ static PyObject *rpmts_setKeyring(rpmtsObject *s, PyObject *arg) if (arg == Py_None || rpmKeyringFromPyObject(arg, &keyring)) { return PyBool_FromLong(rpmtsSetKeyring(s->ts, keyring) == 0); } else { - PyErr_SetString(PyExc_TypeError, "rpm.keyring or None expected"); + PyErr_SetString(PyExc_TypeError, PYTHON_MODULENAME".keyring or None expected"); return NULL; } } @@ -968,7 +968,7 @@ static PyGetSetDef rpmts_getseters[] = { PyTypeObject rpmts_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) - "rpm.ts", /* tp_name */ + PYTHON_MODULENAME".ts", /* tp_name */ sizeof(rpmtsObject), /* tp_size */ 0, /* tp_itemsize */ (destructor) rpmts_dealloc, /* tp_dealloc */ diff --git a/python/setup.py.in b/python/setup.py.in index dd56a47a9..a43bb6d4d 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -25,11 +25,11 @@ if os.access('Makefile.am', os.F_OK): os.environ['PKG_CONFIG_PATH'] = '..' -rpmmod = Extension('rpm._rpm', +rpmmod = Extension('@PYTHON_MODULENAME@._rpm', sources = [ 'header-py.c', 'rpmds-py.c', 'rpmfd-py.c', 'rpmfi-py.c', 'rpmii-py.c', 'rpmkeyring-py.c', 'rpmmacro-py.c', 'rpmmi-py.c', 'rpmps-py.c', - 'rpmstrpool-py.c', 'rpmfiles-py.c', + 'rpmstrpool-py.c', 'rpmfiles-py.c', 'rpmarchive-py.c', 'rpmtd-py.c', 'rpmte-py.c', 'rpmts-py.c', 'rpmmodule.c', ], @@ -40,7 +40,7 @@ rpmmod = Extension('rpm._rpm', extra_link_args = additional_link_args ) -rpmbuild_mod = Extension('rpm._rpmb', +rpmbuild_mod = Extension('@PYTHON_MODULENAME@._rpmb', sources = ['rpmbmodule.c', 'spec-py.c'], include_dirs = pkgconfig('--cflags'), library_dirs = pkgconfig('--libs-only-L'), @@ -49,7 +49,7 @@ rpmbuild_mod = Extension('rpm._rpmb', extra_link_args = additional_link_args ) -rpmsign_mod = Extension('rpm._rpms', +rpmsign_mod = Extension('@PYTHON_MODULENAME@._rpms', sources = ['rpmsmodule.c'], include_dirs = pkgconfig('--cflags'), library_dirs = pkgconfig('--libs-only-L'), diff --git a/python/spec-py.c b/python/spec-py.c index 47c17400f..392ecc004 100644 --- a/python/spec-py.c +++ b/python/spec-py.c @@ -31,10 +31,10 @@ /* Header objects are in another module, some hoop jumping required... */ static PyObject *makeHeader(Header h) { - PyObject *rpmmod = PyImport_ImportModuleNoBlock("rpm"); + PyObject *rpmmod = PyImport_ImportModuleNoBlock(PYTHON_MODULENAME); if (rpmmod == NULL) return NULL; - PyObject *ptr = CAPSULE_BUILD(h, "rpm._C_Header"); + PyObject *ptr = CAPSULE_BUILD(h, PYTHON_MODULENAME"._C_Header"); PyObject *hdr = PyObject_CallMethod(rpmmod, "hdr", "(O)", ptr); Py_XDECREF(ptr); Py_XDECREF(rpmmod); @@ -98,7 +98,7 @@ static PyGetSetDef specpkg_getseters[] = { PyTypeObject specPkg_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) - "rpm.specpkg", /* tp_name */ + PYTHON_MODULENAME".specpkg", /* tp_name */ sizeof(specPkgObject), /* tp_size */ 0, /* tp_itemsize */ (destructor) specPkg_dealloc, /* tp_dealloc */ @@ -312,7 +312,7 @@ static struct PyMethodDef spec_methods[] = { PyTypeObject spec_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) - "rpm.spec", /*tp_name*/ + PYTHON_MODULENAME".spec", /*tp_name*/ sizeof(specObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ (destructor) spec_dealloc, /*tp_dealloc*/ |