commit 428e8092528feebcc713cd67b0a57c0cfb929cd2 Author: dogsheng <960055655@qq.com> Date: Tue Nov 19 11:55:03 2019 +0800 Package init diff --git a/0001-Use-ssl.match_hostname-from-the-Python-stdlib.patch b/0001-Use-ssl.match_hostname-from-the-Python-stdlib.patch new file mode 100644 index 0000000..9de0fdf --- /dev/null +++ b/0001-Use-ssl.match_hostname-from-the-Python-stdlib.patch @@ -0,0 +1,14 @@ +diff --git a/pymongo/pool.py b/pymongo/pool.py +index 859d0e0..f55fd8e 100644 +--- a/pymongo/pool.py ++++ b/pymongo/pool.py +@@ -49,8 +49,7 @@ from pymongo.network import (command, + SocketChecker) + from pymongo.read_preferences import ReadPreference + from pymongo.server_type import SERVER_TYPE +-# Always use our backport so we always have support for IP address matching +-from pymongo.ssl_match_hostname import match_hostname, CertificateError ++from ssl import match_hostname, CertificateError + + # For SNI support. According to RFC6066, section 3, IPv4 and IPv6 literals are + # not permitted for SNI hostname. diff --git a/mongo-python-driver-3.9.0.tar.gz b/mongo-python-driver-3.9.0.tar.gz new file mode 100644 index 0000000..bf5f248 Binary files /dev/null and b/mongo-python-driver-3.9.0.tar.gz differ diff --git a/python-pymongo.spec b/python-pymongo.spec new file mode 100644 index 0000000..825e4d8 --- /dev/null +++ b/python-pymongo.spec @@ -0,0 +1,160 @@ +Name: python-pymongo +Version: 3.9.0 +Release: 1 +License: Apache License 2.0 +Summary: PyMongo - the Python driver for MongoDB +URL: https://github.com/mongodb/mongo-python-driver +Source0: %{URL}/archive/mongo-python-driver-%{version}.tar.gz +Patch01: 0001-Use-ssl.match_hostname-from-the-Python-stdlib.patch + +BuildRequires: python2-devel python3-devel +BuildRequires: python2-setuptools python3-setuptools +BuildRequires: python2-sphinx + +%global _description \ +The PyMongo distribution contains tools for interacting with \ +MongoDB database from Python.\ +PyMongo supports MongoDB 2.6, 3.0, 3.2, 3.4, 3.6, 4.0 and 4.2. + +%description %{_description} + +%package -n python2-bson +Summary: Python bson library +%{?python_provide:%python_provide python2-bson} + +%description -n python2-bson %{_description} +This package is an implementation of the BSON format for Python 2 version. + + +%package -n python3-bson +Summary: Python bson library +%{?python_provide:%python_provide python3-bson} + +%description -n python3-bson %{_description} +This package is an implementation of the BSON format for Python 3 version. + + +%package -n python2-pymongo +Summary: Python driver for MongoDB +Requires: python2-bson%{?_isa} = %{version}-%{release} +Provides: pymongo = %{version}-%{release} +%{?python_provide:%python_provide python2-pymongo} + +%description -n python2-pymongo %{_description} +This package is a native Python 2 version driver for MongoDB. + + +%package -n python3-pymongo +Summary: Python driver for MongoDB +Requires: python3-bson%{?_isa} = %{version}-%{release} +%{?python_provide:%python_provide python3-pymongo} + +%description -n python3-pymongo %{_description} +This package is a native Python 3 version driver for MongoDB. + + +%package -n python2-pymongo-gridfs +Summary: Python GridFS driver for MongoDB +Requires: python2-pymongo%{?_isa} = %{version}-%{release} +Provides: pymongo-gridfs = %{version}-%{release} +%{?python_provide:%python_provide python2-pymongo-gridfs} + +%description -n python2-pymongo-gridfs %{_description} +This package is a gridfs implementation on top of pymongo. +This package for Python 2 version. + + +%package -n python3-pymongo-gridfs +Summary: Python GridFS driver for MongoDB +Requires: python3-pymongo%{?_isa} = %{version}-%{release} +%{?python_provide:%python_provide python3-pymongo-gridfs} + +%description -n python3-pymongo-gridfs %{_description} +This package is a gridfs implementation on top of pymongo. +This package for Python 3 version. + +%package help +BuildArch: noarch +Summary: Development documents for python-pymongo + +%description help +%{summary}. + + +%prep +%autosetup -n mongo-python-driver-%{version} -p1 +rm pymongo/ssl_match_hostname.py + +rm -rf %{py3dir} +cp -a . %{py3dir} + + +%build +%py2_build + +pushd %{py3dir} +%py3_build +popd + +pushd doc +make %{?_smp_mflags} html +popd + +%install +%py2_install + +pushd %{py3dir} +%py3_install +popd + +install -d -m755 %{buildroot}/%{_pkgdocdir} +cp -arf doc/_build/html/* %{buildroot}/%{_pkgdocdir} + +%check +python2 setup.py test + +pushd %{py3dir} +python3 setup.py test +popd + + +%files -n python2-bson +%license LICENSE +%doc README.rst +%{python2_sitearch}/bson + + +%files -n python3-bson +%license LICENSE +%doc README.rst +%{python3_sitearch}/bson + + +%files -n python2-pymongo +%license LICENSE +%doc README.rst +%{python2_sitearch}/pymongo +%{python2_sitearch}/pymongo-%{version}-*.egg-info + + +%files -n python3-pymongo +%license LICENSE +%doc README.rst +%{python3_sitearch}/pymongo +%{python3_sitearch}/pymongo-%{version}-*.egg-info + + +%files -n python2-pymongo-gridfs +%{python2_sitearch}/gridfs + + +%files -n python3-pymongo-gridfs +%{python3_sitearch}/gridfs + + +%files help +%{_pkgdocdir} + +%changelog +* Sat Nov 2 2019 shanshishi - 3.9.0-1 +- Init package