00637a
%bcond_without python3
00637a
%bcond_with python36_module
00637a
00637a
# Only build on architectures supported by mongodb in RHEL8
00637a
%global mongodb_arches x86_64 ppc64le aarch64 s390x
00637a
00637a
# Fix private-shared-object-provides error
00637a
%{?filter_setup:
00637a
%filter_provides_in %{python2_sitearch}.*\.so$
00637a
%filter_setup
00637a
}
00637a
00637a
# Conditionalize tests
00637a
%bcond_with tests
00637a
00637a
%if 0%{?rhel} > 7
00637a
# Disable python2 build by default
00637a
%bcond_with python2
00637a
%else
00637a
%bcond_without python2
00637a
%endif
00637a
00637a
Name:           python-pymongo
b72aa5
Version:        3.7.0
b72aa5
Release:        1%{?dist}
00637a
00637a
# All code is ASL 2.0 except bson/time64*.{c,h} which is MIT
00637a
License:        ASL 2.0 and MIT
00637a
Summary:        Python driver for MongoDB
00637a
URL:            http://api.mongodb.org/python
00637a
Source0:        https://github.com/mongodb/mongo-python-driver/archive/%{version}/pymongo-%{version}.tar.gz
00637a
00637a
# Only build on architectures supported by mongodb in RHEL8
00637a
ExclusiveArch:  %{mongodb_arches}
00637a
00637a
# This patch removes the bundled ssl.match_hostname library as it was vulnerable to CVE-2013-7440
00637a
# and CVE-2013-2099, and wasn't needed anyway since Fedora >= 22 has the needed module in the Python
00637a
# standard library. It also adjusts imports so that they exclusively use the code from Python.
00637a
Patch01:        0001-Use-ssl.match_hostname-from-the-Python-stdlib.patch
00637a
00637a
%if %{with tests}
00637a
%ifnarch armv7hl ppc64 s390 s390x
00637a
# These are needed for tests, and the tests don't work on armv7hl.
00637a
# MongoDB server is not available on big endian arches (ppc64, s390(x)).
00637a
BuildRequires:  mongodb-server
00637a
BuildRequires:  net-tools
00637a
BuildRequires:  procps-ng
00637a
%endif
00637a
%endif # with tests
00637a
00637a
%if %{with python2}
00637a
BuildRequires:  python2-tools
00637a
BuildRequires:  python2-devel
00637a
BuildRequires:  python2-setuptools
00637a
%endif # with python2
00637a
00637a
%if %{with python3}
00637a
%if %{with python36_module}
00637a
BuildRequires:  python36-devel
00637a
BuildRequires:  python36-rpm-macros
00637a
%else
00637a
BuildRequires:  python3-devel
00637a
%endif
00637a
BuildRequires:  python3-setuptools
00637a
BuildRequires:  python3-sphinx
00637a
%endif
00637a
00637a
%description
00637a
The Python driver for MongoDB.
00637a
00637a
00637a
%if %{with python3}
00637a
%package doc
00637a
BuildArch: noarch
00637a
Summary:   Documentation for python-pymongo
00637a
00637a
00637a
%description doc
00637a
Documentation for python-pymongo.
00637a
%endif
00637a
00637a
%if %{with python2}
00637a
%package -n python2-bson
00637a
Summary:        Python bson library
00637a
%{?python_provide:%python_provide python2-bson}
00637a
00637a
00637a
%description -n python2-bson
00637a
BSON is a binary-encoded serialization of JSON-like documents. BSON is designed
00637a
to be lightweight, traversable, and efficient. BSON, like JSON, supports the
00637a
embedding of objects and arrays within other objects and arrays.
00637a
%endif # with python2
00637a
00637a
00637a
%if %{with python3}
00637a
%package -n python3-bson
00637a
Summary:        Python bson library
00637a
%{?python_provide:%python_provide python3-bson}
00637a
00637a
00637a
%description -n python3-bson
00637a
BSON is a binary-encoded serialization of JSON-like documents. BSON is designed
00637a
to be lightweight, traversable, and efficient. BSON, like JSON, supports the
00637a
embedding of objects and arrays within other objects and arrays.  This package
00637a
contains the python3 version of this module.
00637a
%endif
00637a
00637a
00637a
%if %{with python2}
00637a
%package -n python2-pymongo
00637a
Summary:        Python driver for MongoDB
00637a
00637a
Requires:       python2-bson%{?_isa} = %{version}-%{release}
00637a
Obsoletes:      pymongo <= 2.1.1-4
00637a
%{?python_provide:%python_provide python2-pymongo}
00637a
00637a
00637a
%description -n python2-pymongo
00637a
The Python driver for MongoDB.  This package contains the python2 version of
00637a
this module.
00637a
%endif # with python2
00637a
00637a
00637a
%if %{with python3}
00637a
%package -n python3-pymongo
00637a
Summary:        Python driver for MongoDB
00637a
Requires:       python3-bson%{?_isa} = %{version}-%{release}
00637a
%{?python_provide:%python_provide python3-pymongo}
00637a
00637a
00637a
%description -n python3-pymongo
00637a
The Python driver for MongoDB.  This package contains the python3 version of
00637a
this module.
00637a
%endif
00637a
00637a
%if %{with python2}
00637a
%package -n python2-pymongo-gridfs
00637a
Summary:        Python GridFS driver for MongoDB
00637a
Requires:       python2-pymongo%{?_isa} = %{version}-%{release}
00637a
Obsoletes:      pymongo-gridfs <= 2.1.1-4
00637a
%{?python_provide:%python_provide python2-pymongo-gridfs}
00637a
00637a
00637a
%description -n python2-pymongo-gridfs
00637a
GridFS is a storage specification for large objects in MongoDB.
00637a
%endif # with python2
00637a
00637a
00637a
%if %{with python3}
00637a
%package -n python3-pymongo-gridfs
00637a
Summary:        Python GridFS driver for MongoDB
00637a
Requires:       python3-pymongo%{?_isa} = %{version}-%{release}
00637a
%{?python_provide:%python_provide python3-pymongo-gridfs}
00637a
00637a
00637a
%description -n python3-pymongo-gridfs
00637a
GridFS is a storage specification for large objects in MongoDB.  This package
00637a
contains the python3 version of this module.
00637a
%endif
00637a
00637a
00637a
%prep
00637a
%setup -q -n mongo-python-driver-%{version}
00637a
%patch01 -p1 -b .ssl
00637a
00637a
# Remove the bundled ssl.match_hostname library as it was vulnerable to CVE-2013-7440
00637a
# and CVE-2013-2099, and isn't needed anyway since Fedora >= 22 has the needed module in the Python
00637a
# standard library.
00637a
rm pymongo/ssl_match_hostname.py
00637a
00637a
%build
00637a
%if %{with python2}
00637a
%py2_build
00637a
%endif # with python2
00637a
00637a
%if %{with python3}
00637a
%py3_build
00637a
00637a
pushd doc
00637a
SPHINXBUILD=sphinx-build-3 make %{?_smp_mflags} html
00637a
popd
00637a
%endif
00637a
00637a
00637a
%install
00637a
%if %{with python2}
00637a
%py2_install
00637a
# Fix permissions
00637a
chmod 755 %{buildroot}%{python2_sitearch}/bson/*.so
00637a
chmod 755 %{buildroot}%{python2_sitearch}/pymongo/*.so
00637a
%endif # with python2
00637a
00637a
%if %{with python3}
00637a
%py3_install
00637a
# Fix permissions
00637a
chmod 755 %{buildroot}%{python3_sitearch}/bson/*.so
00637a
chmod 755 %{buildroot}%{python3_sitearch}/pymongo/*.so
00637a
%endif
00637a
00637a
00637a
%if %{with tests}
00637a
%check
00637a
# For some reason, the tests never think they can connect to mongod on armv7hl even though netstat
00637a
# says it's listening. mongod is not available on big endian arches (ppc64, s390(x)).
00637a
%ifnarch armv7hl ppc64 s390 s390x
00637a
00637a
if [ "$(netstat -ln | grep :27017)" != "" ]
00637a
then
00637a
    pkill mongod
00637a
fi
00637a
00637a
mkdir ./mongod
00637a
mongod --fork --dbpath ./mongod --logpath ./mongod/mongod.log
00637a
# Give MongoDB some time to settle
00637a
while [ "$(netstat -ln | grep :27017)" == "" ]
00637a
do
00637a
    sleep 1
00637a
done
00637a
00637a
%if %{with python2}
00637a
%{__python2} setup.py test || (pkill mongod && exit 1)
00637a
%endif # with python2
00637a
00637a
%if %{with python3}
00637a
%{__python3} setup.py test || (pkill mongod && exit 1)
00637a
%endif
00637a
00637a
pkill mongod
00637a
%endif
00637a
%endif # with tests
00637a
00637a
00637a
%if %{with python3}
00637a
%files doc
00637a
%license LICENSE
00637a
%doc doc/_build/html/*
00637a
%endif
00637a
00637a
%if %{with python2}
00637a
%files -n python2-bson
00637a
%license LICENSE
00637a
%doc README.rst
00637a
%{python2_sitearch}/bson
00637a
%endif # with python2
00637a
00637a
00637a
%if %{with python3}
00637a
%files -n python3-bson
00637a
%license LICENSE
00637a
%doc README.rst
00637a
%{python3_sitearch}/bson
00637a
%endif
00637a
00637a
%if %{with python2}
00637a
%files -n python2-pymongo
00637a
%license LICENSE
00637a
%doc README.rst
00637a
%{python2_sitearch}/pymongo
00637a
%{python2_sitearch}/pymongo-%{version}-*.egg-info
00637a
%endif # with python2
00637a
00637a
00637a
%if %{with python3}
00637a
%files -n python3-pymongo
00637a
%license LICENSE
00637a
%doc README.rst
00637a
%{python3_sitearch}/pymongo
00637a
%{python3_sitearch}/pymongo-%{version}-*.egg-info
00637a
%endif
00637a
00637a
%if %{with python2}
00637a
%files -n python2-pymongo-gridfs
00637a
%license LICENSE
00637a
%doc README.rst
00637a
%{python2_sitearch}/gridfs
00637a
%endif # with python2
00637a
00637a
00637a
%if %{with python3}
00637a
%files -n python3-pymongo-gridfs
00637a
%license LICENSE
00637a
%doc README.rst
00637a
%{python3_sitearch}/gridfs
00637a
%endif
00637a
00637a
00637a
%changelog
b72aa5
* Fri Oct 09 2020 Lukas Javorsky <ljavorsk@redhat.com> - 3.7.0-1
b72aa5
- Rebase to 3.7.0
b72aa5
- Includes new SCRAM-SHA-256 authentication
b72aa5
  Resolves: rhbz#1879852
b72aa5
00637a
* Fri Jun 07 2019 Tomas Orsava <torsava@redhat.com> - 3.6.1-11
00637a
- Fix unversioned python macro that's causing a FTBFS
00637a
- Related: rhbz#1678920
00637a
00637a
* Thu Apr 25 2019 Tomas Orsava <torsava@redhat.com> - 3.6.1-10
00637a
- Bumping due to problems with modular RPM upgrade path
00637a
- Resolves: rhbz#1695587
00637a
00637a
* Thu Mar 28 2019 Charalampos Stratakis <cstratak@redhat.com> - 3.6.1-9
00637a
- Disable the test suite as mongodb is not available anymore
00637a
00637a
* Tue Oct 09 2018 Lumír Balhar <lbalhar@redhat.com> - 3.6.1-8
00637a
- Remove unversioned provides
00637a
- Resolves: rhbz#1628242
00637a
00637a
* Tue Jul 31 2018 Lumír Balhar <lbalhar@redhat.com> - 3.6.1-7
00637a
- Make possible to disable python3 subpackage
00637a
00637a
* Wed Jul 18 2018 Tomas Orsava <torsava@redhat.com> - 3.6.1-6
00637a
- BuildRequire the python36-devel package when building for the python36 module
00637a
- BuildRequire also python36-rpm-macros as part of the python36 module build
00637a
00637a
* Tue Jun 26 2018 Tomas Orsava <torsava@redhat.com> - 3.6.1-5
00637a
- Fix checking of running mongod - test only open ports (not I-Node number)
00637a
00637a
* Mon Jun 25 2018 Tomas Orsava <torsava@redhat.com> - 3.6.1-4
00637a
- Only build on architectures supported by mongodb in RHEL8
00637a
- Re-enable tests
00637a
00637a
* Tue Jun 19 2018 Charalampos Stratakis <cstratak@redhat.com> - 3.6.1-3
00637a
- Conditionalize the python2 subpackage
00637a
- Conditionalize tests and disable them for now
00637a
00637a
* Thu Jun 14 2018 Tomas Orsava <torsava@redhat.com> - 3.6.1-2
00637a
- Switch to using Python 3 version of sphinx
00637a
00637a
* Sat Mar 10 2018 Randy Barlow <bowlofeggs@fedoraproject.org> - 3.6.1-1
00637a
- Update to 3.6.1 (#1550757).
00637a
- http://api.mongodb.com/python/3.6.1/changelog.html
00637a
00637a
* Mon Feb 19 2018 Marek Skalický <mskalick@redhat.com> - 3.6.0-1
00637a
- Rebase to latest release
00637a
00637a
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.5.1-2
00637a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
00637a
00637a
* Fri Sep 22 2017 Marek Skalický <mskalick@redhat.com> - 3.5.1-1
00637a
- Update to latest version
00637a
00637a
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.4.0-7
00637a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
00637a
00637a
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.4.0-6
00637a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
00637a
00637a
* Fri Jul 07 2017 Igor Gnatenko <ignatenko@redhat.com> - 3.4.0-5
00637a
- Rebuild due to bug in RPM (RHBZ #1468476)
00637a
00637a
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.4.0-4
00637a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
00637a
00637a
* Fri Jan 06 2017 Randy Barlow <bowlofeggs@fedoraproject.org> - 3.4.0-3
00637a
- Run the test suite in the check section (#1409251).
00637a
00637a
* Tue Dec 20 2016 Miro Hrončok <mhroncok@redhat.com> - 3.4.0-2
00637a
- Rebuild for Python 3.6
00637a
00637a
* Sun Dec 18 2016 Randy Barlow <bowlofeggs@fedoraproject.org> - 3.4.0-1
00637a
- Update to 3.4.0 (#1400227).
00637a
- Use new install macros.
00637a
- Drop unneeded BuildRequires on python-nose.
00637a
- pymongo now requires bson by arch as it should.
00637a
00637a
* Fri Dec 09 2016 Charalampos Stratakis <cstratak@redhat.com> - 3.3.0-6
00637a
- Rebuild for Python 3.6
00637a
00637a
* Tue Nov 29 2016 Dan Horák <dan[at]danny.cz> - 3.3.0-5
00637a
- Update test BRs
00637a
00637a
* Fri Nov 25 2016 Randy Barlow <bowlofeggs@fedoraproject.org> - 3.3.0-4
00637a
- Run the tests with setup.py test instead of with nosetests.
00637a
00637a
* Fri Nov 25 2016 Randy Barlow <bowlofeggs@fedoraproject.org> - 3.3.0-3
00637a
- Run the tests against a live mongod.
00637a
00637a
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.3.0-2
00637a
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
00637a
00637a
* Fri Jul 15 2016 Randy Barlow <bowlofeggs@fedoraproject.org> - 3.3.0-1
00637a
- Update to 3.3.0 (#1356334).
00637a
- Remove the exclude arch on big endian systems, since 3.3.0 now supports them.
00637a
- Use the newer Python build macros.
00637a
- Add a skip test on another test that requires a running mongod.
00637a
- Convert the -doc subpackage into a noarch, as it should be.
00637a
- python2-pymongo-gridfs now requires python2-pymongo(isa) instead of python-pymongo(isa).
00637a
- Build the docs in parallel.
00637a
00637a
* Tue Mar 15 2016 Randy Barlow <rbarlow@redhat.com> - 3.2.2-1
00637a
- Update to 3.2.2 (#1318073).
00637a
00637a
* Wed Feb 03 2016 Randy Barlow <rbarlow@redhat.com> - 3.2.1-1
00637a
- Remove use of needless defattr macros (#1303426).
00637a
- Update to 3.2.1 (#1304137).
00637a
- Remove lots of if statements as this spec file will only be used on Rawhide.
00637a
- Remove dependency on python-backports-ssl_match_hostname as it is not needed in Fedora.
00637a
- Rework the patch for CVE-2013-7440 and CVE-2013-2099 so that it exclusively uses code from Python.
00637a
00637a
* Tue Jan 19 2016 Randy Barlow <rbarlow@redhat.com> - 3.2-1
00637a
- Update to 3.2.
00637a
- Rename the python- subpackages with a python2- prefix.
00637a
- Add a -doc subpackage with built html docs.
00637a
- Skip a few new tests that use MongoDB.
00637a
- Reorganize the spec file a bit.
00637a
- Use the license macro.
00637a
- Pull source from GitHub.
00637a
00637a
* Mon Jan 18 2016 Randy Barlow <rbarlow@redhat.com> - 3.0.3-3
00637a
- Do not use 2to3 for Python 3 (#1294130).
00637a
00637a
* Wed Nov 04 2015 Matej Stuchlik <mstuchli@redhat.com> - 3.0.3-2
00637a
- Rebuilt for Python 3.5
00637a
00637a
* Thu Oct 01 2015 Haïkel Guémar <hguemar@fedoraproject.org> - 3.0.3-1
00637a
- Upstream 3.0.3
00637a
- Fix CVE-2013-7440 (RHBZ#1231231 #1231232)
00637a
00637a
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.2-7
00637a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
00637a
00637a
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.2-6
00637a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
00637a
00637a
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.2-5
00637a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
00637a
00637a
* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 2.5.2-4
00637a
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
00637a
00637a
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.2-3
00637a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
00637a
00637a
* Thu Jun 13 2013 Andrew McNabb <amcnabb@mcnabbs.org> - 2.5.2-2
00637a
- Bump the obsoletes version for pymongo-gridfs
00637a
00637a
* Wed Jun 12 2013 Andrew McNabb <amcnabb@mcnabbs.org> - 2.5.2-1
00637a
- Update to pymongo 2.5.2
00637a
00637a
* Tue Jun 11 2013 Andrew McNabb <amcnabb@mcnabbs.org> - 2.5-5
00637a
- Bump the obsoletes version
00637a
00637a
* Wed Apr 24 2013 Andrew McNabb <amcnabb@mcnabbs.org> - 2.5-4
00637a
- Fix the test running procedure
00637a
00637a
* Wed Apr 24 2013 Andrew McNabb <amcnabb@mcnabbs.org> - 2.5-3
00637a
- Exclude tests in pymongo 2.5 that depend on MongoDB
00637a
00637a
* Mon Apr 22 2013 Andrew McNabb <amcnabb@mcnabbs.org> - 2.5-1
00637a
- Update to PyMongo 2.5 (bug #954152)
00637a
00637a
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.3-7
00637a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
00637a
00637a
* Sat Jan  5 2013 Andrew McNabb <amcnabb@mcnabbs.org> - 2.3-6
00637a
- Fix dependency of python3-pymongo-gridfs (bug #892214)
00637a
00637a
* Tue Nov 27 2012 Andrew McNabb <amcnabb@mcnabbs.org> - 2.3-5
00637a
- Fix the name of the python-pymongo-gridfs subpackage
00637a
00637a
* Tue Nov 27 2012 Andrew McNabb <amcnabb@mcnabbs.org> - 2.3-4
00637a
- Fix obsoletes for python-pymongo-gridfs subpackage
00637a
00637a
* Tue Nov 27 2012 Andrew McNabb <amcnabb@mcnabbs.org> - 2.3-3
00637a
- Fix requires to include the arch, and add docs to all subpackages
00637a
00637a
* Tue Nov 27 2012 Andrew McNabb <amcnabb@mcnabbs.org> - 2.3-2
00637a
- Remove preexisting egg-info
00637a
00637a
* Mon Nov 26 2012 Andrew McNabb <amcnabb@mcnabbs.org> - 2.3-1
00637a
- Rename, update to 2.3, and add support for Python 3
00637a
00637a
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.1-2
00637a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
00637a
00637a
* Tue Apr 10 2012 Silas Sewell <silas@sewell.org> - 2.1.1-1
00637a
- Update to 2.1.1
00637a
00637a
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.11-2
00637a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
00637a
00637a
* Sun Jul 24 2011 Silas Sewell <silas@sewell.org> - 1.11-1
00637a
- Update to 1.11
00637a
00637a
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9-6
00637a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
00637a
00637a
* Thu Nov 18 2010 Dan Horák <dan[at]danny.cz> - 1.9-5
00637a
- add ExcludeArch to match mongodb package
00637a
00637a
* Tue Oct 26 2010 Silas Sewell <silas@sewell.ch> - 1.9-4
00637a
- Add comment about multi-license
00637a
00637a
* Thu Oct 21 2010 Silas Sewell <silas@sewell.ch> - 1.9-3
00637a
- Fixed tests so they actually run
00637a
- Change python-devel to python2-devel
00637a
00637a
* Wed Oct 20 2010 Silas Sewell <silas@sewell.ch> - 1.9-2
00637a
- Add check section
00637a
- Use correct .so filter
00637a
- Added python3 stuff (although disabled)
00637a
00637a
* Tue Sep 28 2010 Silas Sewell <silas@sewell.ch> - 1.9-1
00637a
- Update to 1.9
00637a
00637a
* Tue Sep 28 2010 Silas Sewell <silas@sewell.ch> - 1.8.1-1
00637a
- Update to 1.8.1
00637a
00637a
* Sat Dec 05 2009 Silas Sewell <silas@sewell.ch> - 1.1.2-1
00637a
- Initial build