From 95238b7fc9f618cd4cb875e57658dc6b32d7c2234509efef85a0784ac784f81e Mon Sep 17 00:00:00 2001
From: Jan Matejek <ja+suse@matejcik.cz>
Date: Thu, 30 Jun 2016 13:10:14 +0000
Subject: [PATCH] - update LD_LIBRARY_PATH to use $PWD instead of "." because
 the test   process escapes to its own directory - modify shebang-fixing
 scriptlet to ignore makeopcodetargets.py

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python?expand=0&rev=194
---
 python-base.changes | 3 +++
 python-doc.spec     | 2 ++
 python.spec         | 9 +++++++--
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/python-base.changes b/python-base.changes
index f81e228..b24341c 100644
--- a/python-base.changes
+++ b/python-base.changes
@@ -10,6 +10,9 @@ Thu Jun 30 09:23:05 UTC 2016 - jmatejek@suse.com
 - refreshed multilib patch
 - python-2.7.12-makeopcode.patch - run newly-built python interpreter
   to make opcodes, in order not to require pre-built python
+- update LD_LIBRARY_PATH to use $PWD instead of "." because the test
+  process escapes to its own directory
+- modify shebang-fixing scriptlet to ignore makeopcodetargets.py
 
 -------------------------------------------------------------------
 Fri Jan 29 13:03:40 UTC 2016 - rguenther@suse.com
diff --git a/python-doc.spec b/python-doc.spec
index 45adff7..39d1659 100644
--- a/python-doc.spec
+++ b/python-doc.spec
@@ -56,6 +56,7 @@ Patch34:        python-2.7.9-sles-disable-verification-by-default.patch
 # PATCH-FIX-UPSTREAM python-ncurses-6.0-accessors.patch dimstar@opensuse.org -- Fix build with NCurses 6.0 and OPAQUE_WINDOW set to 1
 Patch35:        python-ncurses-6.0-accessors.patch
 Patch36:        python-2.7.10-overflow_check.patch
+Patch37:        python-2.7.12-makeopcode.patch
 # COMMON-PATCH-END
 Provides:       pyth_doc
 Provides:       pyth_ps
@@ -103,6 +104,7 @@ Python, and Macintosh Module Reference in PDF format.
 %endif
 %patch35 -p1
 %patch36
+%patch37 -p1
 
 # drop Autoconf version requirement
 sed -i 's/^version_required/dnl version_required/' configure.ac
diff --git a/python.spec b/python.spec
index d69f90c..6af0e5c 100644
--- a/python.spec
+++ b/python.spec
@@ -61,6 +61,7 @@ Patch34:        python-2.7.9-sles-disable-verification-by-default.patch
 # PATCH-FIX-UPSTREAM python-ncurses-6.0-accessors.patch dimstar@opensuse.org -- Fix build with NCurses 6.0 and OPAQUE_WINDOW set to 1
 Patch35:        python-ncurses-6.0-accessors.patch
 Patch36:        python-2.7.10-overflow_check.patch
+Patch37:        python-2.7.12-makeopcode.patch
 # COMMON-PATCH-END
 BuildRequires:  automake
 BuildRequires:  db-devel
@@ -204,6 +205,7 @@ that rely on earlier non-verification behavior.
 %endif
 %patch35 -p1
 %patch36
+%patch37 -p1
 
 # drop Autoconf version requirement
 sed -i 's/^version_required/dnl version_required/' configure.ac
@@ -231,7 +233,8 @@ touch Parser/asdl* Python/Python-ast.c Include/Python-ast.h
     --enable-shared \
     --enable-unicode=ucs4
 
-make %{?_smp_mflags}
+LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH \
+    make %{?_smp_mflags}
 
 %check
 # on hppa, the threading of glibc is quite broken. The tests just stop
@@ -248,7 +251,9 @@ make test TESTOPTS="$LIST" TESTPYTHONOPTS="-R"
 
 %install
 # replace rest of /usr/local/bin/python or /usr/bin/python2.x with /usr/bin/python
-find . -wholename "./Parser" -prune -o -name '*.py' -type f -print0 | xargs -0 grep -lE '^#! *(/usr/.*bin/(env +)?)?python' | xargs sed -r -i -e '1s@^#![[:space:]]*(/usr/(local/)?bin/(env +)?)?python([0-9]+\.[0-9]+)?@#!/usr/bin/python@'
+find . -name '*.py' -type f | grep -vE "^./Parser/|^./Python/" \
+  | xargs grep -lE '^#! *(/usr/.*bin/(env +)?)?python' \
+  | xargs sed -r -i -e '1s@^#![[:space:]]*(/usr/(local/)?bin/(env +)?)?python([0-9]+\.[0-9]+)?@#!/usr/bin/python@'
 # the grep inbetween makes it much faster
 ########################################
 # install it