commit 198363e1b703107eba929d70dce2e1d762388bef
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Fri Sep 6 10:41:45 2013 +0300
Byte-compile versioned python libdirs in non-root prefix too (RhBug:868332)
- Previously brp-python-bytecompile assumed versioned python stdlib
always starts at / but if a software stack relies on "non-system"
python installed to a different prefix, those directories did
not get bytecompiled at all. Look for versioned python libdirs
all over the buildroot in the first loop to allow multiple
parallel versions to be handled (notably python 2 vs 3), everything
else still falls back to "default" python.
(cherry picked from commit e83d5c0bdd0e5d400a7bf76e08ce45f5305cf18d)
diff --git a/scripts/brp-python-bytecompile b/scripts/brp-python-bytecompile
index af6378e..f227305 100644
--- a/scripts/brp-python-bytecompile
+++ b/scripts/brp-python-bytecompile
@@ -34,7 +34,7 @@ fi
# and below /usr/lib/python3.1/, we're targeting /usr/bin/python3.1
shopt -s nullglob
-for python_libdir in "$RPM_BUILD_ROOT"/usr/lib{,64}/python[0-9].[0-9]/ ;
+for python_libdir in `find "$RPM_BUILD_ROOT" -type d|grep -E "/usr/lib(64)?/python[0-9]\.[0-9]$"`;
do
python_binary=/usr/bin/$(basename $python_libdir)
real_libdir=${python_libdir/$RPM_BUILD_ROOT/}