From 3056bfd92a4269ad8f9b57cab05af3125e87ca8c Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Wed, 17 Jan 2018 13:58:28 +0100 Subject: [PATCH] Build the nis module with tirpc --- 00102-2.7.13-lib64.patch | 9 +++++++++ 00289-disable-nis-detection.patch | 26 ++++++++++++++++++++++++++ python-2.7.1-config.patch | 2 +- python2.spec | 17 +++++++++++++++-- 4 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 00289-disable-nis-detection.patch diff --git a/00102-2.7.13-lib64.patch b/00102-2.7.13-lib64.patch index 5d20879..5a87d03 100644 --- a/00102-2.7.13-lib64.patch +++ b/00102-2.7.13-lib64.patch @@ -104,6 +104,15 @@ diff --git a/Modules/Setup.dist b/Modules/Setup.dist index fbfa1c1..138fb33 100644 --- a/Modules/Setup.dist +++ b/Modules/Setup.dist +@@ -231,7 +231,7 @@ + # Some more UNIX dependent modules -- off by default, since these + # are not supported by all UNIX systems: + +-nis nismodule.c -lnsl -ltirpc -I/usr/include/tirpc -I/usr/include/nsl -L/usr/lib/nsl ++nis nismodule.c -lnsl -ltirpc -I/usr/include/tirpc -I/usr/include/nsl -L/usr/lib64/nsl + termios termios.c # Steen Lumholt's termios module + resource resource.c # Jeremy Hylton's rlimit interface + @@ -416,7 +416,7 @@ gdbm gdbmmodule.c -lgdbm # Edit the variables DB and DBLIBVERto point to the db top directory # and the subdirectory of PORT where you built it. diff --git a/00289-disable-nis-detection.patch b/00289-disable-nis-detection.patch new file mode 100644 index 0000000..baf69b5 --- /dev/null +++ b/00289-disable-nis-detection.patch @@ -0,0 +1,26 @@ +diff a/setup.py b/setup.py +--- a/setup.py 2018-01-17 11:58:45.384354567 +0100 ++++ b/setup.py 2018-01-17 11:54:23.384743168 +0100 +@@ -1346,19 +1346,10 @@ + else: + missing.append('resource') + +- # Sun yellow pages. Some systems have the functions in libc. +- if (host_platform not in ['cygwin', 'atheos', 'qnx6'] and +- find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None): +- if (self.compiler.find_library_file(lib_dirs, 'nsl')): +- libs = ['nsl'] +- else: +- libs = [] +- exts.append( Extension('nis', ['nismodule.c'], +- libraries = libs) ) +- else: +- missing.append('nis') ++ # nis (Sun yellow pages) is handled in Setup.dist ++ + else: +- missing.extend(['nis', 'resource', 'termios']) ++ missing.extend(['resource', 'termios']) + + # Curses support, requiring the System V version of curses, often + # provided by the ncurses library. diff --git a/python-2.7.1-config.patch b/python-2.7.1-config.patch index 6976d5c..5c8bd43 100644 --- a/python-2.7.1-config.patch +++ b/python-2.7.1-config.patch @@ -111,7 +111,7 @@ -#nis nismodule.c -lnsl # Sun yellow pages -- not everywhere -#termios termios.c # Steen Lumholt's termios module -#resource resource.c # Jeremy Hylton's rlimit interface -+nis nismodule.c -lnsl # Sun yellow pages -- not everywhere ++nis nismodule.c -lnsl -ltirpc -I/usr/include/tirpc -I/usr/include/nsl -L/usr/lib/nsl +termios termios.c # Steen Lumholt's termios module +resource resource.c # Jeremy Hylton's rlimit interface diff --git a/python2.spec b/python2.spec index de0323d..77265df 100644 --- a/python2.spec +++ b/python2.spec @@ -112,7 +112,7 @@ Summary: An interpreted, interactive, object-oriented programming language Name: %{python} # Remember to also rebase python-docs when changing this: Version: 2.7.14 -Release: 6%{?dist} +Release: 7%{?dist} License: Python Group: Development/Languages Requires: %{python}-libs%{?_isa} = %{version}-%{release} @@ -142,6 +142,10 @@ BuildRequires: readline-devel BuildRequires: sqlite-devel BuildRequires: tcl-devel +# For the nis module +BuildRequires: libnsl2-devel +BuildRequires: libtirpc-devel + # expat 2.1.0 added the symbol XML_SetHashSalt without bumping SONAME. We use # it (in pyexpat) in order to enable the fix in Python-2.7.3 for CVE-2012-0876: BuildRequires: expat-devel >= 2.1.0 @@ -228,6 +232,7 @@ Source7: pynche # - various modules are built by default by upstream as static libraries; # we built them as shared libraries # - build the "readline" module (appears to also be handled by setup.py now) +# - build the nis module (which needs the tirpc library since glibc 2.26) # - enable the build of the following modules: # - array arraymodule.c # array objects # - cmath cmathmodule.c # -lm # complex math library functions @@ -254,7 +259,6 @@ Source7: pynche # - _socket socketmodule.c # Socket module helper for socket(2) # - _ssl _ssl.c # - crypt cryptmodule.c -lcrypt # crypt(3) -# - nis nismodule.c -lnsl # Sun yellow pages -- not everywhere # - termios termios.c # Steen Lumholt's termios module # - resource resource.c # Jeremy Hylton's rlimit interface # - audioop audioop.c # Operations on audio samples @@ -754,6 +758,11 @@ Patch285: 00285-fix-non-deterministic-read-in-test_pty.patch # Fixed upstream: https://bugs.python.org/issue32186 Patch287: 00287-fix-thread-hanging-on-inaccessible-nfs-server.patch +# 00289 # +# Disable automatic detection for the nis module +# (we handle it it in Setup.dist, see Patch0) +Patch289: 00289-disable-nis-detection.patch + # (New patches go here ^^^) # # When adding new patches to "python2" and "python3" in Fedora, EL, etc., @@ -1077,6 +1086,7 @@ mv Modules/cryptmodule.c Modules/_cryptmodule.c %patch284 -p1 %patch285 -p1 %patch287 -p1 +%patch289 -p1 %if 0%{?_module_build} @@ -1957,6 +1967,9 @@ rm -fr %{buildroot} # ====================================================== %changelog +* Wed Jan 17 2018 Petr Viktorin - 2.7.14-7 +- Build the nis module with tirpc + * Tue Jan 16 2018 Miro HronĨok - 2.7.14-6 - Rebuild for reverted gdbm 1.13 on Fedora 27