Browse Source

python-pycurl-7.43.0.2-1

Tomohiro "Tomo-p" KATO 5 years ago
parent
commit
ece1f38de3
1 changed files with 65 additions and 15 deletions
  1. 65 15
      p/python-pycurl/python-pycurl-vl.spec

+ 65 - 15
p/python-pycurl/python-pycurl-vl.spec

@@ -1,8 +1,8 @@
-%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
+%define modname pycurl
 
-Name:           python-pycurl
-Version:        7.19.0
-Release:        5%{?_dist_release}
+Name:           python-%{modname}
+Version:        7.43.0.2
+Release:        1%{?_dist_release}
 Summary:        A Python interface to libcurl
 Summary(ja):    libcurl の Python インタフェース
 
@@ -10,11 +10,17 @@ Group:          Development/Languages
 License:        LGPLv2+
 URL:            http://pycurl.sourceforge.net/
 Source0:        http://pycurl.sourceforge.net/download/pycurl-%{version}.tar.gz
-Patch0:		python-pycurl-no-static-libs.patch
+# fix programming mistakes detected by static analyzers
+# upstream pull request: https://github.com/pycurl/pycurl/pull/550
+Patch1:         0001-python-pycurl-7.43.0.2-static-analysis.patch
+
+# drop link-time vs. run-time TLS backend check (#1446850)
+Patch2:         0002-python-pycurl-7.43.0-tls-backend.patch
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  python-devel
+BuildRequires:  python-rpm-macros
 BuildRequires:  curl-devel >= 7.19.0
 BuildRequires:  openssl-devel
 BuildRequires:  openldap-devel
@@ -29,7 +35,7 @@ BuildRequires:  openldap-devel
 %define libcurl_ver %(sed %{libcurl_sed} %{curlver_h} 2>/dev/null || echo 0)
 Requires:	curl >= %{libcurl_ver}
 
-Provides:       pycurl = %{version}-%{release}
+Provides:       %{modname} = %{version}-%{release}
 
 Vendor: Project Vine
 Distribution: Vine Linux
@@ -40,32 +46,76 @@ objects identified by a URL from a Python program, similar to the
 urllib Python module. PycURL is mature, very fast, and supports a lot
 of features.
 
+
+%package -n python3-%{modname}
+Summary:        A Python3 interface to libcurl
+Summary(ja):    libcurl の Python3 インタフェース
+BuildRequires:  python3-devel
+BuildRequires:  python3-rpm-macros
+
+%description -n python3-%{modname}
+PycURL is a Python interface to libcurl. PycURL can be used to fetch
+objects identified by a URL from a Python program, similar to the
+urllib Python module. PycURL is mature, very fast, and supports a lot
+of features.
+
+
 %prep
-%setup0 -q -n pycurl-%{version}
-%patch0 -p0
-chmod a-x examples/*
+%autosetup -n %{modname}-%{version} -p1
+
+# remove binaries packaged by upstream
+rm -f tests/fake-curl/libcurl/*.so
+
+# remove a test-case that relies on sftp://web.sourceforge.net being available
+rm -f tests/ssh_key_cb_test.py
+
+# remove a test-case that fails in Koji
+rm -f tests/seek_cb_test.py
+
+# remove tests depending on the 'flaky' nose plug-in
+grep '^import flaky' -r tests | cut -d: -f1 | xargs rm -fv
+
+# drop options that are not supported by nose
+sed -e 's/ --show-skipped//' \
+    -e 's/ --with-flaky//' \
+    -i tests/run.sh
 
 %build
-CFLAGS="$RPM_OPT_FLAGS -DHAVE_CURL_OPENSSL" %{__python} setup.py build
+%py_build -- --with-openssl
+%py3_build -- --with-openssl
 
 %check
-export PYTHONPATH=$PWD/build/lib*
-%{__python} tests/test_internals.py -q
+#export PYTHONPATH=$PWD/build/lib*
+#%{__python} tests/test_internals.py -q
 
 %install
 rm -rf %{buildroot}
-%{__python} setup.py install -O1 --skip-build --root %{buildroot}
+export PYCURL_SSL_LIBRARY=openssl
+%py_install
+%py3_install
 rm -rf %{buildroot}%{_datadir}/doc/pycurl
- 
+
+
 %clean
 rm -rf %{buildroot}
 
 %files
 %defattr(-,root,root,-)
-%doc COPYING ChangeLog README TODO examples doc tests
+%license COPYING-LGPL COPYING-MIT
+%doc ChangeLog README.rst examples doc tests
 %{python_sitearch}/*
 
+%files -n python3-%{modname}
+%defattr(-,root,root,-)
+%license COPYING-LGPL COPYING-MIT
+%doc ChangeLog README.rst examples doc tests
+%{python3_sitearch}/*
+
 %changelog
+* Wed Apr 03 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 7.43.0.2-1
+- new upstream release.
+- added python3 support.
+
 * Sun Jan 12 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> 7.19.0-5
 - rebuild with VineSeed environment