diff options
-rw-r--r-- | packaging/qemu-accel-aarch64.spec | 34 | ||||
-rw-r--r-- | packaging/qemu-accel-armv7hl.spec | 34 | ||||
-rw-r--r-- | packaging/qemu-accel-armv7l.spec | 34 | ||||
-rw-r--r-- | packaging/qemu-accel.spec.in | 34 |
4 files changed, 136 insertions, 0 deletions
diff --git a/packaging/qemu-accel-aarch64.spec b/packaging/qemu-accel-aarch64.spec index 2d0ebd6..7dc2b77 100644 --- a/packaging/qemu-accel-aarch64.spec +++ b/packaging/qemu-accel-aarch64.spec @@ -69,6 +69,8 @@ BuildRequires: libunwind BuildRequires: libuuid BuildRequires: clang BuildRequires: pbzip2 +BuildRequires: python3 +BuildRequires: python3-base # required for LLVM gold plugin BuildRequires: llvm-devel @@ -179,6 +181,7 @@ gcc_install_dir="$(%{target_arch}-gcc -print-file-name=)" # just like it is determided in python.spec host_python="python$(python --version 2>&1 | sed -ne '1s/.* //p' | head -c 3)" +host_python3="python$(python3 --version | sed -ne '1s/.* //p' | sed -e 's/^\(3\.[0-9]\+\).*/\1/')" # Emul path inside buildroot for installation buildroot_emul_path=%{buildroot}%{emul_path} @@ -280,6 +283,11 @@ prepare_package_list python \ %{_libdir}/${host_python}/lib-dynload/*.so \ %{_libdir}/${host_python}/site-packages/*/*.so +prepare_package_list python3 \ + %{_bindir}/${host_python3} \ + %{_libdir}/${host_python3}/lib-dynload/*.so \ + %{_libdir}/${host_python3}/site-packages/*/*.so + ## dump list of binaries and list of packages echo "### Binaries accelerated ###" echo $binaries | sed -e 's/[^ ]*\///g;s/[^ ]*.so[^ ]* \?//g' @@ -435,6 +443,24 @@ chmod +x ${buildroot_emul_path}%{_bindir}/${host_python} ln -s ${host_python} ${buildroot_emul_path}%{_bindir}/python ln -s ${host_python} ${buildroot_emul_path}%{_libdir}/python +# create symlinks for python3 +mv ${buildroot_emul_path}%{_bindir}/${host_python3} ${buildroot_emul_path}%{_bindir}/${host_python3}-orig +cat > ${buildroot_emul_path}%{_bindir}/${host_python3} << EOF +#!/bin/bash +if [ -z "\$PYTHONPATH" ]; then + export PYTHONPATH="%{libdir}/${host_python3}" +else + export PYTHONPATH+=":%{libdir}/${host_python3}" +fi +export PYTHONHOME="%{emul_path}%{_prefix}" +export LD_LIBRARY_PATH="%{emul_path}%{_libdir}:$LD_LIBRARY_PATH" +%{emul_path}%{_bindir}/${host_python3}-orig "\$@" +EOF +chmod +x ${buildroot_emul_path}%{_bindir}/${host_python3} + +ln -s ${host_python3} ${buildroot_emul_path}%{_bindir}/python3 +ln -s ${host_python3} ${buildroot_emul_path}%{_libdir}/python3 + #create symlinks for Scons & ply mkdir -p ${buildroot_emul_path}%{libdir}/${host_python}/site-packages ln -sf %{libdir}/${host_python}/site-packages/SCons ${buildroot_emul_path}%{libdir}/${host_python}/site-packages/SCons @@ -463,6 +489,8 @@ mkdir -p ${buildroot_emul_path}%{_libdir}/${host_python}/encodings/ cp %{_libdir}/${host_python}/site-packages/rpm/*.py ${buildroot_emul_path}%{_libdir}/${host_python}/site-packages/rpm/ cp %{_libdir}/${host_python}/*.py ${buildroot_emul_path}%{_libdir}/${host_python}/ cp %{_libdir}/${host_python}/encodings/*.py ${buildroot_emul_path}%{_libdir}/${host_python}/encodings/ +cp -r %{_libdir}/${host_python3} ${buildroot_emul_path}%{_libdir}/ +find ${buildroot_emul_path}%{_libdir}/${host_python3} -name *.pyc -exec rm {} \; # Skip directories to not glob all inside them during #files processing find %{buildroot} ! -type d -name 'python*' | sed -e "s|${buildroot_emul_path}||" | tee -a python.list @@ -571,6 +599,12 @@ cat %{_sourcedir}/all-accel.list %{?multilib:%{_sourcedir}/multilib-accel.list} ## python-accel # Generate list of all python files find %{buildroot} -name '*.py' | sed -e "s|${buildroot_emul_path}||" >> python.list +# Generate list of all python3 files +find ${buildroot_emul_path}%{_libdir}/${host_python3} -type f | sed -e "s|${buildroot_emul_path}||" >> python.list +# Add python3 dependant libraries +for library in ffi gdbm ncursesw panelw python3 tinfow; do + find ${buildroot_emul_path}%{_libdir} -name "lib${library}.*" | sed -e "s|${buildroot_emul_path}||" >> python.list +done sed -e 's|^|%{emul_path}|;s|%{emul_path}/%{_lib}|%{emul_path}%{_libdir}|' python.list | sort -u > python-full.list # Remove common files from python-accel comm -13 %{_sourcedir}/qemu-accel.list python-full.list | sort -u > %{_sourcedir}/python-accel.list diff --git a/packaging/qemu-accel-armv7hl.spec b/packaging/qemu-accel-armv7hl.spec index 17a5b44..878df60 100644 --- a/packaging/qemu-accel-armv7hl.spec +++ b/packaging/qemu-accel-armv7hl.spec @@ -69,6 +69,8 @@ BuildRequires: libunwind BuildRequires: libuuid BuildRequires: clang BuildRequires: pbzip2 +BuildRequires: python3 +BuildRequires: python3-base # required for LLVM gold plugin BuildRequires: llvm-devel @@ -179,6 +181,7 @@ gcc_install_dir="$(%{target_arch}-gcc -print-file-name=)" # just like it is determided in python.spec host_python="python$(python --version 2>&1 | sed -ne '1s/.* //p' | head -c 3)" +host_python3="python$(python3 --version | sed -ne '1s/.* //p' | sed -e 's/^\(3\.[0-9]\+\).*/\1/')" # Emul path inside buildroot for installation buildroot_emul_path=%{buildroot}%{emul_path} @@ -280,6 +283,11 @@ prepare_package_list python \ %{_libdir}/${host_python}/lib-dynload/*.so \ %{_libdir}/${host_python}/site-packages/*/*.so +prepare_package_list python3 \ + %{_bindir}/${host_python3} \ + %{_libdir}/${host_python3}/lib-dynload/*.so \ + %{_libdir}/${host_python3}/site-packages/*/*.so + ## dump list of binaries and list of packages echo "### Binaries accelerated ###" echo $binaries | sed -e 's/[^ ]*\///g;s/[^ ]*.so[^ ]* \?//g' @@ -435,6 +443,24 @@ chmod +x ${buildroot_emul_path}%{_bindir}/${host_python} ln -s ${host_python} ${buildroot_emul_path}%{_bindir}/python ln -s ${host_python} ${buildroot_emul_path}%{_libdir}/python +# create symlinks for python3 +mv ${buildroot_emul_path}%{_bindir}/${host_python3} ${buildroot_emul_path}%{_bindir}/${host_python3}-orig +cat > ${buildroot_emul_path}%{_bindir}/${host_python3} << EOF +#!/bin/bash +if [ -z "\$PYTHONPATH" ]; then + export PYTHONPATH="%{libdir}/${host_python3}" +else + export PYTHONPATH+=":%{libdir}/${host_python3}" +fi +export PYTHONHOME="%{emul_path}%{_prefix}" +export LD_LIBRARY_PATH="%{emul_path}%{_libdir}:$LD_LIBRARY_PATH" +%{emul_path}%{_bindir}/${host_python3}-orig "\$@" +EOF +chmod +x ${buildroot_emul_path}%{_bindir}/${host_python3} + +ln -s ${host_python3} ${buildroot_emul_path}%{_bindir}/python3 +ln -s ${host_python3} ${buildroot_emul_path}%{_libdir}/python3 + #create symlinks for Scons & ply mkdir -p ${buildroot_emul_path}%{libdir}/${host_python}/site-packages ln -sf %{libdir}/${host_python}/site-packages/SCons ${buildroot_emul_path}%{libdir}/${host_python}/site-packages/SCons @@ -463,6 +489,8 @@ mkdir -p ${buildroot_emul_path}%{_libdir}/${host_python}/encodings/ cp %{_libdir}/${host_python}/site-packages/rpm/*.py ${buildroot_emul_path}%{_libdir}/${host_python}/site-packages/rpm/ cp %{_libdir}/${host_python}/*.py ${buildroot_emul_path}%{_libdir}/${host_python}/ cp %{_libdir}/${host_python}/encodings/*.py ${buildroot_emul_path}%{_libdir}/${host_python}/encodings/ +cp -r %{_libdir}/${host_python3} ${buildroot_emul_path}%{_libdir}/ +find ${buildroot_emul_path}%{_libdir}/${host_python3} -name *.pyc -exec rm {} \; # Skip directories to not glob all inside them during #files processing find %{buildroot} ! -type d -name 'python*' | sed -e "s|${buildroot_emul_path}||" | tee -a python.list @@ -571,6 +599,12 @@ cat %{_sourcedir}/all-accel.list %{?multilib:%{_sourcedir}/multilib-accel.list} ## python-accel # Generate list of all python files find %{buildroot} -name '*.py' | sed -e "s|${buildroot_emul_path}||" >> python.list +# Generate list of all python3 files +find ${buildroot_emul_path}%{_libdir}/${host_python3} -type f | sed -e "s|${buildroot_emul_path}||" >> python.list +# Add python3 dependant libraries +for library in ffi gdbm ncursesw panelw python3 tinfow; do + find ${buildroot_emul_path}%{_libdir} -name "lib${library}.*" | sed -e "s|${buildroot_emul_path}||" >> python.list +done sed -e 's|^|%{emul_path}|;s|%{emul_path}/%{_lib}|%{emul_path}%{_libdir}|' python.list | sort -u > python-full.list # Remove common files from python-accel comm -13 %{_sourcedir}/qemu-accel.list python-full.list | sort -u > %{_sourcedir}/python-accel.list diff --git a/packaging/qemu-accel-armv7l.spec b/packaging/qemu-accel-armv7l.spec index eee28f1..3262d21 100644 --- a/packaging/qemu-accel-armv7l.spec +++ b/packaging/qemu-accel-armv7l.spec @@ -69,6 +69,8 @@ BuildRequires: libunwind BuildRequires: libuuid BuildRequires: clang BuildRequires: pbzip2 +BuildRequires: python3 +BuildRequires: python3-base # required for LLVM gold plugin BuildRequires: llvm-devel @@ -179,6 +181,7 @@ gcc_install_dir="$(%{target_arch}-gcc -print-file-name=)" # just like it is determided in python.spec host_python="python$(python --version 2>&1 | sed -ne '1s/.* //p' | head -c 3)" +host_python3="python$(python3 --version | sed -ne '1s/.* //p' | sed -e 's/^\(3\.[0-9]\+\).*/\1/')" # Emul path inside buildroot for installation buildroot_emul_path=%{buildroot}%{emul_path} @@ -280,6 +283,11 @@ prepare_package_list python \ %{_libdir}/${host_python}/lib-dynload/*.so \ %{_libdir}/${host_python}/site-packages/*/*.so +prepare_package_list python3 \ + %{_bindir}/${host_python3} \ + %{_libdir}/${host_python3}/lib-dynload/*.so \ + %{_libdir}/${host_python3}/site-packages/*/*.so + ## dump list of binaries and list of packages echo "### Binaries accelerated ###" echo $binaries | sed -e 's/[^ ]*\///g;s/[^ ]*.so[^ ]* \?//g' @@ -435,6 +443,24 @@ chmod +x ${buildroot_emul_path}%{_bindir}/${host_python} ln -s ${host_python} ${buildroot_emul_path}%{_bindir}/python ln -s ${host_python} ${buildroot_emul_path}%{_libdir}/python +# create symlinks for python3 +mv ${buildroot_emul_path}%{_bindir}/${host_python3} ${buildroot_emul_path}%{_bindir}/${host_python3}-orig +cat > ${buildroot_emul_path}%{_bindir}/${host_python3} << EOF +#!/bin/bash +if [ -z "\$PYTHONPATH" ]; then + export PYTHONPATH="%{libdir}/${host_python3}" +else + export PYTHONPATH+=":%{libdir}/${host_python3}" +fi +export PYTHONHOME="%{emul_path}%{_prefix}" +export LD_LIBRARY_PATH="%{emul_path}%{_libdir}:$LD_LIBRARY_PATH" +%{emul_path}%{_bindir}/${host_python3}-orig "\$@" +EOF +chmod +x ${buildroot_emul_path}%{_bindir}/${host_python3} + +ln -s ${host_python3} ${buildroot_emul_path}%{_bindir}/python3 +ln -s ${host_python3} ${buildroot_emul_path}%{_libdir}/python3 + #create symlinks for Scons & ply mkdir -p ${buildroot_emul_path}%{libdir}/${host_python}/site-packages ln -sf %{libdir}/${host_python}/site-packages/SCons ${buildroot_emul_path}%{libdir}/${host_python}/site-packages/SCons @@ -463,6 +489,8 @@ mkdir -p ${buildroot_emul_path}%{_libdir}/${host_python}/encodings/ cp %{_libdir}/${host_python}/site-packages/rpm/*.py ${buildroot_emul_path}%{_libdir}/${host_python}/site-packages/rpm/ cp %{_libdir}/${host_python}/*.py ${buildroot_emul_path}%{_libdir}/${host_python}/ cp %{_libdir}/${host_python}/encodings/*.py ${buildroot_emul_path}%{_libdir}/${host_python}/encodings/ +cp -r %{_libdir}/${host_python3} ${buildroot_emul_path}%{_libdir}/ +find ${buildroot_emul_path}%{_libdir}/${host_python3} -name *.pyc -exec rm {} \; # Skip directories to not glob all inside them during #files processing find %{buildroot} ! -type d -name 'python*' | sed -e "s|${buildroot_emul_path}||" | tee -a python.list @@ -571,6 +599,12 @@ cat %{_sourcedir}/all-accel.list %{?multilib:%{_sourcedir}/multilib-accel.list} ## python-accel # Generate list of all python files find %{buildroot} -name '*.py' | sed -e "s|${buildroot_emul_path}||" >> python.list +# Generate list of all python3 files +find ${buildroot_emul_path}%{_libdir}/${host_python3} -type f | sed -e "s|${buildroot_emul_path}||" >> python.list +# Add python3 dependant libraries +for library in ffi gdbm ncursesw panelw python3 tinfow; do + find ${buildroot_emul_path}%{_libdir} -name "lib${library}.*" | sed -e "s|${buildroot_emul_path}||" >> python.list +done sed -e 's|^|%{emul_path}|;s|%{emul_path}/%{_lib}|%{emul_path}%{_libdir}|' python.list | sort -u > python-full.list # Remove common files from python-accel comm -13 %{_sourcedir}/qemu-accel.list python-full.list | sort -u > %{_sourcedir}/python-accel.list diff --git a/packaging/qemu-accel.spec.in b/packaging/qemu-accel.spec.in index 2d9bec4..7aadd20 100644 --- a/packaging/qemu-accel.spec.in +++ b/packaging/qemu-accel.spec.in @@ -66,6 +66,8 @@ BuildRequires: libunwind BuildRequires: libuuid BuildRequires: clang BuildRequires: pbzip2 +BuildRequires: python3 +BuildRequires: python3-base # required for LLVM gold plugin BuildRequires: llvm-devel @@ -176,6 +178,7 @@ gcc_install_dir="$(%{target_arch}-gcc -print-file-name=)" # just like it is determided in python.spec host_python="python$(python --version 2>&1 | sed -ne '1s/.* //p' | head -c 3)" +host_python3="python$(python3 --version | sed -ne '1s/.* //p' | sed -e 's/^\(3\.[0-9]\+\).*/\1/')" # Emul path inside buildroot for installation buildroot_emul_path=%{buildroot}%{emul_path} @@ -277,6 +280,11 @@ prepare_package_list python \ %{_libdir}/${host_python}/lib-dynload/*.so \ %{_libdir}/${host_python}/site-packages/*/*.so +prepare_package_list python3 \ + %{_bindir}/${host_python3} \ + %{_libdir}/${host_python3}/lib-dynload/*.so \ + %{_libdir}/${host_python3}/site-packages/*/*.so + ## dump list of binaries and list of packages echo "### Binaries accelerated ###" echo $binaries | sed -e 's/[^ ]*\///g;s/[^ ]*.so[^ ]* \?//g' @@ -432,6 +440,24 @@ chmod +x ${buildroot_emul_path}%{_bindir}/${host_python} ln -s ${host_python} ${buildroot_emul_path}%{_bindir}/python ln -s ${host_python} ${buildroot_emul_path}%{_libdir}/python +# create symlinks for python3 +mv ${buildroot_emul_path}%{_bindir}/${host_python3} ${buildroot_emul_path}%{_bindir}/${host_python3}-orig +cat > ${buildroot_emul_path}%{_bindir}/${host_python3} << EOF +#!/bin/bash +if [ -z "\$PYTHONPATH" ]; then + export PYTHONPATH="%{libdir}/${host_python3}" +else + export PYTHONPATH+=":%{libdir}/${host_python3}" +fi +export PYTHONHOME="%{emul_path}%{_prefix}" +export LD_LIBRARY_PATH="%{emul_path}%{_libdir}:$LD_LIBRARY_PATH" +%{emul_path}%{_bindir}/${host_python3}-orig "\$@" +EOF +chmod +x ${buildroot_emul_path}%{_bindir}/${host_python3} + +ln -s ${host_python3} ${buildroot_emul_path}%{_bindir}/python3 +ln -s ${host_python3} ${buildroot_emul_path}%{_libdir}/python3 + #create symlinks for Scons & ply mkdir -p ${buildroot_emul_path}%{libdir}/${host_python}/site-packages ln -sf %{libdir}/${host_python}/site-packages/SCons ${buildroot_emul_path}%{libdir}/${host_python}/site-packages/SCons @@ -460,6 +486,8 @@ mkdir -p ${buildroot_emul_path}%{_libdir}/${host_python}/encodings/ cp %{_libdir}/${host_python}/site-packages/rpm/*.py ${buildroot_emul_path}%{_libdir}/${host_python}/site-packages/rpm/ cp %{_libdir}/${host_python}/*.py ${buildroot_emul_path}%{_libdir}/${host_python}/ cp %{_libdir}/${host_python}/encodings/*.py ${buildroot_emul_path}%{_libdir}/${host_python}/encodings/ +cp -r %{_libdir}/${host_python3} ${buildroot_emul_path}%{_libdir}/ +find ${buildroot_emul_path}%{_libdir}/${host_python3} -name *.pyc -exec rm {} \; # Skip directories to not glob all inside them during #files processing find %{buildroot} ! -type d -name 'python*' | sed -e "s|${buildroot_emul_path}||" | tee -a python.list @@ -568,6 +596,12 @@ cat %{_sourcedir}/all-accel.list %{?multilib:%{_sourcedir}/multilib-accel.list} ## python-accel # Generate list of all python files find %{buildroot} -name '*.py' | sed -e "s|${buildroot_emul_path}||" >> python.list +# Generate list of all python3 files +find ${buildroot_emul_path}%{_libdir}/${host_python3} -type f | sed -e "s|${buildroot_emul_path}||" >> python.list +# Add python3 dependant libraries +for library in ffi gdbm ncursesw panelw python3 tinfow; do + find ${buildroot_emul_path}%{_libdir} -name "lib${library}.*" | sed -e "s|${buildroot_emul_path}||" >> python.list +done sed -e 's|^|%{emul_path}|;s|%{emul_path}/%{_lib}|%{emul_path}%{_libdir}|' python.list | sort -u > python-full.list # Remove common files from python-accel comm -13 %{_sourcedir}/qemu-accel.list python-full.list | sort -u > %{_sourcedir}/python-accel.list |