From 5b4fb2390cd457ebcf0d3f0d5b39b92c3618bd872de7b04c07c677a1f49fc763 Mon Sep 17 00:00:00 2001 From: Todd R Date: Tue, 20 May 2014 14:19:04 +0000 Subject: [PATCH 1/3] Accepting request 234864 from home:TheBlackCat:branches:devel:languages:python Update to version 7.19.3.1 OBS-URL: https://build.opensuse.org/request/show/234864 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pycurl?expand=0&rev=19 --- pycurl-7.18.1-nostaticlibs.patch | 14 - pycurl-7.19.0.tar.gz | 3 - pycurl-7.19.3.1.tar.gz | 3 + pycurl-no-runtime-curlvercheck.patch | 38 +- pycurl-python3.patch | 1015 -------------------------- python-pycurl.changes | 124 ++++ python-pycurl.spec | 24 +- 7 files changed, 161 insertions(+), 1060 deletions(-) delete mode 100644 pycurl-7.18.1-nostaticlibs.patch delete mode 100644 pycurl-7.19.0.tar.gz create mode 100644 pycurl-7.19.3.1.tar.gz delete mode 100644 pycurl-python3.patch diff --git a/pycurl-7.18.1-nostaticlibs.patch b/pycurl-7.18.1-nostaticlibs.patch deleted file mode 100644 index 69978b8..0000000 --- a/pycurl-7.18.1-nostaticlibs.patch +++ /dev/null @@ -1,14 +0,0 @@ -Index: setup.py -=================================================================== ---- setup.py.orig 2008-04-22 11:00:45.000000000 -0300 -+++ setup.py 2008-04-25 17:52:50.000000000 -0300 -@@ -97,8 +97,7 @@ else: - else: - extra_compile_args.append(e) - libs = split_quoted( -- os.popen("'%s' --libs" % CURL_CONFIG).read()+\ -- os.popen("'%s' --static-libs" % CURL_CONFIG).read()) -+ os.popen("'%s' --libs" % CURL_CONFIG).read()) - for e in libs: - if e[:2] == "-l": - libraries.append(e[2:]) diff --git a/pycurl-7.19.0.tar.gz b/pycurl-7.19.0.tar.gz deleted file mode 100644 index c9d19dd..0000000 --- a/pycurl-7.19.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:eb782dfcc5a7c023539a077462b83c167e178128ee9f7201665b9fbb1a8b0642 -size 71346 diff --git a/pycurl-7.19.3.1.tar.gz b/pycurl-7.19.3.1.tar.gz new file mode 100644 index 0000000..6d3704a --- /dev/null +++ b/pycurl-7.19.3.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c0d673fe99a9de07239eabe77c798f1b043f60c02afaec1430ceaf59d7501a4f +size 116687 diff --git a/pycurl-no-runtime-curlvercheck.patch b/pycurl-no-runtime-curlvercheck.patch index f291b48..63167e3 100644 --- a/pycurl-no-runtime-curlvercheck.patch +++ b/pycurl-no-runtime-curlvercheck.patch @@ -1,27 +1,27 @@ ---- pycurl-7.19.0.orig/src/pycurl.c -+++ pycurl-7.19.0/src/pycurl.c -@@ -3450,7 +3450,7 @@ initpycurl(void) - - /* Add version strings to the module */ - insstr(d, "version", curl_version()); -- insstr(d, "COMPILE_DATE", __DATE__ " " __TIME__); -+ //insstr(d, "COMPILE_DATE", __DATE__ " " __TIME__); - insint(d, "COMPILE_PY_VERSION_HEX", PY_VERSION_HEX); - insint(d, "COMPILE_LIBCURL_VERSION_NUM", LIBCURL_VERSION_NUM); - -@@ -3883,6 +3883,7 @@ initpycurl(void) - insint_s(d, "LOCK_DATA_COOKIE", CURL_LOCK_DATA_COOKIE); - insint_s(d, "LOCK_DATA_DNS", CURL_LOCK_DATA_DNS); +--- a/src/pycurl.c 2014-02-06 10:27:56.000000000 +0100 ++++ b/src/pycurl.c 2014-05-20 16:09:57.513592172 +0200 +@@ -4440,6 +4440,7 @@ + const char *libcurl_version, *runtime_ssl_lib; + int libcurl_version_len, pycurl_version_len; +#if 0 /* Check the version, as this has caused nasty problems in * some cases. */ vi = curl_version_info(CURLVERSION_NOW); -@@ -3894,6 +3895,7 @@ initpycurl(void) - Py_FatalError("pycurl: libcurl link-time version is older than compile-time version"); - assert(0); +@@ -4451,6 +4452,7 @@ + PyErr_Format(PyExc_ImportError, "pycurl: libcurl link-time version (%s) is older than compile-time version (%s)", vi->version, LIBCURL_VERSION); + PYCURL_MODINIT_RETURN_NULL; } +#endif + + /* Our compiled crypto locks should correspond to runtime ssl library. */ + if (vi->ssl_version == NULL) { +@@ -4526,7 +4528,7 @@ + #undef PYCURL_VERSION_PREFIX_SIZE + + insobj2(d, NULL, "version", PyText_FromString(g_pycurl_useragent)); +- insstr(d, "COMPILE_DATE", __DATE__ " " __TIME__); ++ //insstr(d, "COMPILE_DATE", __DATE__ " " __TIME__); + insint(d, "COMPILE_PY_VERSION_HEX", PY_VERSION_HEX); + insint(d, "COMPILE_LIBCURL_VERSION_NUM", LIBCURL_VERSION_NUM); - /* Initialize callback locks if ssl is enabled */ - #if defined(PYCURL_NEED_SSL_TSL) diff --git a/pycurl-python3.patch b/pycurl-python3.patch deleted file mode 100644 index b8467b3..0000000 --- a/pycurl-python3.patch +++ /dev/null @@ -1,1015 +0,0 @@ -diff -ruN ./examples/basicfirst.py ../pycurl-7.19.0.test/examples/basicfirst.py ---- ./examples/basicfirst.py 2005-02-11 19:09:11.000000000 +0800 -+++ ../pycurl-7.19.0.test/examples/basicfirst.py 2012-04-28 15:30:41.041273003 +0900 -@@ -13,13 +13,17 @@ - def body_callback(self, buf): - self.contents = self.contents + buf - --print >>sys.stderr, 'Testing', pycurl.version -+#print('Testing', pycurl.version, file=sys.stderr) - --t = Test() --c = pycurl.Curl() --c.setopt(c.URL, 'http://curl.haxx.se/dev/') --c.setopt(c.WRITEFUNCTION, t.body_callback) --c.perform() --c.close() -+try: -+ t = Test() -+ c = pycurl.Curl() -+ c.setopt(c.URL, sys.argv[1]) -+ c.setopt(c.WRITEFUNCTION, t.body_callback) -+ c.perform() -+ c.close() -+# print(t) -+ print(t.contents) -+except Exception as e: -+ print(e) - --print t.contents -diff -ruN ./examples/retriever-multi.py ../pycurl-7.19.0.test/examples/retriever-multi.py ---- ./examples/retriever-multi.py 2005-07-28 20:04:13.000000000 +0900 -+++ ../pycurl-7.19.0.test/examples/retriever-multi.py 2012-04-28 15:10:34.768799001 +0900 -@@ -10,6 +10,7 @@ - - import sys - import pycurl -+import time - - # We should ignore SIGPIPE when using pycurl.NOSIGNAL - see - # the libcurl tutorial for more info. -@@ -31,7 +32,7 @@ - if len(sys.argv) >= 3: - num_conn = int(sys.argv[2]) - except: -- print "Usage: %s [<# of concurrent connections>]" % sys.argv[0] -+ print("Usage: %s [<# of concurrent connections>]" % sys.argv[0]) - raise SystemExit - - -@@ -50,8 +51,8 @@ - num_urls = len(queue) - num_conn = min(num_conn, num_urls) - assert 1 <= num_conn <= 10000, "invalid number of concurrent connections" --print "PycURL %s (compiled against 0x%x)" % (pycurl.version, pycurl.COMPILE_LIBCURL_VERSION_NUM) --print "----- Getting", num_urls, "URLs using", num_conn, "connections -----" -+print("PycURL %s (compiled against 0x%x)" % (pycurl.version, pycurl.COMPILE_LIBCURL_VERSION_NUM)) -+print("----- Getting", num_urls, "URLs using", num_conn, "connections -----") - - - # Pre-allocate a list of curl objects -@@ -79,6 +80,9 @@ - c.fp = open(filename, "wb") - c.setopt(pycurl.URL, url) - c.setopt(pycurl.WRITEDATA, c.fp) -+# print(c.fp) -+# c.fp.close() -+# c.fp = None - m.add_handle(c) - # store some info - c.filename = filename -@@ -92,16 +96,17 @@ - while 1: - num_q, ok_list, err_list = m.info_read() - for c in ok_list: -+ c.fp.flush() - c.fp.close() - c.fp = None - m.remove_handle(c) -- print "Success:", c.filename, c.url, c.getinfo(pycurl.EFFECTIVE_URL) -+ print("Success:", c.filename, c.url, c.getinfo(pycurl.EFFECTIVE_URL)) - freelist.append(c) - for c, errno, errmsg in err_list: - c.fp.close() - c.fp = None - m.remove_handle(c) -- print "Failed: ", c.filename, c.url, errno, errmsg -+ print("Failed: ", c.filename, c.url, errno, errmsg) - freelist.append(c) - num_processed = num_processed + len(ok_list) + len(err_list) - if num_q == 0: -@@ -120,3 +125,4 @@ - c.close() - m.close() - -+#time.sleep(30) -diff -ruN ./setup.py ../pycurl-7.19.0.test/setup.py ---- ./setup.py 2012-04-28 15:05:16.000000000 +0900 -+++ ../pycurl-7.19.0.test/setup.py 2012-04-28 15:10:34.768799001 +0900 -@@ -31,7 +31,7 @@ - i = 1 - while i < len(sys.argv): - arg = sys.argv[i] -- if string.find(arg, s) == 0: -+ if str.find(arg, s) == 0: - p = arg[len(s):] - assert p, arg - del sys.argv[i] -@@ -46,8 +46,8 @@ - v = os.environ.get(envvar) - if not v: - return -- for dir in string.split(v, sep): -- dir = string.strip(dir) -+ for dir in str.split(v, sep): -+ dir = str.strip(dir) - if not dir: - continue - dir = os.path.normpath(dir) -@@ -55,7 +55,7 @@ - if not dir in library_dirs: - library_dirs.append(dir) - elif fatal: -- print "FATAL: bad directory %s in environment variable %s" % (dir, envvar) -+ print("FATAL: bad directory %s in environment variable %s" % (dir, envvar)) - sys.exit(1) - - -@@ -65,13 +65,13 @@ - # and thus unlikely to match your installation. - CURL_DIR = r"c:\src\build\pycurl\curl-7.16.2.1" - CURL_DIR = scan_argv("--curl-dir=", CURL_DIR) -- print "Using curl directory:", CURL_DIR -+ print("Using curl directory:", CURL_DIR) - assert os.path.isdir(CURL_DIR), "please check CURL_DIR in setup.py" - include_dirs.append(os.path.join(CURL_DIR, "include")) - extra_objects.append(os.path.join(CURL_DIR, "lib", "libcurl.lib")) - extra_link_args.extend(["gdi32.lib", "wldap32.lib", "winmm.lib", "ws2_32.lib",]) - add_libdirs("LIB", ";") -- if string.find(sys.version, "MSC") >= 0: -+ if str.find(sys.version, "MSC") >= 0: - extra_compile_args.append("-O2") - extra_compile_args.append("-GF") # enable read-only string pooling - extra_compile_args.append("-WX") # treat warnings as errors -@@ -85,10 +85,10 @@ - CURL_CONFIG = scan_argv("--curl-config=", CURL_CONFIG) - d = os.popen("'%s' --version" % CURL_CONFIG).read() - if d: -- d = string.strip(d) -+ d = str.strip(d) - if not d: -- raise Exception, ("`%s' not found -- please install the libcurl development files" % CURL_CONFIG) -- print "Using %s (%s)" % (CURL_CONFIG, d) -+ raise Exception("`%s' not found -- please install the libcurl development files" % CURL_CONFIG) -+ print("Using %s (%s)" % (CURL_CONFIG, d)) - for e in split_quoted(os.popen("'%s' --cflags" % CURL_CONFIG).read()): - if e[:2] == "-I": - # do not add /usr/include -@@ -208,4 +208,4 @@ - for o in ext.extra_objects: - assert os.path.isfile(o), o - # We can live with the deprecationwarning for a while -- apply(setup, (), setup_args) -+ setup(*(), **setup_args) -diff -ruN ./src/pycurl.c ../pycurl-7.19.0.test/src/pycurl.c ---- ./src/pycurl.c 2008-09-10 02:40:34.000000000 +0900 -+++ ../pycurl-7.19.0.test/src/pycurl.c 2012-04-28 15:18:26.302305002 +0900 -@@ -94,6 +94,17 @@ - static void pycurl_ssl_cleanup(void); - #endif - -+#if PY_MAJOR_VERSION < 3 -+#define Py_TYPE(x) (x)->ob_type -+#endif -+ -+#if PY_MAJOR_VERSION >= 3 -+ #define PyInt_Type PyLong_Type -+ #define PyInt_Check(op) PyLong_Check(op) -+ #define PyInt_FromLong PyLong_FromLong -+ #define PyInt_AsLong PyLong_AsLong -+#endif -+ - /* Calculate the number of OBJECTPOINT options we need to store */ - #define OPTIONS_SIZE ((int)CURLOPT_LASTENTRY % 10000) - #define MOPTIONS_SIZE ((int)CURLMOPT_LASTENTRY % 10000) -@@ -158,6 +169,7 @@ - PyObject *opensocket_cb; - /* file objects */ - PyObject *readdata_fp; -+ PyObject *writedata; - PyObject *writedata_fp; - PyObject *writeheader_fp; - /* misc */ -@@ -199,16 +211,46 @@ - # define PY_LONG_LONG LONG_LONG - #endif - -+int PyUnicode_AsStringAndSize(PyObject *obj, char **buffer, Py_ssize_t *length) -+{ -+ Py_ssize_t pysize = PyUnicode_GetSize(obj); -+ wchar_t * str = (wchar_t *) malloc((pysize + 1) * sizeof(wchar_t)); -+ PyUnicode_AsWideChar((PyUnicodeObject *) obj, str, pysize); -+ str[pysize] = '\0'; -+ -+// measure size -+ size_t csize = wcstombs(0, str, 0); -+ if( csize == (size_t) -1 ) -+ { -+ free(str); -+ return -1; -+ } -+ -+ char *cstr = (char *) malloc(csize + 1); -+ -+// convert -+ wcstombs(cstr, str, csize + 1); -+ *buffer = cstr; -+ if( length ) -+ *length = csize; -+ free(str); -+ return 0; -+} -+ -+ - /* Like PyString_AsString(), but set an exception if the string contains - * embedded NULs. Actually PyString_AsStringAndSize() already does that for - * us if the `len' parameter is NULL - see Objects/stringobject.c. - */ -- - static char *PyString_AsString_NoNUL(PyObject *obj) - { - char *s = NULL; - Py_ssize_t r; -+#if PY_MAJOR_VERSION >= 3 -+ r = PyUnicode_AsStringAndSize(obj, &s, NULL); -+#else - r = PyString_AsStringAndSize(obj, &s, NULL); -+#endif - if (r != 0) - return NULL; /* exception already set */ - assert(s != NULL); -@@ -233,7 +275,11 @@ - if (slist->data == NULL) { - v = Py_None; Py_INCREF(v); - } else { -+#if PY_MAJOR_VERSION >= 3 -+ v = PyUnicode_FromString(slist->data); -+#else - v = PyString_FromString(slist->data); -+#endif - } - if (v == NULL || PyList_Append(ret, v) != 0) { - Py_XDECREF(v); -@@ -269,7 +315,7 @@ - */ - if (self == NULL) - return NULL; -- assert(self->ob_type == p_Curl_Type); -+ assert(Py_TYPE(self) == p_Curl_Type); - if (self->state != NULL) - { - /* inside perform() */ -@@ -299,7 +345,7 @@ - */ - if (self == NULL) - return NULL; -- assert(self->ob_type == p_CurlMulti_Type); -+ assert(Py_TYPE(self) == p_CurlMulti_Type); - if (self->state != NULL) - { - /* inside multi_perform() */ -@@ -315,7 +361,7 @@ - assert_share_state(const CurlShareObject *self) - { - assert(self != NULL); -- assert(self->ob_type == p_CurlShare_Type); -+ assert(Py_TYPE(self) == p_CurlShare_Type); - assert(self->lock != NULL); - } - -@@ -325,7 +371,7 @@ - assert_curl_state(const CurlObject *self) - { - assert(self != NULL); -- assert(self->ob_type == p_Curl_Type); -+ assert(Py_TYPE(self) == p_Curl_Type); - (void) get_thread_state(self); - } - -@@ -335,7 +381,7 @@ - assert_multi_state(const CurlMultiObject *self) - { - assert(self != NULL); -- assert(self->ob_type == p_CurlMulti_Type); -+ assert(Py_TYPE(self) == p_CurlMulti_Type); - if (self->state != NULL) { - assert(self->multi_handle != NULL); - } -@@ -553,6 +599,7 @@ - share_lock_unlock(share->lock, data); - } - -+size_t default_write_callback(char *ptr, size_t size, size_t nmemb, void *stream); - - /* constructor - this is a module-level function returning a new instance */ - static CurlShareObject * -@@ -673,7 +720,8 @@ - - /* Handle the case of integer arguments */ - if (PyInt_Check(obj)) { -- long d = PyInt_AsLong(obj); -+ long d = PyLong_AsLong(obj); -+ - if (d != CURL_LOCK_DATA_COOKIE && d != CURL_LOCK_DATA_DNS) { - goto error; - } -@@ -806,11 +854,23 @@ - } - self->options[ OPT_INDEX(CURLOPT_USERAGENT) ] = s; s = NULL; - -+ -+#if PY_MAJOR_VERSION >= 3 -+ res = curl_easy_setopt(self->handle, CURLOPT_WRITEFUNCTION, default_write_callback); -+ if (res != CURLE_OK) { -+ goto error; -+ } -+ res = curl_easy_setopt(self->handle, CURLOPT_WRITEDATA, self); -+ if (res != CURLE_OK) { -+ goto error; -+ } -+#endif -+ - /* Success - return new object */ - return self; - - error: -- Py_DECREF(self); /* this also closes self->handle */ -+ Py_XDECREF(self); /* this also closes self->handle */ - PyErr_SetString(ErrorObject, "initializing curl failed"); - return NULL; - } -@@ -877,7 +937,7 @@ - /* Zero handle and thread-state to disallow any operations to be run - * from now on */ - assert(self != NULL); -- assert(self->ob_type == p_Curl_Type); -+ assert(Py_TYPE(self) == p_Curl_Type); - handle = self->handle; - self->handle = NULL; - if (handle == NULL) { -@@ -962,7 +1022,12 @@ - return NULL; - } - self->error[sizeof(self->error) - 1] = 0; -+ -+#if PY_MAJOR_VERSION >= 3 -+ return PyUnicode_FromString(self->error); -+#else - return PyString_FromString(self->error); -+#endif - } - - -@@ -1122,6 +1187,52 @@ - return util_write_callback(0, ptr, size, nmemb, stream); - } - -+ -+size_t -+default_write_callback(char *ptr, size_t size, size_t nmemb, void *stream) -+{ -+ CurlObject *obj = (CurlObject *)stream; -+ PyThreadState *tmp_state; -+ CurlObject *self = (CurlObject *)stream; -+ -+ /* acquire thread */ -+ int ret = 0; -+ tmp_state = get_thread_state(self); -+ if (tmp_state == NULL) -+ return ret; -+ PyEval_AcquireThread(tmp_state); -+ -+ if(obj->writedata_fp != NULL) -+ { -+ /** -+ * I'd prefer this code, but -+ * PyFile_WriteObject converts the object to str or repr, which are of type str -+ * and the write() fn expects bytes or buffer ... -+ */ -+/* -+ PyObject *w = PyBytes_FromStringAndSize(ptr, size*nmemb); -+ printf("writedata_fp %p w %p s %i\n", obj->writedata_fp, w, PyBytes_GET_SIZE(w)); -+ Py_INCREF(w); -+ if( PyFile_WriteObject(w, obj->writedata_fp, Py_PRINT_RAW) != 0 ) -+ { -+ PyErr_Print(); -+ ret = -1; -+ } -+ -+ Py_DECREF(w); -+*/ -+ int fd = PyObject_AsFileDescriptor(((CurlObject *)stream)->writedata_fp); -+ ret = write(fd, ptr, size*nmemb); -+ }else -+ { -+ fwrite(ptr, size, nmemb, stdout); -+ } -+ -+ PyEval_ReleaseThread(tmp_state); -+ return ret; -+} -+ -+ - static size_t - header_callback(char *ptr, size_t size, size_t nmemb, void *stream) - { -@@ -1163,6 +1274,7 @@ - ret = CURL_SOCKET_BAD; - goto verbose_error; - } -+ - // normal operation: - if (PyInt_Check(fileno_result)) { - ret = dup(PyInt_AsLong(fileno_result)); -@@ -1224,11 +1336,19 @@ - goto verbose_error; - - /* handle result */ -+#if PY_MAJOR_VERSION >= 3 -+ if (PyBytes_Check(result)) { -+#else - if (PyString_Check(result)) { -+#endif - char *buf = NULL; - Py_ssize_t obj_size = -1; - Py_ssize_t r; -+#if PY_MAJOR_VERSION >= 3 -+ r = PyBytes_AsStringAndSize(result, &buf, &obj_size); -+#else - r = PyString_AsStringAndSize(result, &buf, &obj_size); -+#endif - if (r != 0 || obj_size < 0 || obj_size > total_size) { - PyErr_Format(ErrorObject, "invalid return value for read callback %ld %ld", (long)obj_size, (long)total_size); - goto verbose_error; -@@ -1401,6 +1521,7 @@ - if (result == Py_None) { - ret = CURLIOE_OK; /* None means success */ - } -+ - else if (PyInt_Check(result)) { - ret = (int) PyInt_AsLong(result); - if (ret >= CURLIOE_LAST || ret < 0) { -@@ -1584,7 +1705,11 @@ - #endif - - /* Handle the case of string arguments */ -+#if PY_MAJOR_VERSION >= 3 -+ if (PyUnicode_Check(obj)) { -+#else - if (PyString_Check(obj)) { -+#endif - char *str = NULL; - Py_ssize_t len = -1; - char *buf; -@@ -1633,8 +1758,13 @@ - return NULL; - break; - case CURLOPT_POSTFIELDS: -+#if PY_MAJOR_VERSION >= 3 -+ if (PyUnicode_AsStringAndSize(obj, &str, &len) != 0) -+ return NULL; -+#else - if (PyString_AsStringAndSize(obj, &str, &len) != 0) - return NULL; -+#endif - /* automatically set POSTFIELDSIZE */ - if (len <= INT_MAX) { - res = curl_easy_setopt(self->handle, CURLOPT_POSTFIELDSIZE, (long)len); -@@ -1683,7 +1813,6 @@ - /* Handle the case of integer arguments */ - if (PyInt_Check(obj)) { - long d = PyInt_AsLong(obj); -- - if (IS_LONG_OPTION(option)) - res = curl_easy_setopt(self->handle, (CURLoption)option, (long)d); - else if (IS_OFF_T_OPTION(option)) -@@ -1724,7 +1853,12 @@ - #undef IS_OFF_T_OPTION - - /* Handle the case of file objects */ -+#if PY_MAJOR_VERSION >= 3 -+ extern PyTypeObject PyIOBase_Type; -+ if(PyObject_IsInstance(obj, (PyObject *)&PyIOBase_Type) == 1) { -+#else - if (PyFile_Check(obj)) { -+#endif - FILE *fp; - - /* Ensure the option specified a file as well as the input */ -@@ -1742,7 +1876,12 @@ - PyErr_SetString(PyExc_TypeError, "files are not supported for this option"); - return NULL; - } -- -+#if PY_MAJOR_VERSION >= 3 -+// printf("WRITEDATA %p\n",obj); -+// int fd = PyObject_AsFileDescriptor(obj); -+// printf("fd is %i\n", fd); -+// fp = fdopen(fd, "w"); -+#else - fp = PyFile_AsFile(obj); - if (fp == NULL) { - PyErr_SetString(PyExc_TypeError, "second argument must be open file"); -@@ -1752,6 +1891,7 @@ - if (res != CURLE_OK) { - CURLERROR_RETVAL(); - } -+#endif - Py_INCREF(obj); - - switch (option) { -@@ -1841,14 +1981,27 @@ - PyErr_SetString(PyExc_TypeError, "tuple must contain two elements (name, value)"); - return NULL; - } -+#if PY_MAJOR_VERSION >= 3 -+ if (PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(listitem, 0), &nstr, &nlen) != 0) { -+#else - if (PyString_AsStringAndSize(PyTuple_GET_ITEM(listitem, 0), &nstr, &nlen) != 0) { -+#endif - curl_formfree(post); - PyErr_SetString(PyExc_TypeError, "tuple must contain string as first element"); - return NULL; - } -+#if PY_MAJOR_VERSION >= 3 -+ if (PyUnicode_Check(PyTuple_GET_ITEM(listitem, 1))) { -+#else - if (PyString_Check(PyTuple_GET_ITEM(listitem, 1))) { -+#endif - /* Handle strings as second argument for backwards compatibility */ -+ -+#if PY_MAJOR_VERSION >= 3 -+ PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(listitem, 1), &cstr, &clen); -+#else - PyString_AsStringAndSize(PyTuple_GET_ITEM(listitem, 1), &cstr, &clen); -+#endif - /* INFO: curl_formadd() internally does memdup() the data, so - * embedded NUL characters _are_ allowed here. */ - res = curl_formadd(&post, &last, -@@ -1902,7 +2055,11 @@ - curl_formfree(post); - return NULL; - } -+#if PY_MAJOR_VERSION >= 3 -+ if (!PyUnicode_Check(PyTuple_GET_ITEM(t, j+1))) { -+#else - if (!PyString_Check(PyTuple_GET_ITEM(t, j+1))) { -+#endif - PyErr_SetString(PyExc_TypeError, "value must be string"); - PyMem_Free(forms); - curl_formfree(post); -@@ -1920,7 +2077,11 @@ - curl_formfree(post); - return NULL; - } -+#if PY_MAJOR_VERSION >= 3 -+ PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(t, j+1), &ostr, &olen); -+#else - PyString_AsStringAndSize(PyTuple_GET_ITEM(t, j+1), &ostr, &olen); -+#endif - forms[k].option = val; - forms[k].value = ostr; - ++k; -@@ -1972,7 +2133,11 @@ - struct curl_slist *nlist; - char *str; - -+#if PY_MAJOR_VERSION >= 3 -+ if (!PyUnicode_Check(listitem)) { -+#else - if (!PyString_Check(listitem)) { -+#endif - curl_slist_free_all(slist); - PyErr_SetString(PyExc_TypeError, "list items must be string objects"); - return NULL; -@@ -2187,7 +2352,12 @@ - Py_INCREF(Py_None); - return Py_None; - } -+#if PY_MAJOR_VERSION >= 3 -+ return PyUnicode_FromString(s_res); -+#else - return PyString_FromString(s_res); -+#endif -+ - } - - case CURLINFO_CONNECT_TIME: -@@ -2846,7 +3016,7 @@ - Py_DECREF(ok_list); - CURLERROR_MSG("Unable to fetch curl handle from curl object"); - } -- assert(co->ob_type == p_Curl_Type); -+ assert(Py_TYPE(co) == p_Curl_Type); - if (msg->msg != CURLMSG_DONE) { - /* FIXME: what does this mean ??? */ - } -@@ -2927,7 +3097,6 @@ - * socket code to report any errors. - */ - } -- - return PyInt_FromLong(n); - } - -@@ -2992,6 +3161,116 @@ - static PyObject *curlmultiobject_constants = NULL; - static PyObject *curlshareobject_constants = NULL; - -+ -+#if PY_MAJOR_VERSION >= 3 -+static PyObject * -+my_getattro(PyObject *co, PyObject *name, PyObject *dict1, PyObject *dict2, PyMethodDef *m) -+{ -+ PyObject *v = NULL; -+ if( v == NULL && dict1 != NULL ) -+ v = PyDict_GetItem(dict1, name); -+ if( v == NULL && dict2 != NULL ) -+ v = PyDict_GetItem(dict2, name); -+ if( v != NULL ) -+ { -+ Py_INCREF(v); -+ return v; -+ } -+ return NULL; -+} -+ -+static int -+my_setattro(PyObject **dict, PyObject *name, PyObject *v) -+{ -+ if( *dict == NULL ) -+ { -+ *dict = PyDict_New(); -+ if( *dict == NULL ) -+ return -1; -+ } -+ return PyDict_SetItem(*dict, name, v); -+} -+ -+PyObject *do_curl_getattro(PyObject *o, PyObject *n) -+{ -+ PyObject *v = PyObject_GenericGetAttr(o, n); -+ if( !v && PyErr_ExceptionMatches(PyExc_AttributeError) ) -+ { -+ PyErr_Clear(); -+ v = my_getattro(o, n, ((CurlObject *)o)->dict, -+ curlobject_constants, curlobject_methods); -+ } -+ return v; -+} -+ -+static int -+do_curl_setattro(PyObject *o, PyObject *name, PyObject *v) -+{ -+ assert_curl_state((CurlObject *)o); -+ if( v ) -+ { -+ return my_setattro(&((CurlObject *)o)->dict, name, v); -+ } else -+ { -+ return PyObject_GenericSetAttr(o, name, 0); -+ } -+} -+ -+static PyObject * -+do_multi_getattro(PyObject *o, PyObject *n) -+{ -+ assert_multi_state((CurlMultiObject *)o); -+ PyObject *v = PyObject_GenericGetAttr(o, n); -+ if( !v && PyErr_ExceptionMatches(PyExc_AttributeError) ) -+ { -+ PyErr_Clear(); -+ v = my_getattro(o, n, ((CurlMultiObject *)o)->dict, -+ curlmultiobject_constants, curlmultiobject_methods); -+ } -+ return v; -+} -+ -+static int -+do_multi_setattro(PyObject *o, PyObject *n, PyObject *v) -+{ -+ assert_multi_state((CurlMultiObject *)o); -+ if( v ) -+ { -+ return my_setattro(&((CurlMultiObject *)o)->dict, n, v); -+ } else -+ { -+ return PyObject_GenericSetAttr(o, n, 0); -+ } -+} -+ -+static PyObject * -+do_share_getattro(PyObject *o, PyObject *n) -+{ -+ assert_share_state((CurlShareObject *)o); -+ PyObject *v = PyObject_GenericGetAttr(o, n); -+ if( !v && PyErr_ExceptionMatches(PyExc_AttributeError) ) -+ { -+ PyErr_Clear(); -+ v = my_getattro(o, n, ((CurlShareObject *)o)->dict, -+ curlshareobject_constants, curlshareobject_methods); -+ } -+ return v; -+} -+ -+static int -+do_share_setattro(PyObject *o, PyObject *n, PyObject *v) -+{ -+ assert_share_state((CurlShareObject *)o); -+ if( v ) -+ { -+ return my_setattro(&((CurlShareObject *)o)->dict, n, v); -+ } else -+ { -+ return PyObject_GenericSetAttr(o, n, 0); -+ } -+} -+ -+#else - static int - my_setattr(PyObject **dict, char *name, PyObject *v) - { -@@ -3026,6 +3305,7 @@ - return Py_FindMethod(m, co, name); - } - -+ - static int - do_share_setattr(CurlShareObject *so, char *name, PyObject *v) - { -@@ -3070,10 +3350,53 @@ - return my_getattr((PyObject *)co, name, co->dict, - curlmultiobject_constants, curlmultiobject_methods); - } -+#endif - - --/* --------------- actual type definitions --------------- */ - -+/* --------------- actual type definitions --------------- */ -+#if PY_MAJOR_VERSION >= 3 -+static PyTypeObject CurlShare_Type = { -+ PyVarObject_HEAD_INIT(NULL, 0) -+ "pycurl.CurlShare", /* tp_name */ -+ sizeof(CurlShareObject), /* tp_basicsize */ -+ 0, /* tp_itemsize */ -+ (destructor)do_share_dealloc,/* tp_dealloc */ -+ 0, /* tp_print */ -+ 0, /* tp_getattr */ -+ 0, /* tp_setattr */ -+ 0, /* tp_reserved */ -+ 0, /* tp_repr */ -+ 0, /* tp_as_number */ -+ 0, /* tp_as_sequence */ -+ 0, /* tp_as_mapping */ -+ 0, /* tp_hash */ -+ 0, /* tp_call */ -+ 0, /* tp_str */ -+ (getattrofunc)do_share_getattro, /* tp_getattro */ -+ (setattrofunc)do_share_setattro, /* tp_setattro */ -+ 0, /* tp_as_buffer */ -+ Py_TPFLAGS_HAVE_GC, /* tp_flags */ -+ 0, /* tp_doc */ -+ (traverseproc)do_share_traverse, /* tp_traverse */ -+ (inquiry)do_share_clear, /* tp_clear */ -+ 0, /* tp_richcompare */ -+ 0, /* tp_weaklistoffset */ -+ 0, /* tp_iter */ -+ 0, /* tp_iternext */ -+ curlshareobject_methods, /* tp_methods */ -+ 0, /* tp_members */ -+ 0, /* tp_getset */ -+ 0, /* tp_base */ -+ 0, /* tp_dict */ -+ 0, /* tp_descr_get */ -+ 0, /* tp_descr_set */ -+ 0, /* tp_dictoffset */ -+ 0, /* tp_init */ -+ 0, /* tp_alloc */ -+ 0, /* tp_new */ -+}; -+#else - static PyTypeObject CurlShare_Type = { - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -@@ -3104,7 +3427,50 @@ - * safely ignore any compiler warnings about missing initializers. - */ - }; -+#endif - -+#if PY_MAJOR_VERSION >= 3 -+static PyTypeObject Curl_Type = { -+ PyVarObject_HEAD_INIT(NULL, 0) -+ "pycurl.Curl", /* tp_name */ -+ sizeof(CurlObject), /* tp_basicsize */ -+ 0, /* tp_itemsize */ -+ (destructor)do_curl_dealloc,/* tp_dealloc */ -+ 0, /* tp_print */ -+ 0, /* tp_getattr */ -+ 0, /* tp_setattr */ -+ 0, /* tp_reserved */ -+ 0, /* tp_repr */ -+ 0, /* tp_as_number */ -+ 0, /* tp_as_sequence */ -+ 0, /* tp_as_mapping */ -+ 0, /* tp_hash */ -+ 0, /* tp_call */ -+ 0, /* tp_str */ -+ (getattrofunc)do_curl_getattro, /* tp_getattro */ -+ (setattrofunc)do_curl_setattro, /* tp_setattro */ -+ 0, /* tp_as_buffer */ -+ Py_TPFLAGS_HAVE_GC, /* tp_flags */ -+ 0, /* tp_doc */ -+ (traverseproc)do_curl_traverse, /* tp_traverse */ -+ (inquiry)do_curl_clear, /* tp_clear */ -+ 0, /* tp_richcompare */ -+ 0, /* tp_weaklistoffset */ -+ 0, /* tp_iter */ -+ 0, /* tp_iternext */ -+ curlobject_methods, /* tp_methods */ -+ 0, /* tp_members */ -+ 0, /* tp_getset */ -+ 0, /* tp_base */ -+ 0, /* tp_dict */ -+ 0, /* tp_descr_get */ -+ 0, /* tp_descr_set */ -+ 0, /* tp_dictoffset */ -+ 0, /* tp_init */ -+ 0, /* tp_alloc */ -+ 0, /* tp_new */ -+}; -+#else - static PyTypeObject Curl_Type = { - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -@@ -3135,7 +3501,50 @@ - * safely ignore any compiler warnings about missing initializers. - */ - }; -+#endif - -+#if PY_MAJOR_VERSION >= 3 -+static PyTypeObject CurlMulti_Type = { -+ PyVarObject_HEAD_INIT(NULL, 0) -+ "pycurl.CurlMulti", /* tp_name */ -+ sizeof(CurlMultiObject), /* tp_basicsize */ -+ 0, /* tp_itemsize */ -+ (destructor)do_multi_dealloc,/* tp_dealloc */ -+ 0, /* tp_print */ -+ 0, // (getattrfunc)do_curl_getattr, /* tp_getattr */ -+ 0, //(setattrfunc)do_curl_setattr, /* tp_setattr */ -+ 0, /* tp_reserved */ -+ 0, /* tp_repr */ -+ 0, /* tp_as_number */ -+ 0, /* tp_as_sequence */ -+ 0, /* tp_as_mapping */ -+ 0, /* tp_hash */ -+ 0, /* tp_call */ -+ 0, /* tp_str */ -+ (getattrofunc)do_multi_getattro, //0, /* tp_getattro */ -+ (setattrofunc)do_multi_setattro, /* tp_setattro */ -+ 0, /* tp_as_buffer */ -+ Py_TPFLAGS_HAVE_GC, /* tp_flags */ -+ 0, /* tp_doc */ -+ (traverseproc)do_multi_traverse, /* tp_traverse */ -+ (inquiry)do_multi_clear, /* tp_clear */ -+ 0, /* tp_richcompare */ -+ 0, /* tp_weaklistoffset */ -+ 0, /* tp_iter */ -+ 0, /* tp_iternext */ -+ curlmultiobject_methods, /* tp_methods */ -+ 0, /* tp_members */ -+ 0, /* tp_getset */ -+ 0, /* tp_base */ -+ 0, /* tp_dict */ -+ 0, /* tp_descr_get */ -+ 0, /* tp_descr_set */ -+ 0, /* tp_dictoffset */ -+ 0, /* tp_init */ -+ 0, /* tp_alloc */ -+ 0, /* tp_new */ -+}; -+#else - static PyTypeObject CurlMulti_Type = { - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ -@@ -3166,7 +3575,7 @@ - * safely ignore any compiler warnings about missing initializers. - */ - }; -- -+#endif - - /************************************************************************* - // module level -@@ -3224,7 +3633,11 @@ - } - while (*s == ' ' || *s == '\t') - s++; -+#if PY_MAJOR_VERSION >= 3 -+ return PyUnicode_FromString(s); -+#else - return PyString_FromString(s); -+#endif - } - - static PyObject * -@@ -3351,7 +3764,13 @@ - goto error; - if (value == NULL) - goto error; -+ -+#if PY_MAJOR_VERSION >= 3 -+ key = PyUnicode_FromString(name); -+#else - key = PyString_FromString(name); -+#endif -+ - if (key == NULL) - goto error; - #if 0 -@@ -3378,7 +3797,11 @@ - static void - insstr(PyObject *d, char *name, char *value) - { -+#if PY_MAJOR_VERSION >= 3 -+ PyObject *v = PyUnicode_FromString(value); -+#else - PyObject *v = PyString_FromString(value); -+#endif - insobj2(d, NULL, name, v); - } - -@@ -3411,6 +3834,20 @@ - } - - -+#if PY_MAJOR_VERSION >= 3 -+static PyModuleDef curlmodule = { -+ PyModuleDef_HEAD_INIT, -+ "pycurl", -+ module_doc, -+ -1, -+ curl_methods, NULL, NULL, NULL, NULL -+}; -+#endif -+ -+ -+#if PY_MAJOR_VERSION >= 3 -+PyMODINIT_FUNC PyInit_pycurl(void) -+#else - /* Initialization function for the module */ - #if defined(PyMODINIT_FUNC) - PyMODINIT_FUNC -@@ -3421,6 +3858,7 @@ - DL_EXPORT(void) - #endif - initpycurl(void) -+#endif - { - PyObject *m, *d; - const curl_version_info_data *vi; -@@ -3430,13 +3868,29 @@ - p_Curl_Type = &Curl_Type; - p_CurlMulti_Type = &CurlMulti_Type; - p_CurlShare_Type = &CurlShare_Type; -- Curl_Type.ob_type = &PyType_Type; -- CurlMulti_Type.ob_type = &PyType_Type; -- CurlShare_Type.ob_type = &PyType_Type; -+ Py_TYPE(&Curl_Type) = &PyType_Type; -+ Py_TYPE(&CurlMulti_Type) = &PyType_Type; -+ Py_TYPE(&CurlShare_Type) = &PyType_Type; - - /* Create the module and add the functions */ -+#if PY_MAJOR_VERSION >= 3 -+ if (PyType_Ready(&Curl_Type) < 0) -+ return NULL; -+ -+ if (PyType_Ready(&CurlMulti_Type) < 0) -+ return NULL; -+ -+ -+ m = PyModule_Create(&curlmodule); -+ if (m == NULL) -+ return NULL; -+ -+ Py_INCREF(&Curl_Type); -+#else -+ - m = Py_InitModule3("pycurl", curl_methods, module_doc); - assert(m != NULL && PyModule_Check(m)); -+#endif - - /* Add error object to the module */ - d = PyModule_GetDict(m); -@@ -3903,6 +4357,9 @@ - /* Finally initialize global interpreter lock */ - PyEval_InitThreads(); - -+#if PY_MAJOR_VERSION >= 3 -+ return m; -+#endif - } - - /* vi:ts=4:et:nowrap diff --git a/python-pycurl.changes b/python-pycurl.changes index 1ffc24f..1d20013 100644 --- a/python-pycurl.changes +++ b/python-pycurl.changes @@ -1,3 +1,127 @@ +------------------------------------------------------------------- +Tue May 20 12:13:23 UTC 2014 - toddrme2178@gmail.com + +- Update to version 7.19.3.1 + * Added --avoid-stdio setup.py option to avoid passing FILE + pointers from Python to libcurl. Applies to Python 2 only. + * Added CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE, + CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE, CURLMOPT_MAX_HOST_CONNECTIONS + CURLMOPT_MAX_PIPELINE_LENGTH, CURLMOPT_MAX_TOTAL_CONNECTIONS + multi options (patch by Jakob Truelsen). + * SSL detection logic changed to consult `curl-config --static-libs` + even if `curl-config --libs` succeeded. This should achieve + pre-7.19.3 behavior with respect to automatic SSL detection + (patch by Andjelko Horvat). +- Update to version 7.19.3 + * Added CURLOPT_NOPROXY. + * Added CURLINFO_LOCAL_PORT, CURLINFO_PRIMARY_PORT and + CURLINFO_LOCAL_IP (patch by Adam Jacob Muller). + * When running on Python 2.x, for compatibility with Python 3.x, + Unicode strings containing ASCII code points only are now accepted + in setopt() calls. + * PycURL now requires that compile time SSL backend used by libcurl + is the same as the one used at runtime. setup.py supports + --with-ssl, --with-gnutls and --with-nss options like libcurl does, + to specify which backend libcurl uses. On some systems PycURL can + automatically figure out libcurl's backend. + If the backend is not one for which PycURL provides crypto locks + (i.e., any of the other backends supported by libcurl), + no runtime SSL backend check is performed. + * Default PycURL user agent string is now built at runtime, and will + include the user agent string of libcurl loaded at runtime rather + than the one present at compile time. + * PycURL will now use WSAduplicateSocket rather than dup on Windows + to duplicate sockets obtained from OPENSOCKETFUNCTION. + Using dup may have caused crashes, OPENSOCKETFUNCTION should + now be usable on Windows. + * A new script, winbuild.py, was added to build PycURL on Windows + against Python 2.6, 2.7, 3.2 and 3.3. + * Added CURL_LOCK_DATA_SSL_SESSION (patch by Tom Pierce). + * Added E_OPERATION_TIMEDOUT (patch by Romuald Brunet). + * setup.py now handles --help argument and will print PycURL-specific + configuration options in addition to distutils help. + * Windows build configuration has been redone: + PYCURL_USE_LIBCURL_DLL #define is gone, use --use-libcurl-dll + argument to setup.py to build against a libcurl DLL. + CURL_STATICLIB is now #defined only when --use-libcurl-dll is not + given to setup.py, and PycURL is built against libcurl statically. + --libcurl-lib-name option can be used to override libcurl import + library name. + * Added CURLAUTH_DIGEST_IE as pycurl.HTTPAUTH_DIGEST_IE. + * Added CURLOPT_POSTREDIR option and CURL_REDIR_POST_301, + CURL_REDIR_POST_302, CURL_REDIR_POST_303 and CURL_REDIR_POST_ALL + constants. CURL_REDIR_POST_303 requires libcurl 7.26.0 or higher, + all others require libcurl 7.19.1 or higher. + * PycURL now supports Python 3.1 through 3.3. Python 3.0 might + work but it appears to ship with broken distutils, making virtualenv + not function on it. + * PycURL multi objects now have the multi constants defined on them. + Previously the constants were only available on pycurl module. + The new behavior matches that of curl and share objects. + * PycURL share objects can now be closed via the close() method. + * PycURL will no longer call `curl-config --static-libs` if + `curl-config --libs` succeeds and returns output. + Systems on which neither `curl-config --libs` nor + `curl-config --static-libs` do the right thing should provide + a `curl-config` wrapper that is sane. + * Added CURLFORM_BUFFER and CURLFORM_BUFFERPTR. + * pycurl.version and user agent string now include both + PycURL version and libcurl version as separate items. + * Added CURLOPT_DNS_SERVERS. + * PycURL can now be dynamically linked against libcurl on Windows + if PYCURL_USE_LIBCURL_DLL is #defined during compilation. + * Breaking change: opensocket callback now takes an additional + (address, port) tuple argument. Existing callbacks will need to + be modified to accept this new argument. + https://github.com/pycurl/pycurl/pull/18 +- Update to version 7.19.0.3 + * Re-release of 7.19.0.2 with minor changes to build Windows packages + due to botched 7.19.0.2 files on PyPi. + http://curl.haxx.se/mail/curlpython-2013-12/0021.html +- Update to version 7.19.0.2 [requires libcurl-7.19.0 or better] - 2013-10-08 + * Fixed a bug in a commit made in 2008 but not released until 7.19.0.1 + which caused CURLOPT_POSTFIELDS to not correctly increment reference + count of the object being given as its argument, despite libcurl not + copying the data provided by said object. + * Added support for libcurl pause/unpause functionality, + via curl_easy_pause call and returning READFUNC_PAUSE from + read callback function. +- Update to version 7.19.0.1 [requires libcurl-7.19.0 or better] - 2013-09-23 + * Test matrix tool added to test against all supported Python and + libcurl versions. + * Python 2.4 is now the minimum required version. + * Source code, bugs and patches are now kept on GitHub. + * Added CURLINFO_CERTINFO and CURLOPT_CERTINFO. + * Added CURLOPT_RESOLVE. + * PycURL can now be used with Python binaries without thread + support. + * gcrypt is no longer initialized when a newer version of gnutls + is used. + * Marked NSS as supported. + * Fixed relative URL request logic. + * Fixed a memory leak in util_curl_init. + * Added CURLOPT_USERNAME and CURLOPT_PASSWORD. + * Fixed handling of big timeout values. + * Added GLOBAL_ACK_EINTR. + * setopt(..., None) can be used as unsetopt(). + * CURLOPT_RANGE can now be unset. + * Write callback can return -1 to signal user abort. + * Reorganized tests into an automated test suite. + * Added CURLOPT_SEEKFUNCTION and CURLOPT_SEEKDATA. + * Cleaned up website. + * Fix pycurl.reset() (patch by ). + * Fix install routine in setup.py where + certain platforms (Solaris, Mac OSX, etc) + would search for a static copy of libcurl (dbp). + * Fixed build on OpenSolaris 0906 and other platforms on which + curl-config does not have a --static-libs option. + * No longer keep string options copies in the + Curl Python objects, since string options are + now managed by libcurl. +- Add additional dependencies +- Remove no longer necessary patch: + * pycurl-7.18.1-nostaticlibs.patch + ------------------------------------------------------------------- Fri Aug 30 18:07:30 UTC 2013 - crrodriguez@opensuse.org diff --git a/python-pycurl.spec b/python-pycurl.spec index 9fd588a..92d64a6 100644 --- a/python-pycurl.spec +++ b/python-pycurl.spec @@ -1,7 +1,7 @@ # # spec file for package python-pycurl # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,19 +17,25 @@ Name: python-pycurl -Version: 7.19.0 +Version: 7.19.3.1 Release: 0 Url: http://pycurl.sourceforge.net/ Summary: PycURL -- cURL library module License: LGPL-2.1+ and MIT Group: Development/Languages/Python -Source: http://pycurl.sourceforge.net/download/pycurl-%{version}.tar.gz -Patch0: pycurl-7.18.1-nostaticlibs.patch -Patch1: pycurl-no-runtime-curlvercheck.patch +Source: https://pypi.python.org/packages/source/p/pycurl/pycurl-%{version}.tar.gz +Patch0: pycurl-no-runtime-curlvercheck.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: libcurl-devel >= 7.19.0 BuildRequires: openssl-devel BuildRequires: python-devel +BuildRequires: python-bottle +BuildRequires: python-CherryPy +BuildRequires: python-nose +BuildRequires: python-simplejson +Requires: python-bottle +Requires: python-CherryPy +Requires: python-simplejson %if 0%{?suse_version} %py_requires %endif @@ -52,8 +58,8 @@ This package contains documentation and examples. %prep %setup -q -n pycurl-%{version} -%patch0 -%patch1 -p1 +%patch0 -p1 + %build CFLAGS="%{optflags}" python setup.py build @@ -63,11 +69,11 @@ rm -rf %{buildroot}%{_datadir}/doc # Remove wrongly installed junk %files %defattr(-,root,root,-) -%doc ChangeLog COPYING README TODO +%doc AUTHORS ChangeLog COPYING-LGPL COPYING-MIT README.rst %{python_sitearch}/* %files doc %defattr(-,root,root) -%doc examples doc/*.html +%doc examples doc/*.rst %changelog From 6f03fb134bd5cde8b4557a86af95e50e54379cf606b529c14515ae24911194b0 Mon Sep 17 00:00:00 2001 From: Todd R Date: Wed, 21 May 2014 15:41:57 +0000 Subject: [PATCH 2/3] OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pycurl?expand=0&rev=20 --- python-pycurl.changes | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python-pycurl.changes b/python-pycurl.changes index 1d20013..9f06c22 100644 --- a/python-pycurl.changes +++ b/python-pycurl.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed May 21 15:41:00 UTC 2014 - toddrme2178@gmail.com + +- Removed patch specific to python3-pycurl: pycurl-python3.patch +- Rebase patch: pycurl-no-runtime-curlvercheck.patch + ------------------------------------------------------------------- Tue May 20 12:13:23 UTC 2014 - toddrme2178@gmail.com From a2d3ea1a312f2e732977c41388edee0fcfaed76d11b1de3eb04709e4b422c50f Mon Sep 17 00:00:00 2001 From: Todd R Date: Mon, 26 May 2014 15:35:09 +0000 Subject: [PATCH 3/3] Accepting request 235419 from home:TheBlackCat:branches:devel:languages:python - Removed part of patch that breaks now necessary things: pycurl-no-runtime-curlvercheck.patch - Specify ssl type since it is not automatically detected. OBS-URL: https://build.opensuse.org/request/show/235419 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pycurl?expand=0&rev=21 --- pycurl-no-runtime-curlvercheck.patch | 18 +----------------- python-pycurl.changes | 7 +++++++ python-pycurl.spec | 6 +++--- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/pycurl-no-runtime-curlvercheck.patch b/pycurl-no-runtime-curlvercheck.patch index 63167e3..2266a27 100644 --- a/pycurl-no-runtime-curlvercheck.patch +++ b/pycurl-no-runtime-curlvercheck.patch @@ -1,22 +1,6 @@ --- a/src/pycurl.c 2014-02-06 10:27:56.000000000 +0100 +++ b/src/pycurl.c 2014-05-20 16:09:57.513592172 +0200 -@@ -4440,6 +4440,7 @@ - const char *libcurl_version, *runtime_ssl_lib; - int libcurl_version_len, pycurl_version_len; - -+#if 0 - /* Check the version, as this has caused nasty problems in - * some cases. */ - vi = curl_version_info(CURLVERSION_NOW); -@@ -4451,6 +4452,7 @@ - PyErr_Format(PyExc_ImportError, "pycurl: libcurl link-time version (%s) is older than compile-time version (%s)", vi->version, LIBCURL_VERSION); - PYCURL_MODINIT_RETURN_NULL; - } -+#endif - - /* Our compiled crypto locks should correspond to runtime ssl library. */ - if (vi->ssl_version == NULL) { -@@ -4526,7 +4528,7 @@ +@@ -4526,7 +4526,7 @@ #undef PYCURL_VERSION_PREFIX_SIZE insobj2(d, NULL, "version", PyText_FromString(g_pycurl_useragent)); diff --git a/python-pycurl.changes b/python-pycurl.changes index 9f06c22..2dbf909 100644 --- a/python-pycurl.changes +++ b/python-pycurl.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon May 26 14:17:15 UTC 2014 - toddrme2178@gmail.com + +- Removed part of patch that breaks now necessary things: + pycurl-no-runtime-curlvercheck.patch +- Specify ssl type since it is not automatically detected. + ------------------------------------------------------------------- Wed May 21 15:41:00 UTC 2014 - toddrme2178@gmail.com diff --git a/python-pycurl.spec b/python-pycurl.spec index 92d64a6..9c400e0 100644 --- a/python-pycurl.spec +++ b/python-pycurl.spec @@ -58,13 +58,13 @@ This package contains documentation and examples. %prep %setup -q -n pycurl-%{version} -%patch0 -p1 +# %patch0 -p1 %build -CFLAGS="%{optflags}" python setup.py build +CFLAGS="%{optflags}" python setup.py build --with-ssl %install -python setup.py install --prefix=%{_prefix} --root=%{buildroot} +python setup.py install --prefix=%{_prefix} --root=%{buildroot} --with-ssl rm -rf %{buildroot}%{_datadir}/doc # Remove wrongly installed junk %files