rpm-4.10.3.1-python-fixes.patch 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. diff --git a/python/header-py.c b/python/header-py.c
  2. index d194fdc..48a88ef 100644
  3. --- a/python/header-py.c
  4. +++ b/python/header-py.c
  5. @@ -683,7 +683,7 @@ static char hdr_doc[] =
  6. "";
  7. PyTypeObject hdr_Type = {
  8. - PyVarObject_HEAD_INIT(&PyType_Type, 0)
  9. + PyVarObject_HEAD_INIT(NULL, 0)
  10. "rpm.hdr", /* tp_name */
  11. sizeof(hdrObject), /* tp_size */
  12. 0, /* tp_itemsize */
  13. diff --git a/python/rpmbmodule.c b/python/rpmbmodule.c
  14. index f6e1491..f5c94f0 100644
  15. --- a/python/rpmbmodule.c
  16. +++ b/python/rpmbmodule.c
  17. @@ -10,18 +10,22 @@ static char rpmb__doc__[] =
  18. */
  19. static int prepareInitModule(void)
  20. {
  21. +#if !defined(__CYGWIN__)
  22. if (PyType_Ready(&spec_Type) < 0) return 0;
  23. if (PyType_Ready(&specPkg_Type) < 0) return 0;
  24. +#endif
  25. return 1;
  26. }
  27. static int initModule(PyObject *m)
  28. {
  29. +#if !defined(__CYGWIN__)
  30. Py_INCREF(&spec_Type);
  31. PyModule_AddObject(m, "spec", (PyObject *) &spec_Type);
  32. Py_INCREF(&specPkg_Type);
  33. PyModule_AddObject(m, "specPkg", (PyObject *) &specPkg_Type);
  34. +#endif
  35. #define REGISTER_ENUM(val) PyModule_AddIntConstant(m, #val, val)
  36. REGISTER_ENUM(RPMBUILD_ISSOURCE);
  37. diff --git a/python/rpmds-py.c b/python/rpmds-py.c
  38. index 30fb908..ed97690 100644
  39. --- a/python/rpmds-py.c
  40. +++ b/python/rpmds-py.c
  41. @@ -340,7 +340,7 @@ static char rpmds_doc[] =
  42. "";
  43. PyTypeObject rpmds_Type = {
  44. - PyVarObject_HEAD_INIT(&PyType_Type, 0)
  45. + PyVarObject_HEAD_INIT(NULL, 0)
  46. "rpm.ds", /* tp_name */
  47. sizeof(rpmdsObject), /* tp_basicsize */
  48. 0, /* tp_itemsize */
  49. diff --git a/python/rpmfd-py.c b/python/rpmfd-py.c
  50. index a266ad6..029487b 100644
  51. --- a/python/rpmfd-py.c
  52. +++ b/python/rpmfd-py.c
  53. @@ -309,7 +309,7 @@ static PyGetSetDef rpmfd_getseters[] = {
  54. };
  55. PyTypeObject rpmfd_Type = {
  56. - PyVarObject_HEAD_INIT(&PyType_Type, 0)
  57. + PyVarObject_HEAD_INIT(NULL, 0)
  58. "rpm.fd", /* tp_name */
  59. sizeof(rpmfdObject), /* tp_size */
  60. 0, /* tp_itemsize */
  61. diff --git a/python/rpmfi-py.c b/python/rpmfi-py.c
  62. index 458e721..66222f5 100644
  63. --- a/python/rpmfi-py.c
  64. +++ b/python/rpmfi-py.c
  65. @@ -319,7 +319,7 @@ static char rpmfi_doc[] =
  66. "";
  67. PyTypeObject rpmfi_Type = {
  68. - PyVarObject_HEAD_INIT(&PyType_Type, 0)
  69. + PyVarObject_HEAD_INIT(NULL, 0)
  70. "rpm.fi", /* tp_name */
  71. sizeof(rpmfiObject), /* tp_basicsize */
  72. 0, /* tp_itemsize */
  73. diff --git a/python/rpmii-py.c b/python/rpmii-py.c
  74. index d7713af..d323768 100644
  75. --- a/python/rpmii-py.c
  76. +++ b/python/rpmii-py.c
  77. @@ -102,7 +102,7 @@ static char rpmii_doc[] =
  78. "";
  79. PyTypeObject rpmii_Type = {
  80. - PyVarObject_HEAD_INIT(&PyType_Type, 0)
  81. + PyVarObject_HEAD_INIT(NULL, 0)
  82. "rpm.ii", /* tp_name */
  83. sizeof(rpmiiObject), /* tp_size */
  84. 0, /* tp_itemsize */
  85. diff --git a/python/rpmkeyring-py.c b/python/rpmkeyring-py.c
  86. index d5f131e..45ace97 100644
  87. --- a/python/rpmkeyring-py.c
  88. +++ b/python/rpmkeyring-py.c
  89. @@ -51,7 +51,7 @@ static struct PyMethodDef rpmPubkey_methods[] = {
  90. static char rpmPubkey_doc[] = "";
  91. PyTypeObject rpmPubkey_Type = {
  92. - PyVarObject_HEAD_INIT(&PyType_Type, 0)
  93. + PyVarObject_HEAD_INIT(NULL, 0)
  94. "rpm.pubkey", /* tp_name */
  95. sizeof(rpmPubkeyObject), /* tp_size */
  96. 0, /* tp_itemsize */
  97. @@ -132,7 +132,7 @@ static char rpmKeyring_doc[] =
  98. "";
  99. PyTypeObject rpmKeyring_Type = {
  100. - PyVarObject_HEAD_INIT(&PyType_Type, 0)
  101. + PyVarObject_HEAD_INIT(NULL, 0)
  102. "rpm.keyring", /* tp_name */
  103. sizeof(rpmKeyringObject), /* tp_size */
  104. 0, /* tp_itemsize */
  105. diff --git a/python/rpmmi-py.c b/python/rpmmi-py.c
  106. index 8e670ce..ad3d85b 100644
  107. --- a/python/rpmmi-py.c
  108. +++ b/python/rpmmi-py.c
  109. @@ -163,7 +163,7 @@ static char rpmmi_doc[] =
  110. "";
  111. PyTypeObject rpmmi_Type = {
  112. - PyVarObject_HEAD_INIT(&PyType_Type, 0)
  113. + PyVarObject_HEAD_INIT(NULL, 0)
  114. "rpm.mi", /* tp_name */
  115. sizeof(rpmmiObject), /* tp_size */
  116. 0, /* tp_itemsize */
  117. diff --git a/python/rpmps-py.c b/python/rpmps-py.c
  118. index bdc899a..04b01f9 100644
  119. --- a/python/rpmps-py.c
  120. +++ b/python/rpmps-py.c
  121. @@ -71,7 +71,7 @@ static void rpmprob_dealloc(rpmProblemObject *s)
  122. }
  123. PyTypeObject rpmProblem_Type = {
  124. - PyVarObject_HEAD_INIT(&PyType_Type, 0)
  125. + PyVarObject_HEAD_INIT(NULL, 0)
  126. "rpm.prob", /* tp_name */
  127. sizeof(rpmProblemObject), /* tp_basicsize */
  128. 0, /* tp_itemsize */
  129. diff --git a/python/rpmte-py.c b/python/rpmte-py.c
  130. index 2204a52..8884c03 100644
  131. --- a/python/rpmte-py.c
  132. +++ b/python/rpmte-py.c
  133. @@ -249,7 +249,7 @@ static char rpmte_doc[] =
  134. "";
  135. PyTypeObject rpmte_Type = {
  136. - PyVarObject_HEAD_INIT(&PyType_Type, 0)
  137. + PyVarObject_HEAD_INIT(NULL, 0)
  138. "rpm.te", /* tp_name */
  139. sizeof(rpmteObject), /* tp_size */
  140. 0, /* tp_itemsize */
  141. diff --git a/python/rpmts-py.c b/python/rpmts-py.c
  142. index 5c6e9ba..2ffeeac 100644
  143. --- a/python/rpmts-py.c
  144. +++ b/python/rpmts-py.c
  145. @@ -871,7 +871,7 @@ static PyGetSetDef rpmts_getseters[] = {
  146. };
  147. PyTypeObject rpmts_Type = {
  148. - PyVarObject_HEAD_INIT(&PyType_Type, 0)
  149. + PyVarObject_HEAD_INIT(NULL, 0)
  150. "rpm.ts", /* tp_name */
  151. sizeof(rpmtsObject), /* tp_size */
  152. 0, /* tp_itemsize */
  153. diff --git a/python/setup.py.in b/python/setup.py.in
  154. index 619b0ac..55a4f24 100644
  155. --- a/python/setup.py.in
  156. +++ b/python/setup.py.in
  157. @@ -27,14 +27,14 @@ rpmmod = Extension('rpm._rpm',
  158. 'rpmtd', 'rpmte', 'rpmts', 'rpmmodule',
  159. ]),
  160. include_dirs = pkgconfig('--cflags'),
  161. - libraries = pkgconfig('--libs'),
  162. + libraries = pkgconfig('--libs') + ['ssp'] + ['intl'],
  163. extra_compile_args = cflags
  164. )
  165. rpmbuild_mod = Extension('rpm._rpmb',
  166. sources = mksources(['rpmbmodule', 'spec']),
  167. include_dirs = pkgconfig('--cflags'),
  168. - libraries = pkgconfig('--libs') + ['rpmbuild'],
  169. + libraries = ['rpmbuild'] + ['magic'] + ['ssp'] + pkgconfig('--libs') + ['intl'],
  170. extra_compile_args = cflags
  171. )
  172. diff --git a/python/spec-py.c b/python/spec-py.c
  173. index 1850a50..5923421 100644
  174. --- a/python/spec-py.c
  175. +++ b/python/spec-py.c
  176. @@ -61,7 +61,7 @@ static PyGetSetDef specpkg_getseters[] = {
  177. };
  178. PyTypeObject specPkg_Type = {
  179. - PyVarObject_HEAD_INIT(&PyType_Type, 0)
  180. + PyVarObject_HEAD_INIT(NULL, 0)
  181. "rpm.specpkg", /* tp_name */
  182. sizeof(specPkgObject), /* tp_size */
  183. 0, /* tp_itemsize */
  184. @@ -262,7 +262,7 @@ static struct PyMethodDef spec_methods[] = {
  185. };
  186. PyTypeObject spec_Type = {
  187. - PyVarObject_HEAD_INIT(&PyType_Type, 0)
  188. + PyVarObject_HEAD_INIT(NULL, 0)
  189. "rpm.spec", /*tp_name*/
  190. sizeof(specObject), /*tp_basicsize*/
  191. 0, /*tp_itemsize*/
  192. diff --git a/rpm.pc.in b/rpm.pc.in
  193. index 9426920..86e63dc 100644
  194. --- a/rpm.pc.in
  195. +++ b/rpm.pc.in
  196. @@ -12,4 +12,4 @@ URL: http://rpm.org
  197. # Conflicts:
  198. Cflags: -I${includedir}
  199. Libs: -L${libdir} -lrpm -lrpmio
  200. -Libs.private: -lpopt -lrt -lpthread @WITH_SELINUX_LIB@ @WITH_LZMA_LIB@ @WITH_DB_LIB@ @WITH_BZ2_LIB@ @WITH_ZLIB_LIB@ @WITH_NSS_LIB@ @WITH_LUA_LIB@
  201. +Libs.private: -lpopt -lrt -lpthread @WITH_SELINUX_LIB@ @WITH_LZMA_LIB@ @WITH_DB_LIB@ @WITH_BZ2_LIB@ @WITH_ZLIB_LIB@ @WITH_NSS_LIB@