Compare commits

..

3 Commits

Author SHA1 Message Date
David Abdurachmanov ca4beea3f2
Disable gdbm for gdbm rebuild
Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
2018-07-17 20:58:44 +02:00
David Abdurachmanov 369d7c18a0
Merge commit '08290bc9c39a293634a5fc649ca27b6468f9c6d3' into master-riscv64
Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
2018-07-16 14:26:07 +02:00
David Abdurachmanov 71d7c26871 Disable gdb_hooks for riscv64
We do not build debug* packages due to not available GDB in upstream.
With gdb_hooks we would have installed, but unpackaged files.

Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
2018-05-07 14:37:17 +02:00
9 changed files with 344 additions and 252 deletions

View File

@ -20,10 +20,10 @@ index b9f1c6c..7b23714 100644
'scripts': '$base/bin',
'data' : '$base',
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
index 031f809..ec5d584 100644
index 068d1ba..3e7f077 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -120,8 +120,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
@@ -119,8 +119,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
prefix = plat_specific and EXEC_PREFIX or PREFIX
if os.name == "posix":
@ -59,10 +59,10 @@ index c360802..868b7cb 100644
return sitepackages
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
index b4384ee..349f688 100644
index d9a9324..e411e5c 100644
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -254,17 +254,20 @@ class HelperFunctionsTests(unittest.TestCase):
@@ -235,17 +235,20 @@ class HelperFunctionsTests(unittest.TestCase):
self.assertEqual(dirs[0], wanted)
elif os.sep == '/':
# OS X, Linux, FreeBSD, etc
@ -86,12 +86,12 @@ index b4384ee..349f688 100644
+ wanted = os.path.join('xoxo', 'lib64', 'site-packages')
self.assertEqual(dirs[1], wanted)
def test_no_home_directory(self):
class PthFile(object):
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 4f59dd3..877698c 100644
index adae76b..ecb27f3 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -110,7 +110,7 @@ LIBDIR= @libdir@
@@ -111,7 +111,7 @@ LIBDIR= @libdir@
MANDIR= @mandir@
INCLUDEDIR= @includedir@
CONFINCLUDEDIR= $(exec_prefix)/include
@ -101,10 +101,10 @@ index 4f59dd3..877698c 100644
# Detailed destination directories
BINLIBDEST= $(LIBDIR)/python$(VERSION)
diff --git a/Modules/Setup.dist b/Modules/Setup.dist
index 2cf35a9..c4c88cb 100644
index fbfa1c1..138fb33 100644
--- a/Modules/Setup.dist
+++ b/Modules/Setup.dist
@@ -231,7 +231,7 @@ crypt cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems
@@ -231,7 +231,7 @@
# Some more UNIX dependent modules -- off by default, since these
# are not supported by all UNIX systems:
@ -130,7 +130,7 @@ index 2cf35a9..c4c88cb 100644
+zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib64 -lz
# Interface to the Expat XML parser
# More information on Expat can be found at www.libexpat.org.
#
diff --git a/Modules/getpath.c b/Modules/getpath.c
index fd33a01..c5c86fd 100644
--- a/Modules/getpath.c
@ -154,7 +154,7 @@ index fd33a01..c5c86fd 100644
/* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
diff --git a/setup.py b/setup.py
index 0288a6b..7905f6f 100644
index 99ac359..859b6c4 100644
--- a/setup.py
+++ b/setup.py
@@ -456,7 +456,7 @@ class PyBuildExt(build_ext):

View File

@ -0,0 +1,11 @@
--- Python-2.7.5-orig/Tools/gdb/libpython.py 2013-05-12 03:32:54.000000000 +0000
+++ Python-2.7.5-orig/Tools/gdb/libpython.py 2013-09-15 09:56:25.494000000 +0000
@@ -887,6 +887,8 @@
newline character'''
if self.is_optimized_out():
return '(frame information optimized out)'
+ if self.filename() == '<string>':
+ return '(in an eval block)'
filename = self.filename()
try:
f = open(filename, 'r')

View File

@ -1,70 +0,0 @@
diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py
index 5021ebf..1903cc0 100644
--- a/Lib/ensurepip/__init__.py
+++ b/Lib/ensurepip/__init__.py
@@ -1,9 +1,10 @@
#!/usr/bin/env python2
from __future__ import print_function
+import distutils.version
+import glob
import os
import os.path
-import pkgutil
import shutil
import sys
import tempfile
@@ -12,9 +13,19 @@ import tempfile
__all__ = ["version", "bootstrap"]
-_SETUPTOOLS_VERSION = "40.6.2"
+_WHEEL_DIR = "/usr/share/python-wheels/"
-_PIP_VERSION = "18.1"
+def _get_most_recent_wheel_version(pkg):
+ prefix = os.path.join(_WHEEL_DIR, "{}-".format(pkg))
+ suffix = "-py2.py3-none-any.whl"
+ pattern = "{}*{}".format(prefix, suffix)
+ versions = (p[len(prefix):-len(suffix)] for p in glob.glob(pattern))
+ return str(max(versions, key=distutils.version.LooseVersion))
+
+
+_SETUPTOOLS_VERSION = _get_most_recent_wheel_version("setuptools")
+
+_PIP_VERSION = _get_most_recent_wheel_version("pip")
_PROJECTS = [
("setuptools", _SETUPTOOLS_VERSION),
@@ -28,8 +39,13 @@ def _run_pip(args, additional_paths=None):
sys.path = additional_paths + sys.path
# Install the bundled software
- import pip._internal
- return pip._internal.main(args)
+ try:
+ # pip 10
+ from pip._internal import main
+ except ImportError:
+ # pip 9
+ from pip import main
+ return main(args)
def version():
@@ -100,12 +116,9 @@ def _bootstrap(root=None, upgrade=False, user=False,
additional_paths = []
for project, version in _PROJECTS:
wheel_name = "{}-{}-py2.py3-none-any.whl".format(project, version)
- whl = pkgutil.get_data(
- "ensurepip",
- "_bundled/{}".format(wheel_name),
- )
- with open(os.path.join(tmpdir, wheel_name), "wb") as fp:
- fp.write(whl)
+ with open(os.path.join(_WHEEL_DIR, wheel_name), "rb") as sfp:
+ with open(os.path.join(tmpdir, wheel_name), "wb") as fp:
+ fp.write(sfp.read())
additional_paths.append(os.path.join(tmpdir, wheel_name))

View File

@ -1,14 +0,0 @@
diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py
index 9def56e..c0df208 100755
--- a/Tools/gdb/libpython.py
+++ b/Tools/gdb/libpython.py
@@ -939,6 +939,9 @@ class PyFrameObjectPtr(PyObjectPtr):
if self.is_optimized_out():
return '(frame information optimized out)'
+ if self.filename() == '<string>':
+ return '(in an eval block)'
+
lineno = self.current_line_num()
if lineno is None:
return '(failed to get frame line number)'

View File

@ -0,0 +1,249 @@
diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py
index 89ed1ef..e2a4c25 100644
--- a/Lib/ensurepip/__init__.py
+++ b/Lib/ensurepip/__init__.py
@@ -7,6 +7,7 @@ import pkgutil
import shutil
import sys
import tempfile
+from ensurepip import rewheel
__all__ = ["version", "bootstrap"]
@@ -29,6 +30,8 @@ def _run_pip(args, additional_paths=None):
# Install the bundled software
import pip
+ if args[0] in ["install", "list", "wheel"]:
+ args.append('--pre')
return pip.main(args)
@@ -93,21 +96,40 @@ def _bootstrap(root=None, upgrade=False, user=False,
# omit pip and easy_install
os.environ["ENSUREPIP_OPTIONS"] = "install"
+ whls = []
+ rewheel_dir = None
+ # try to see if we have system-wide versions of _PROJECTS
+ dep_records = rewheel.find_system_records([p[0] for p in _PROJECTS])
+ # TODO: check if system-wide versions are the newest ones
+ # if --upgrade is used?
+ if all(dep_records):
+ # if we have all _PROJECTS installed system-wide, we'll recreate
+ # wheels from them and install those
+ rewheel_dir = tempfile.mkdtemp()
+ for dr in dep_records:
+ new_whl = rewheel.rewheel_from_record(dr, rewheel_dir)
+ whls.append(os.path.join(rewheel_dir, new_whl))
+ else:
+ # if we don't have all the _PROJECTS installed system-wide,
+ # let's just fall back to bundled wheels
+ for project, version in _PROJECTS:
+ whl = os.path.join(
+ os.path.dirname(__file__),
+ "_bundled",
+ "{}-{}-py2.py3-none-any.whl".format(project, version)
+ )
+ whls.append(whl)
+
tmpdir = tempfile.mkdtemp()
try:
# Put our bundled wheels into a temporary directory and construct the
# additional paths that need added to sys.path
additional_paths = []
- for project, version in _PROJECTS:
- wheel_name = "{}-{}-py2.py3-none-any.whl".format(project, version)
- whl = pkgutil.get_data(
- "ensurepip",
- "_bundled/{}".format(wheel_name),
- )
- with open(os.path.join(tmpdir, wheel_name), "wb") as fp:
- fp.write(whl)
-
- additional_paths.append(os.path.join(tmpdir, wheel_name))
+ for whl in whls:
+ shutil.copy(whl, tmpdir)
+ additional_paths.append(os.path.join(tmpdir, os.path.basename(whl)))
+ if rewheel_dir:
+ shutil.rmtree(rewheel_dir)
# Construct the arguments to be passed to the pip command
args = ["install", "--no-index", "--find-links", tmpdir]
diff --git a/Lib/ensurepip/rewheel/__init__.py b/Lib/ensurepip/rewheel/__init__.py
new file mode 100644
index 0000000..75c2094
--- /dev/null
+++ b/Lib/ensurepip/rewheel/__init__.py
@@ -0,0 +1,158 @@
+import argparse
+import codecs
+import csv
+import email.parser
+import os
+import io
+import re
+import site
+import subprocess
+import sys
+import zipfile
+
+def run():
+ parser = argparse.ArgumentParser(description='Recreate wheel of package with given RECORD.')
+ parser.add_argument('record_path',
+ help='Path to RECORD file')
+ parser.add_argument('-o', '--output-dir',
+ help='Dir where to place the wheel, defaults to current working dir.',
+ dest='outdir',
+ default=os.path.curdir)
+
+ ns = parser.parse_args()
+ retcode = 0
+ try:
+ print(rewheel_from_record(**vars(ns)))
+ except BaseException as e:
+ print('Failed: {}'.format(e))
+ retcode = 1
+ sys.exit(1)
+
+def find_system_records(projects):
+ """Return list of paths to RECORD files for system-installed projects.
+
+ If a project is not installed, the resulting list contains None instead
+ of a path to its RECORD
+ """
+ records = []
+ # get system site-packages dirs
+ if hasattr(sys, 'real_prefix'):
+ #we are in python2 virtualenv and sys.real_prefix is the original sys.prefix
+ _orig_prefixes = site.PREFIXES
+ setattr(site, 'PREFIXES', [sys.real_prefix]*2)
+ sys_sitepack = site.getsitepackages()
+ setattr(site, 'PREFIXES', _orig_prefixes)
+ elif hasattr(sys, 'base_prefix'): # python3 venv doesn't inject real_prefix to sys
+ # we are on python3 and base(_exec)_prefix is unchanged in venv
+ sys_sitepack = site.getsitepackages([sys.base_prefix, sys.base_exec_prefix])
+ else:
+ # we are in python2 without virtualenv
+ sys_sitepack = site.getsitepackages()
+
+ sys_sitepack = [sp for sp in sys_sitepack if os.path.exists(sp)]
+ # try to find all projects in all system site-packages
+ for project in projects:
+ path = None
+ for sp in sys_sitepack:
+ dist_info_re = os.path.join(sp, project) + '-[^\{0}]+\.dist-info'.format(os.sep)
+ candidates = [os.path.join(sp, p) for p in os.listdir(sp)]
+ # filter out candidate dirs based on the above regexp
+ filtered = [c for c in candidates if re.match(dist_info_re, c)]
+ # if we have 0 or 2 or more dirs, something is wrong...
+ if len(filtered) == 1:
+ path = filtered[0]
+ if path is not None:
+ records.append(os.path.join(path, 'RECORD'))
+ else:
+ records.append(None)
+ return records
+
+def rewheel_from_record(record_path, outdir):
+ """Recreates a whee of package with given record_path and returns path
+ to the newly created wheel."""
+ site_dir = os.path.dirname(os.path.dirname(record_path))
+ record_relpath = record_path[len(site_dir):].strip(os.path.sep)
+ to_write, to_omit = get_records_to_pack(site_dir, record_relpath)
+ new_wheel_name = get_wheel_name(record_path)
+ new_wheel_path = os.path.join(outdir, new_wheel_name + '.whl')
+
+ new_wheel = zipfile.ZipFile(new_wheel_path, mode='w', compression=zipfile.ZIP_DEFLATED)
+ # we need to write a new record with just the files that we will write,
+ # e.g. not binaries and *.pyc/*.pyo files
+ if sys.version_info[0] < 3:
+ new_record = io.BytesIO()
+ else:
+ new_record = io.StringIO()
+ writer = csv.writer(new_record)
+
+ # handle files that we can write straight away
+ for f, sha_hash, size in to_write:
+ new_wheel.write(os.path.join(site_dir, f), arcname=f)
+ writer.writerow([f, sha_hash,size])
+
+ # rewrite the old wheel file with a new computed one
+ writer.writerow([record_relpath, '', ''])
+ new_wheel.writestr(record_relpath, new_record.getvalue())
+
+ new_wheel.close()
+
+ return new_wheel.filename
+
+def get_wheel_name(record_path):
+ """Return proper name of the wheel, without .whl."""
+
+ wheel_info_path = os.path.join(os.path.dirname(record_path), 'WHEEL')
+ with codecs.open(wheel_info_path, encoding='utf-8') as wheel_info_file:
+ wheel_info = email.parser.Parser().parsestr(wheel_info_file.read().encode('utf-8'))
+
+ metadata_path = os.path.join(os.path.dirname(record_path), 'METADATA')
+ with codecs.open(metadata_path, encoding='utf-8') as metadata_file:
+ metadata = email.parser.Parser().parsestr(metadata_file.read().encode('utf-8'))
+
+ # construct name parts according to wheel spec
+ distribution = metadata.get('Name')
+ version = metadata.get('Version')
+ build_tag = '' # nothing for now
+ lang_tag = []
+ for t in wheel_info.get_all('Tag'):
+ lang_tag.append(t.split('-')[0])
+ lang_tag = '.'.join(lang_tag)
+ abi_tag, plat_tag = wheel_info.get('Tag').split('-')[1:3]
+ # leave out build tag, if it is empty
+ to_join = filter(None, [distribution, version, build_tag, lang_tag, abi_tag, plat_tag])
+ return '-'.join(list(to_join))
+
+def get_records_to_pack(site_dir, record_relpath):
+ """Accepts path of sitedir and path of RECORD file relative to it.
+ Returns two lists:
+ - list of files that can be written to new RECORD straight away
+ - list of files that shouldn't be written or need some processing
+ (pyc and pyo files, scripts)
+ """
+ record_file_path = os.path.join(site_dir, record_relpath)
+ with codecs.open(record_file_path, encoding='utf-8') as record_file:
+ record_contents = record_file.read()
+ # temporary fix for https://github.com/pypa/pip/issues/1376
+ # we need to ignore files under ".data" directory
+ data_dir = os.path.dirname(record_relpath).strip(os.path.sep)
+ data_dir = data_dir[:-len('dist-info')] + 'data'
+
+ to_write = []
+ to_omit = []
+ for l in record_contents.splitlines():
+ spl = l.split(',')
+ if len(spl) == 3:
+ # new record will omit (or write differently):
+ # - abs paths, paths with ".." (entry points),
+ # - pyc+pyo files
+ # - the old RECORD file
+ # TODO: is there any better way to recognize an entry point?
+ if os.path.isabs(spl[0]) or spl[0].startswith('..') or \
+ spl[0].endswith('.pyc') or spl[0].endswith('.pyo') or \
+ spl[0] == record_relpath or spl[0].startswith(data_dir):
+ to_omit.append(spl)
+ else:
+ to_write.append(spl)
+ else:
+ pass # bad RECORD or empty line
+ return to_write, to_omit
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 877698c..2c43611 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -1065,7 +1065,7 @@ LIBSUBDIRS= lib-tk lib-tk/test lib-tk/test/test_tkinter \
test/tracedmodules \
encodings compiler hotshot \
email email/mime email/test email/test/data \
- ensurepip ensurepip/_bundled \
+ ensurepip ensurepip/_bundled ensurepip/rewheel\
json json/tests \
sqlite3 sqlite3/test \
logging bsddb bsddb/test csv importlib wsgiref \

View File

@ -1,7 +1,5 @@
diff --git a/Modules/Setup.dist b/Modules/Setup.dist
index bbc9222..2cf35a9 100644
--- a/Modules/Setup.dist
+++ b/Modules/Setup.dist
--- Python-2.7.4/Modules/Setup.dist.rhconfig 2013-04-06 16:02:34.000000000 +0200
+++ Python-2.7.4/Modules/Setup.dist 2013-04-08 10:05:16.369985654 +0200
@@ -153,7 +153,7 @@ GLHACK=-Dclear=__GLclear
# modules are to be built as shared libraries (see above for more
# detail; also note that *static* reverses this effect):
@ -11,7 +9,7 @@ index bbc9222..2cf35a9 100644
# GNU readline. Unlike previous Python incarnations, GNU readline is
# now incorporated in an optional module, configured in the Setup file
@@ -163,33 +163,33 @@ GLHACK=-Dclear=__GLclear
@@ -163,77 +163,77 @@ GLHACK=-Dclear=__GLclear
# it, depending on your system -- see the GNU readline instructions.
# It's okay for this to be a shared library, too.
@ -61,7 +59,9 @@ index bbc9222..2cf35a9 100644
# Standard I/O baseline
#_io -I$(srcdir)/Modules/_io _io/bufferedio.c _io/bytesio.c _io/fileio.c _io/iobase.c _io/_iomodule.c _io/stringio.c _io/textio.c
@@ -199,41 +199,41 @@ GLHACK=-Dclear=__GLclear
# Modules with some UNIX dependencies -- on by default:
# (If you have a really backward UNIX, select and socket may not be
# supported...)
@ -117,7 +117,7 @@ index bbc9222..2cf35a9 100644
# Multimedia modules -- off by default.
@@ -241,8 +241,8 @@ GLHACK=-Dclear=__GLclear
@@ -238,8 +238,8 @@ GLHACK=-Dclear=__GLclear
# #993173 says audioop works on 64-bit platforms, though.
# These represent audio samples or images as strings:
@ -128,7 +128,7 @@ index bbc9222..2cf35a9 100644
# Note that the _md5 and _sha modules are normally only built if the
@@ -252,14 +252,14 @@ GLHACK=-Dclear=__GLclear
@@ -249,14 +249,14 @@ GLHACK=-Dclear=__GLclear
# Message-Digest Algorithm, described in RFC 1321. The necessary files
# md5.c and md5.h are included here.
@ -147,7 +147,7 @@ index bbc9222..2cf35a9 100644
# SGI IRIX specific modules -- off by default.
@@ -306,12 +306,12 @@ GLHACK=-Dclear=__GLclear
@@ -303,12 +303,12 @@ GLHACK=-Dclear=__GLclear
# A Linux specific module -- off by default; this may also work on
# some *BSDs.
@ -162,7 +162,7 @@ index bbc9222..2cf35a9 100644
# The _tkinter module.
@@ -326,7 +326,7 @@ GLHACK=-Dclear=__GLclear
@@ -323,7 +323,7 @@ GLHACK=-Dclear=__GLclear
# every system.
# *** Always uncomment this (leave the leading underscore in!):
@ -171,7 +171,7 @@ index bbc9222..2cf35a9 100644
# *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
# -L/usr/local/lib \
# *** Uncomment and edit to reflect where your Tcl/Tk headers are:
@@ -336,7 +336,7 @@ GLHACK=-Dclear=__GLclear
@@ -333,7 +333,7 @@ GLHACK=-Dclear=__GLclear
# *** Or uncomment this for Solaris:
# -I/usr/openwin/include \
# *** Uncomment and edit for Tix extension only:
@ -180,7 +180,7 @@ index bbc9222..2cf35a9 100644
# *** Uncomment and edit for BLT extension only:
# -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
# *** Uncomment and edit for PIL (TkImaging) extension only:
@@ -345,7 +345,7 @@ GLHACK=-Dclear=__GLclear
@@ -342,7 +342,7 @@ GLHACK=-Dclear=__GLclear
# *** Uncomment and edit for TOGL extension only:
# -DWITH_TOGL togl.c \
# *** Uncomment and edit to reflect your Tcl/Tk versions:
@ -189,7 +189,7 @@ index bbc9222..2cf35a9 100644
# *** Uncomment and edit to reflect where your X11 libraries are:
# -L/usr/X11R6/lib \
# *** Or uncomment this for Solaris:
@@ -355,7 +355,7 @@ GLHACK=-Dclear=__GLclear
@@ -352,7 +352,7 @@ GLHACK=-Dclear=__GLclear
# *** Uncomment for AIX:
# -lld \
# *** Always uncomment this; X11 libraries to link with:
@ -198,7 +198,7 @@ index bbc9222..2cf35a9 100644
# Lance Ellinghaus's syslog module
#syslog syslogmodule.c # syslog daemon interface
@@ -377,7 +377,7 @@ GLHACK=-Dclear=__GLclear
@@ -374,7 +374,7 @@ GLHACK=-Dclear=__GLclear
# it is a highly experimental and dangerous device for calling
# *arbitrary* C functions in *arbitrary* shared libraries:
@ -207,7 +207,7 @@ index bbc9222..2cf35a9 100644
# Modules that provide persistent dictionary-like semantics. You will
@@ -400,7 +400,7 @@ GLHACK=-Dclear=__GLclear
@@ -397,7 +397,7 @@ GLHACK=-Dclear=__GLclear
#
# First, look at Setup.config; configure may have set this for you.
@ -216,7 +216,7 @@ index bbc9222..2cf35a9 100644
# Sleepycat Berkeley DB interface.
@@ -415,11 +415,9 @@ GLHACK=-Dclear=__GLclear
@@ -412,11 +412,9 @@ GLHACK=-Dclear=__GLclear
#
# Edit the variables DB and DBLIBVERto point to the db top directory
# and the subdirectory of PORT where you built it.
@ -231,7 +231,7 @@ index bbc9222..2cf35a9 100644
# Historical Berkeley DB 1.85
#
@@ -434,14 +432,14 @@ GLHACK=-Dclear=__GLclear
@@ -431,14 +430,14 @@ GLHACK=-Dclear=__GLclear
# Helper module for various ascii-encoders
@ -250,7 +250,7 @@ index bbc9222..2cf35a9 100644
# Lee Busby's SIGFPE modules.
@@ -464,7 +462,7 @@ GLHACK=-Dclear=__GLclear
@@ -461,7 +460,7 @@ GLHACK=-Dclear=__GLclear
# Andrew Kuchling's zlib module.
# This require zlib 1.1.3 (or later).
# See http://www.gzip.org/zlib/
@ -258,21 +258,20 @@ index bbc9222..2cf35a9 100644
+zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
# Interface to the Expat XML parser
# More information on Expat can be found at www.libexpat.org.
@@ -475,14 +473,14 @@ GLHACK=-Dclear=__GLclear
#
@@ -480,14 +479,14 @@ GLHACK=-Dclear=__GLclear
# Hye-Shik Chang's CJKCodecs
# multibytecodec is required for all the other CJK codec modules
-#_multibytecodec cjkcodecs/multibytecodec.c
-
+_multibytecodec cjkcodecs/multibytecodec.c
-#_codecs_cn cjkcodecs/_codecs_cn.c
-#_codecs_hk cjkcodecs/_codecs_hk.c
-#_codecs_iso2022 cjkcodecs/_codecs_iso2022.c
-#_codecs_jp cjkcodecs/_codecs_jp.c
-#_codecs_kr cjkcodecs/_codecs_kr.c
-#_codecs_tw cjkcodecs/_codecs_tw.c
+_multibytecodec cjkcodecs/multibytecodec.c
+
+_codecs_cn cjkcodecs/_codecs_cn.c
+_codecs_hk cjkcodecs/_codecs_hk.c
+_codecs_iso2022 cjkcodecs/_codecs_iso2022.c

View File

@ -5,9 +5,8 @@
# Note that the bcond macros are named for the CLI option they create.
# "%%bcond_without" means "ENABLE by default and create a --without option"
# Whether to use RPM build wheels from the python-{pip,setuptools}-wheel package
# Uses upstream bundled prebuilt wheels otherwise
%bcond_without rpmwheels
# Ability to reuse RPM-installed pip using rewheel
%bcond_without rewheel
# Extra build for debugging the interpreter or C-API extensions
# (the -debug subpackages)
@ -43,7 +42,9 @@
# Disabled for now:
%global with_huntrleaks 0
%ifnarch riscv64
%global with_gdb_hooks 1
%endif
%global with_systemtap 1
@ -54,7 +55,7 @@
%global with_valgrind 0
%endif
%global with_gdbm 1
%global with_gdbm 0
%if 0%{?_module_build}
%global with_valgrind 0
@ -105,16 +106,6 @@
# the rest of the build
%global regenerate_autotooling_patch 0
# Python 2 is deprecated in Fedora 30+, see:
# https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
# This means that new packages MUST NOT depend on python2, even transitively
# see: https://fedoraproject.org/wiki/Packaging:Deprecating_Packages
# Python 2 will not be supported after 2019. Use the python3 package instead
# if possible.
%if 0%{fedora} >= 30
%global deprecated Provides: deprecated()
%endif
# ==================
# Top-level metadata
@ -122,17 +113,13 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python2-docs when changing this:
%global general_version %{pybasever}.16
#global prerel ...
%global upstream_version %{general_version}%{?prerel}
Version: %{general_version}%{?prerel:~%{prerel}}
Release: 1%{?dist}
Version: 2.7.15
Release: 5.1.riscv64%{?dist}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
Provides: python(abi) = %{pybasever}
%?deprecated
# =======================
# Build-time requirements
@ -146,19 +133,17 @@ BuildRequires: bluez-libs-devel
%endif
BuildRequires: bzip2
BuildRequires: bzip2-devel
BuildRequires: glibc-all-langpacks
BuildRequires: glibc-devel
BuildRequires: gmp-devel
BuildRequires: libdb-devel
BuildRequires: libffi-devel
BuildRequires: ncurses-devel
BuildRequires: openssl-devel
BuildRequires: pkgconfig
BuildRequires: readline-devel
BuildRequires: sqlite-devel
BuildRequires: tcl-devel
BuildRequires: openssl-devel
# For the nis module
BuildRequires: libnsl2-devel
BuildRequires: libtirpc-devel
@ -197,10 +182,15 @@ BuildRequires: valgrind-devel
BuildRequires: zlib-devel
%if %{with rpmwheels}
BuildRequires: python-setuptools-wheel
BuildRequires: python-pip-wheel
%endif
%if %{with rewheel}
BuildRequires: python2-setuptools
Requires: python2-setuptools
%if ! 0%{?_module_build}
BuildRequires: python2-pip
Requires: python2-pip
%endif # !module_build
%endif # rewheel
# Providing python27 as now multiple interpreters exist in Fedora
# alongside the system one e.g. python26, python33 etc
@ -212,18 +202,12 @@ Provides: python27 = %{version}-%{release}
# python2 back with fixed version, so we just use the path here:
Recommends: %{_bindir}/python
# Previously, this was required for our rewheel patch to work.
# This is technically no longer needed, but we keep it recommended
# for the developer experience.
Recommends: python2-setuptools
Recommends: python2-pip
# =======================
# Source code and patches
# =======================
Source: https://www.python.org/ftp/python/%{version}/Python-%{upstream_version}.tar.xz
Source: https://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
# Work around bug 562906 until it's fixed in rpm-build by providing a fixed
# version of pythondeps.sh:
@ -736,15 +720,10 @@ Patch185: 00185-urllib2-honors-noproxy-for-ftp.patch
Patch187: 00187-add-RPATH-to-pyexpat.patch
# 00189 #
# Instead of bundled wheels, use our RPM packaged wheels from
# /usr/share/python-wheels
Patch189: 00189-use-rpm-wheels.patch
# 00190 #
# Fixes gdb py-bt command not to raise exception while processing
# statements from eval
# rhbz#1008154 (patch by Attila Fazekas)
Patch190: 00190-gdb-py-bt-dont-raise-exception-from-eval.patch
Patch189: 00189-gdb-py-bt-dont-raise-exception-from-eval.patch
# 00191 #
# Disabling NOOP test as it fails without internet connection
@ -757,6 +736,9 @@ Patch191: 00191-disable-NOOP.patch
# Patch provided by John C. Peterson
Patch193: 00193-enable-loading-sqlite-extensions.patch
# 00198 #
Patch198: 00198-add-rewheel-module.patch
# 00289 #
# Disable automatic detection for the nis module
# (we handle it it in Setup.dist, see Patch0)
@ -804,7 +786,6 @@ implementation is within the "python2-libs" package.
Summary: The "python" command that runs Python 2
BuildArch: noarch
# https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package
%?deprecated
# In theory this could require any python2 version
Requires: python2 == %{version}-%{release}
@ -818,7 +799,7 @@ This package contains /usr/bin/python - the "python" command that runs Python 2.
%package libs
Summary: Runtime libraries for Python 2
%?deprecated
Group: Applications/System
# Needed for ctypes, to load libraries, worked around for Live CDs size
# Requires: binutils
@ -837,14 +818,6 @@ Requires: glibc%{?_isa} >= 2.24.90-26
Requires: gdbm%{?_isa} >= 1:1.13
%endif
%if %{with rpmwheels}
Requires: python-setuptools-wheel
Requires: python-pip-wheel
%else
Provides: bundled(python2-pip) = 18.1
Provides: bundled(python2-setuptools) = 40.6.2
%endif
Provides: python-libs = %{version}-%{release}
Provides: python-libs%{?_isa} = %{version}-%{release}
@ -853,8 +826,7 @@ This package contains files used to embed Python 2 into applications.
%package devel
Summary: Libraries and header files needed for Python 2 development
%?deprecated
Group: Development/Libraries
Requires: %{python}%{?_isa} = %{version}-%{release}
Requires: python-rpm-macros
Requires: python2-rpm-macros
@ -867,15 +839,6 @@ Requires: pkgconfig
Requires: python3-rpm-generators
%endif
# This is not "API" (packages that need setuptools should still BuildRequire it)
# However some packages apparently can build both with and without setuptools
# producing egg-info as file or directory (depending on setuptools presence).
# Directory-to-file updates are problematic in RPM, so we ensure setuptools is
# installed when -devel is required.
# See https://bugzilla.redhat.com/show_bug.cgi?id=1623922
# See https://fedoraproject.org/wiki/Packaging:Directory_Replacement
Requires: python2-setuptools
# https://bugzilla.redhat.com/show_bug.cgi?id=1217376
# https://bugzilla.redhat.com/show_bug.cgi?id=1496757
# https://bugzilla.redhat.com/show_bug.cgi?id=1218294
@ -895,8 +858,7 @@ with and native libraries for Python 2
%package tools
Summary: A collection of development tools included with Python 2
%?deprecated
Group: Development/Tools
Requires: %{name} = %{version}-%{release}
Requires: %{python}-tkinter = %{version}-%{release}
@ -910,8 +872,7 @@ color editor (pynche), and a python gettext program (pygettext.py).
%package tkinter
Summary: A graphical user interface for the Python 2 scripting language
%?deprecated
Group: Development/Languages
Requires: %{name} = %{version}-%{release}
Provides: tkinter = %{version}-%{release}
@ -931,8 +892,7 @@ user interface for Python 2 programming.
%package test
Summary: The test modules from the main python2 package
%?deprecated
Group: Development/Languages
Requires: %{name} = %{version}-%{release}
Provides: python-test = %{version}-%{release}
@ -950,7 +910,7 @@ code that uses more than just unittest and/or test.support.
%if %{with debug_build}
%package debug
Summary: Debug version of the Python 2 runtime
%?deprecated
Group: Applications/System
# The debug build is an all-in-one package version of the regular build, and
# shares the same .py/.pyc files and directories as the regular build. Hence
@ -989,7 +949,7 @@ load its own extensions.
# ======================================================
%prep
%setup -q -n Python-%{upstream_version}
%setup -q -n Python-%{version}
%if 0%{?with_systemtap}
# Provide an example of usage of the tapset:
@ -1098,17 +1058,15 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c
%patch181 -p1
%patch185 -p1
%patch187 -p1
%if %{with rpmwheels}
%patch189 -p1
rm Lib/ensurepip/_bundled/*.whl
%endif
%patch190 -p1
%patch191 -p1
%patch193 -p1
%if %{with rewheel}
%patch198 -p1
%endif
%patch289 -p1
%if 0%{?_module_build}
%patch4000 -p1
%endif
@ -1566,8 +1524,6 @@ CheckPython() {
BinaryName=$2
ConfDir=$(pwd)/build/$ConfName
export OPENSSL_CONF=/non-existing-file
echo STARTING: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
# Note that we're running the tests using the version of the code in the
@ -1629,6 +1585,7 @@ CheckPython \
%files
%defattr(-, root, root, -)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README
@ -1642,6 +1599,7 @@ CheckPython \
%{_mandir}/*/python.1.*
%files libs
%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README
@ -1653,7 +1611,7 @@ CheckPython \
%{dynload_dir}/_sha512module.so
%{dynload_dir}/_shamodule.so
%{dynload_dir}/Python-%{upstream_version}-py%{pybasever}.egg-info
%{dynload_dir}/Python-%{version}-py%{pybasever}.egg-info
%{dynload_dir}/_bisectmodule.so
%{dynload_dir}/_bsddb.so
%{dynload_dir}/_codecs_cn.so
@ -1792,15 +1750,16 @@ CheckPython \
%dir %{pylibdir}/ensurepip/
%{pylibdir}/ensurepip/*.py*
%if %{with rpmwheels}
%exclude %{pylibdir}/ensurepip/_bundled
%else
%dir %{pylibdir}/ensurepip/_bundled
%{pylibdir}/ensurepip/_bundled/*.whl
%if %{with rewheel}
%dir %{pylibdir}/ensurepip/rewheel/
%{pylibdir}/ensurepip/rewheel/*.py*
%endif
%files devel
%defattr(-,root,root,-)
%{_libdir}/pkgconfig/python-%{pybasever}.pc
%{_libdir}/pkgconfig/python.pc
%{_libdir}/pkgconfig/python2.pc
@ -1816,6 +1775,7 @@ CheckPython \
%{_libdir}/libpython%{pybasever}.so
%files tools
%defattr(-,root,root,755)
%doc Tools/pynche/README.pynche
%{site_packages}/pynche
%{_bindir}/smtpd*.py*
@ -1832,12 +1792,14 @@ CheckPython \
%{pylibdir}/Doc
%files tkinter
%defattr(-,root,root,755)
%{pylibdir}/lib-tk
%if ! 0%{?_module_build}
%{dynload_dir}/_tkinter.so
%endif
%files test
%defattr(-, root, root, -)
%{pylibdir}/bsddb/test
%{pylibdir}/ctypes/test
%{pylibdir}/distutils/tests
@ -1866,6 +1828,7 @@ CheckPython \
%if %{with debug_build}
%files debug
%defattr(-,root,root,-)
# Analog of the core subpackage's files:
%{_bindir}/python-debug
@ -2008,38 +1971,11 @@ CheckPython \
# ======================================================
%changelog
* Mon Mar 04 2019 Miro Hrončok <mhroncok@redhat.com> - 2.7.16-1
- Update to 2.7.16 final
* Tue Jul 17 2018 David Abdurachmanov <david.abdurachmanov@gmail.com> - 2.7.15-5.1.riscv64
- Disable gdbm for gdbm rebuild
* Tue Feb 19 2019 Charalampos Stratakis <cstratak@redhat.com> - 2.7.16~rc1-1
- Update to 2.7.16rc1
* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.7.15-14
- Rebuild for readline 8.0
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.15-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Jan 14 2019 Björn Esser <besser82@fedoraproject.org> - 2.7.15-12
- Rebuilt for libcrypt.so.2 (#1666033)
* Mon Sep 24 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.15-11
- Security fix for CVE-2018-14647 (#1631822)
* Thu Sep 20 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.15-10
- Security fix for CVE-2018-1000802 (#1631662)
* Thu Sep 06 2018 Petr Viktorin <pviktori@redhat.com> - 2.7.15-9
- Deprecate python2 and all subpackages in Fedora 30+ (#1625773)
* Thu Aug 30 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.15-8
- Require python2-setuptools from python2-devel to prevent packaging errors (#1623922)
* Tue Aug 21 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.15-7
- Use RPM built wheels of pip and setuptools in ensurepip instead of our rewheel patch
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.15-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Mon Jul 16 2018 David Abdurachmanov <david.abdurachmanov@gmail.com> - 2.7.15-5.0.riscv64
- Disable gdb_hooks as we do not build debug* packages at this point (no GDB available)
* Thu Jun 14 2018 Miro Hrončok <mhroncok@redhat.com> - 2.7.15-5
- Move /usr/bin/python into a separate package

View File

@ -1 +1 @@
SHA512 (Python-2.7.16.tar.xz) = 16e814e8dcffc707b595ca2919bd2fa3db0d15794c63d977364652c4a5b92e90e72b8c9e1cc83b5020398bd90a1b397dbdd7cb931c49f1aa4af6ef95414b43e0
SHA512 (Python-2.7.15.tar.xz) = 27ea43eb45fc68f3d2469d5f07636e10801dee11635a430ec8ec922ed790bb426b072da94df885e4dfa1ea8b7a24f2f56dd92f9b0f51e162330f161216bd6de6

View File

@ -1,19 +0,0 @@
---
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
repositories:
- repo: "https://src.fedoraproject.org/tests/python.git"
dest: "python"
tests:
- smoke:
dir: python/smoke
run: METHOD=virtualenv VERSION=2.7 ./venv.sh
required_packages:
- gcc
- virtualenv
- python3-tox
- python2-devel
- glibc-all-langpacks # for locale tests