Update to alpha 4. Drop python2 subpackage (bz 1647371).

This commit is contained in:
Jerry James 2018-11-15 21:27:29 -07:00
parent 82477af1f3
commit 55f15c1f4a
5 changed files with 18 additions and 126 deletions

View File

@ -1,11 +0,0 @@
--- src/gmpy2_mpz_inplace.c.orig 2018-04-14 12:27:51.000000000 -0600
+++ src/gmpy2_mpz_inplace.c 2018-06-26 19:50:45.167530839 -0600
@@ -50,6 +50,8 @@ GMPy_MPZ_IAdd_Slot(PyObject *self, PyObj
mpz_sub_ui(result->z, MPZ(self), ((PyLongObject*)other)->ob_digit[0]);
return (PyObject*)result;
case 0:
+ mpz_set(result->z, MPZ(self));
+ return (PyObject*)result;
case 1:
mpz_add_ui(result->z, MPZ(self), ((PyLongObject*)other)->ob_digit[0]);
return (PyObject*)result;

View File

@ -1,10 +0,0 @@
--- src/gmpy2_mpz_misc.c.orig 2018-04-14 12:27:51.000000000 -0600
+++ src/gmpy2_mpz_misc.c 2018-07-12 11:07:36.053833908 -0600
@@ -795,6 +795,7 @@ GMPy_MPZ_Function_Bincoef(PyObject *self
return (PyObject*)result;
}
+ PyErr_Clear();
if (!(tempx = GMPy_MPZ_From_Integer(PyTuple_GET_ITEM(args, 0), NULL))) {
Py_DECREF((PyObject*)result);
return NULL;

View File

@ -1,14 +0,0 @@
# Fix import issues. See git commit cb0d591e8bffd7833db8c26fed81f43952732c0d.
--- gmpy2/__init__.pxd.orig 2018-05-18 11:28:00.000000000 -0600
+++ gmpy2/__init__.pxd 2018-05-18 11:33:32.444069344 -0600
@@ -1 +1 @@
-from gmpy2 cimport *
+from gmpy2.gmpy2 cimport *
--- gmpy2/__init__.py.orig 2018-05-18 11:28:00.000000000 -0600
+++ gmpy2/__init__.py 2018-05-18 11:34:01.852674784 -0600
@@ -1 +1,5 @@
from .gmpy2 import *
+# Internal variables/functions are not imported by * above.
+# These are used by some python level functions and are needed
+# at the top level.
+from .gmpy2 import _C_API, _mpmath_normalize, _mpmath_create

View File

@ -1,39 +1,22 @@
%if 0%{?fedora} || 0%{?rhel} >= 8
%global with_py3 1
%endif
%global srcname gmpy2
Name: python-%{srcname}
Version: 2.1.0
Release: 0.5.a2%{?dist}
Release: 0.6.a4%{?dist}
Summary: Python interface to GMP, MPFR, and MPC
License: LGPLv3+
URL: https://pypi.python.org/pypi/gmpy2
Source0: https://github.com/aleaxit/gmpy/archive/%{srcname}-%{version}a2.tar.gz
# Fix an import issue; git commit cb0d591
Patch0: %{srcname}-import.patch
# Fix adding by zero in place; https://github.com/aleaxit/gmpy/issues/200
Patch1: %{srcname}-addzero.patch
# Fix spurious overlow error in bincoef
Patch2: %{srcname}-clear-err.patch
Source0: https://github.com/aleaxit/gmpy/releases/download/%{srcname}-2.1a4/%{srcname}-%{version}a4.tar.gz
BuildRequires: gcc
BuildRequires: gmp-devel
BuildRequires: libmpc-devel
BuildRequires: mpfr-devel
BuildRequires: python2-Cython
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-sphinx
%if 0%{?with_py3}
BuildRequires: python3-Cython
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-sphinx
%endif
BuildRequires: python3dist(cython)
BuildRequires: python3dist(setuptools)
BuildRequires: python3dist(sphinx)
%global common_desc \
This package contains a C-coded Python extension module that supports \
@ -48,34 +31,21 @@ functionality.
%description
%{common_desc}
%package -n python2-%{srcname}
Summary: Python 2 interface to GMP, MPFR, and MPC
Provides: bundled(jquery)
%{?python_provide:%python_provide python2-%{srcname}}
%description -n python2-%{srcname}
%{common_desc}
%if 0%{?with_py3}
%package -n python3-%{srcname}
Summary: Python 3 interface to GMP, MPFR, and MPC
Provides: bundled(jquery)
%{?python_provide:%python_provide python3-%{srcname}}
# This can be removed when F29 reaches EOL
Obsoletes: python2-%{srcname} < 2.1.0-0.6.a4
Provides: python2-%{srcname} = %{version}-%{release}
%description -n python3-%{srcname}
%{common_desc}
%endif
%prep
%setup -q -c
mv gmpy-%{srcname}-%{version}a2 python2
pushd python2
%patch0
%patch1
%patch2
%setup -q -n %{srcname}-%{version}a4
# Fix file encodings. First the easy one.
iconv -f ISO8859-1 -t UTF-8 src/gmpy2.c > src/gmpy2.c.utf8
@ -86,73 +56,30 @@ mv -f src/gmpy2.c.utf8 src/gmpy2.c
sed -i.orig 's/i\xad/\xc3\xad/' src/mpz_pylong.c
touch -r src/mpz_pylong.c.orig src/mpz_pylong.c
rm src/mpz_pylong.c.orig
popd
%if 0%{?fedora} >= 24
# Update the sphinx theme name
sed -i "s/'default'/'alabaster'/" python2/docs/conf.py
%endif
%if 0%{?with_py3}
# Prepare for a python3 build
cp -a python2 python3
sed -i 's/sphinx-build/&-3/' python3/docs/Makefile
%endif
sed -i "s/'default'/'classic'/" docs/conf.py
%build
# Python 2 build
pushd python2
%py2_build
make -C docs html
popd
%if 0%{?with_py3}
# Python 3 build
pushd python3
%py3_build
make -C docs html
popd
%endif
%install
# Python 2 install
pushd python2
%py2_install
popd
%if 0%{?with_py3}
# Python 3 install
pushd python3
%py3_install
popd
%endif
%check
# Python 2 tests
pushd python2
PYTHONPATH=%{buildroot}%{python2_sitearch} %{__python2} test/runtests.py
popd
%if 0%{?with_py3}
# Python 3 tests
pushd python3
PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} test/runtests.py
popd
%endif
%files -n python2-%{srcname}
%license python2/COPYING python2/COPYING.LESSER
%doc python2/docs/_build/html/*
%{python2_sitearch}/%{srcname}*
%if 0%{?with_py3}
%files -n python3-%{srcname}
%license python3/COPYING python3/COPYING.LESSER
%doc python3/docs/_build/html/*
%license COPYING COPYING.LESSER
%doc docs/_build/html/*
%{python3_sitearch}/%{srcname}*
%endif
%changelog
* Thu Nov 15 2018 Jerry James <loganjerry@gmail.com> - 2.1.0-0.6.a4
- Update to alpha 4
- Drop python2 subpackage (bz 1647371)
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-0.5.a2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (gmpy2-2.1.0a2.tar.gz) = bad44fb4aa23838e510167acce7c0d3d1eb01e178c99127941507b5b142a6a94308870f35cd0c6571de9428e945c62a25a9a705effb78933eb9b2e4d51490f50
SHA512 (gmpy2-2.1.0a4.tar.gz) = 036430ad152a1ecaa925348ddf6e724f5f068ae44d523304cf515427dc9b05c47fff6fdc237c44921cb58920cff5552458cc9864694734dafd6492cbbe101b2f