BuildRequires: libuuid
BuildRequires: clang
BuildRequires: pbzip2
+BuildRequires: python3
+BuildRequires: python3-base
# required for LLVM gold plugin
BuildRequires: llvm-devel
# 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}
%{_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'
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
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
## 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
BuildRequires: libuuid
BuildRequires: clang
BuildRequires: pbzip2
+BuildRequires: python3
+BuildRequires: python3-base
# required for LLVM gold plugin
BuildRequires: llvm-devel
# 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}
%{_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'
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
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
## 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
BuildRequires: libuuid
BuildRequires: clang
BuildRequires: pbzip2
+BuildRequires: python3
+BuildRequires: python3-base
# required for LLVM gold plugin
BuildRequires: llvm-devel
# 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}
%{_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'
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
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
## 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
BuildRequires: libuuid
BuildRequires: clang
BuildRequires: pbzip2
+BuildRequires: python3
+BuildRequires: python3-base
# required for LLVM gold plugin
BuildRequires: llvm-devel
# 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}
%{_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'
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
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
## 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