From c5768c9fcc16c6f2721798ddbf1d761e91ac896c Mon Sep 17 00:00:00 2001 From: Mikhail Kashkarov Date: Mon, 27 May 2019 13:50:40 +0300 Subject: [7/7] Rename our_path -> emul_path This is more suitable variable name for emulation path, especially since default qemu-linux-user path is /emul. Change-Id: I53bba2ad9996ce90e9092dc7dfb39301adfb5211 --- packaging/qemu-accel-aarch64.spec | 90 +++++++++++++++++++-------------------- packaging/qemu-accel-armv7hl.spec | 90 +++++++++++++++++++-------------------- packaging/qemu-accel-armv7l.spec | 90 +++++++++++++++++++-------------------- packaging/qemu-accel.spec.in | 90 +++++++++++++++++++-------------------- 4 files changed, 180 insertions(+), 180 deletions(-) diff --git a/packaging/qemu-accel-aarch64.spec b/packaging/qemu-accel-aarch64.spec index cbac246..be6db48 100644 --- a/packaging/qemu-accel-aarch64.spec +++ b/packaging/qemu-accel-aarch64.spec @@ -32,7 +32,7 @@ } # default path in qemu -%define our_path /emul +%define emul_path /emul Name: qemu-accel Version: 0.4 @@ -128,7 +128,7 @@ gcc_install_dir="$(%{target_arch}-gcc -print-file-name=)" host_python="python$(python --version 2>&1 | sed -ne '1s/.* //p' | head -c 3)" # Emul path inside buildroot for installation -buildroot_emul_path=%{buildroot}%{our_path} +buildroot_emul_path=%{buildroot}%{emul_path} binaries="%{_libdir}/libnsl.so.1 %{_libdir}/libnss_compat.so.2" # loaded via dlopen by glibc %ifarch %ix86 @@ -199,7 +199,7 @@ function prepare_package_list { done ## Store the resulting list for packaging, setting up the right prefix - cat $name.list | sed -e 's|^|%{our_path}|;s| |\n%{our_path}|g' | sort -u > %{_sourcedir}/$name-accel.list + cat $name.list | sed -e 's|^|%{emul_path}|;s| |\n%{emul_path}|g' | sort -u > %{_sourcedir}/$name-accel.list binaries="$binaries $bins" } @@ -245,10 +245,10 @@ function patch_binary { fi rm -f $outfile.data [ "$binary" == "$rtld" ] && return - patchelf --set-rpath "%{our_path}/%{_libdir}" $outfile + patchelf --set-rpath "%{emul_path}/%{_libdir}" $outfile # not all binaries have an .interp section if patchelf --print-interpreter $outfile 1>/dev/null 2>/dev/null; then - patchelf --set-interpreter %{our_path}$rtld $outfile + patchelf --set-interpreter %{emul_path}$rtld $outfile fi } @@ -271,11 +271,11 @@ do fdir=$(dirname $f) [ ! -d ${buildroot_emul_path}/$fdir ] && mkdir -p ${buildroot_emul_path}/$fdir cp -a $f ${buildroot_emul_path}/$f - echo "%{our_path}$f" >> %{_sourcedir}/multilib-accel.list + echo "%{emul_path}$f" >> %{_sourcedir}/multilib-accel.list done # Now we have to change the ld.so name to prevent name clashing in armv7l repos -i686_libdir="%{our_path}/lib" +i686_libdir="%{emul_path}/lib" # 1. Rename the actual ld.so binary cross_ld_so=$(find %{buildroot}${i686_libdir} -name 'ld-*.so' -printf '%f') @@ -284,7 +284,7 @@ mv %{buildroot}${i686_libdir}/${cross_ld_so} %{buildroot}${i686_libdir}/${new_cr sed -e "s|${cross_ld_so}|${new_cross_ld_so}|" -i %{_sourcedir}/multilib-accel.list # 2. Force the symlink to point the right file. -ln -sf %{our_path}/lib/${new_cross_ld_so} %{buildroot}${i686_libdir}/${cross_ld_symlink} +ln -sf %{emul_path}/lib/${new_cross_ld_so} %{buildroot}${i686_libdir}/${cross_ld_symlink} echo "${i686_libdir}/${cross_ld_symlink}" >> %{_sourcedir}/multilib-accel.list # create symlinks for libgcc-32bit @@ -292,7 +292,7 @@ echo "${i686_libdir}/${cross_ld_symlink}" >> %{_sourcedir}/multilib-accel.list for f in $(rpm -ql libgcc-32bit) do filename=$(basename $f) - ln -sf %{our_path}/$f %{buildroot}${i686_libdir}/${filename} + ln -sf %{emul_path}/$f %{buildroot}${i686_libdir}/${filename} echo "${i686_libdir}/${filename}" >> %{_sourcedir}/multilib-accel.list done } @@ -301,33 +301,33 @@ done ln -s usr/bin "${buildroot_emul_path}/bin" echo '%{our_path}/bin' >> %{_sourcedir}/all-accel.list ln -sf bash "${buildroot_emul_path}%{_bindir}sh" -echo '%{our_path}%{_bindir}sh' >> %{_sourcedir}/all-accel.list +echo '%{emul_path}%{_bindir}sh' >> %{_sourcedir}/all-accel.list mv ${buildroot_emul_path}/%{_lib}/* ${buildroot_emul_path}%{_libdir}/ rm -rf ${buildroot_emul_path}/%{_lib} ln -sf usr/%{_lib} ${buildroot_emul_path}/%{_lib} -echo '%{our_path}/%{_lib}' >> %{_sourcedir}/all-accel.list +echo '%{emul_path}/%{_lib}' >> %{_sourcedir}/all-accel.list %{?multilib: mv ${buildroot_emul_path}/lib/* ${buildroot_emul_path}%{_prefix}/lib/ rm -rf ${buildroot_emul_path}/lib ln -sf usr/lib ${buildroot_emul_path}/lib -sed -e 's|%{our_path}/lib|%{our_path}/usr/lib|' -i %{_sourcedir}/multilib-accel.list -echo '%{our_path}/usr/lib' >> %{_sourcedir}/multilib-accel.list +sed -e 's|%{emul_path}/lib|%{emul_path}/usr/lib|' -i %{_sourcedir}/multilib-accel.list +echo '%{emul_path}/usr/lib' >> %{_sourcedir}/multilib-accel.list } # rename binutils binaries for binary in addr2line ar as c++filt dwp elfedit gprof ld ld.bfd ld.gold nm objcopy objdump ranlib readelf size strings strip gcov do mv ${buildroot_emul_path}%{_bindir}/%{target_arch}-$binary ${buildroot_emul_path}%{_bindir}/$binary - sed -e "\|%{our_path}%{_bindir}/%{target_arch}-$binary|d" -i %{_sourcedir}/all-accel.list - echo "%{our_path}%{_bindir}/$binary" >> %{_sourcedir}/all-accel.list + sed -e "\|%{emul_path}%{_bindir}/%{target_arch}-$binary|d" -i %{_sourcedir}/all-accel.list + echo "%{emul_path}%{_bindir}/$binary" >> %{_sourcedir}/all-accel.list done mkdir -p ${buildroot_emul_path}/%{_prefix}/%{target_arch}/bin for binary in ar as ld{,.bfd,.gold} nm obj{copy,dump} ranlib strip; do - ln -sf %{our_path}%{_bindir}/$binary ${buildroot_emul_path}%{_prefix}/%{target_arch}/bin/$binary - echo "%{our_path}%{_bindir}/$binary" >> %{_sourcedir}/all-accel.list - echo "%{our_path}%{_prefix}/%{target_arch}/bin/$binary" >> %{_sourcedir}/all-accel.list + ln -sf %{emul_path}%{_bindir}/$binary ${buildroot_emul_path}%{_prefix}/%{target_arch}/bin/$binary + echo "%{emul_path}%{_bindir}/$binary" >> %{_sourcedir}/all-accel.list + echo "%{emul_path}%{_prefix}/%{target_arch}/bin/$binary" >> %{_sourcedir}/all-accel.list done # create symlinks for python @@ -339,8 +339,8 @@ if [ -z "\$PYTHONPATH" ]; then else export PYTHONPATH+=":%{libdir}/${host_python}" fi -export PYTHONHOME="%{our_path}%{_prefix}" -%{our_path}%{_bindir}/${host_python}-orig "\$@" +export PYTHONHOME="%{emul_path}%{_prefix}" +%{emul_path}%{_bindir}/${host_python}-orig "\$@" EOF chmod +x ${buildroot_emul_path}%{_bindir}/${host_python} @@ -353,7 +353,7 @@ ln -sf %{libdir}/${host_python}/site-packages/SCons ${buildroot_emul_path}%{libd # rpmlint acceleration mkdir -p ${buildroot_emul_path}/opt/testing/bin -ln -s %{our_path}%{_bindir}/${host_python}-orig ${buildroot_emul_path}/opt/testing/bin/ +ln -s %{emul_path}%{_bindir}/${host_python}-orig ${buildroot_emul_path}/opt/testing/bin/ cat > ${buildroot_emul_path}/opt/testing/bin/${host_python} << EOF #!/bin/bash if [ -z "\$PYTHONPATH" ]; then @@ -361,8 +361,8 @@ if [ -z "\$PYTHONPATH" ]; then else export PYTHONPATH+=":%{libdir}/${host_python}" fi -export PYTHONHOME="%{our_path}%{_prefix}" -%{our_path}/opt/testing/bin/${host_python}-orig "\$@" +export PYTHONHOME="%{emul_path}%{_prefix}" +%{emul_path}/opt/testing/bin/${host_python}-orig "\$@" EOF chmod +x ${buildroot_emul_path}/opt/testing/bin/${host_python} ln -s ${host_python} ${buildroot_emul_path}/opt/testing/bin/python @@ -379,10 +379,10 @@ for bin in c++ g++ gcc gfortran cpp gcc-ar gcc-nm gcc-ranlib do mv ${buildroot_emul_path}%{_bindir}/%{target_arch}-$bin ${buildroot_emul_path}%{_bindir}/$bin ln -s $bin ${buildroot_emul_path}%{_bindir}/%{target_arch}-$bin - echo "%{our_path}%{_bindir}/$bin" >> %{_sourcedir}/all-accel.list + echo "%{emul_path}%{_bindir}/$bin" >> %{_sourcedir}/all-accel.list done ln -s gcc ${buildroot_emul_path}/%{_bindir}/cc -echo '%{our_path}%{_bindir}/cc' >> %{_sourcedir}/all-accel.list +echo '%{emul_path}%{_bindir}/cc' >> %{_sourcedir}/all-accel.list # rpmbuild when generating 'requires' tag for gobject-introspection binaries # selects (64-bit) suffix for libs based on ${HOSTTYPE} bash variable @@ -401,21 +401,21 @@ gcc_build_dir=%{_builddir}/gcc-${gcc_version}/obj mkdir -p ${buildroot_emul_path}${gcc_build_dir}/gcc for binary in as cpp gcc-ar gcc-nm gcc-ranlib gcov nm do - ln -sf %{our_path}%{_bindir}/${binary} ${buildroot_emul_path}${gcc_build_dir}/gcc/${binary} - echo "%{our_path}${gcc_build_dir}/gcc/${binary}" >> %{_sourcedir}/all-accel.list + ln -sf %{emul_path}%{_bindir}/${binary} ${buildroot_emul_path}${gcc_build_dir}/gcc/${binary} + echo "%{emul_path}${gcc_build_dir}/gcc/${binary}" >> %{_sourcedir}/all-accel.list done for binary in cc1 cc1plus collect2 lto1 lto-wrapper f951 do - ln -sf %{our_path}${gcc_install_dir}${binary} ${buildroot_emul_path}${gcc_build_dir}/gcc/${binary} - echo "%{our_path}${gcc_build_dir}/gcc/${binary}" >> %{_sourcedir}/all-accel.list + ln -sf %{emul_path}${gcc_install_dir}${binary} ${buildroot_emul_path}${gcc_build_dir}/gcc/${binary} + echo "%{emul_path}${gcc_build_dir}/gcc/${binary}" >> %{_sourcedir}/all-accel.list done -ln -sf %{our_path}%{_bindir}/gcc ${buildroot_emul_path}${gcc_build_dir}/gcc/xgcc -ln -sf %{our_path}%{_bindir}/g++ ${buildroot_emul_path}${gcc_build_dir}/gcc/xg++ -echo "%{our_path}${gcc_build_dir}/gcc/xgcc" >> %{_sourcedir}/all-accel.list -echo "%{our_path}${gcc_build_dir}/gcc/xg++" >> %{_sourcedir}/all-accel.list +ln -sf %{emul_path}%{_bindir}/gcc ${buildroot_emul_path}${gcc_build_dir}/gcc/xgcc +ln -sf %{emul_path}%{_bindir}/g++ ${buildroot_emul_path}${gcc_build_dir}/gcc/xg++ +echo "%{emul_path}${gcc_build_dir}/gcc/xgcc" >> %{_sourcedir}/all-accel.list +echo "%{emul_path}${gcc_build_dir}/gcc/xg++" >> %{_sourcedir}/all-accel.list # support /lib/cpp -ln -sf %{our_path}%{_bindir}/cpp ${buildroot_emul_path}/usr/lib/cpp +ln -sf %{emul_path}%{_bindir}/cpp ${buildroot_emul_path}/usr/lib/cpp # generate baselibs.conf for current architecture to prevent rpm overwriting in download repo echo %{cross} @@ -430,7 +430,7 @@ cat %{_sourcedir}/baselibs_prologue %{_sourcedir}/baselibs_body > %{_sourcedir}/ # By default this is ${gcc_install_dir}/liblto_plugin.so target_liblto_plugin="$(%{target_arch}-gcc -print-file-name=liblto_plugin.so)" # update baselibs.conf, overwrite LTO plugin -sed -i -e "s,#PLUGIN_POSTIN#,if [ -d $(dirname ${target_liblto_plugin}) ]; then\"\n post \" ln -sf %{our_path}${target_liblto_plugin} ${target_liblto_plugin}\"\n post \"fi," %{_sourcedir}/baselibs.conf +sed -i -e "s,#PLUGIN_POSTIN#,if [ -d $(dirname ${target_liblto_plugin}) ]; then\"\n post \" ln -sf %{emul_path}${target_liblto_plugin} ${target_liblto_plugin}\"\n post \"fi," %{_sourcedir}/baselibs.conf sed -i -e "s,#PLUGIN_POSTUN#,ln -sf liblto_plugin.so.0 ${target_liblto_plugin}," %{_sourcedir}/baselibs.conf # Use /usr/lib for cross clang libdir on armv7l architecture @@ -439,42 +439,42 @@ awk '/post "/ && !x {print " post \"echo export\\ CLANG_NO_LIBDIR_SUFFIX=1 >> / } %{?multilib: -awk '/post "/ && !x {print " post \"echo '%{our_path}/lib' >> /etc/ld.so.conf\"\n"; print $0; x=1;next} 1' %{_sourcedir}/baselibs.conf > baselibs_updated && mv baselibs_updated %{_sourcedir}/baselibs.conf +awk '/post "/ && !x {print " post \"echo '%{emul_path}/lib' >> /etc/ld.so.conf\"\n"; print $0; x=1;next} 1' %{_sourcedir}/baselibs.conf > baselibs_updated && mv baselibs_updated %{_sourcedir}/baselibs.conf } # Remove the ld-$VERSION.so to prevent name clashing with native ld.so find ${buildroot_emul_path}%{_libdir} -name 'ld-*.so' -delete -sed -e '\|%{our_path}%{_libdir}/ld-[[:digit:]].*\.so|d' -i %{_sourcedir}/all-accel.list +sed -e '\|%{emul_path}%{_libdir}/ld-[[:digit:]].*\.so|d' -i %{_sourcedir}/all-accel.list # allow build of baselibs.conf sed -e "/targettype %{cross} block!/d" -i %{_sourcedir}/baselibs.conf ## Prepare file lists for packages # Change libdir to handle symlinks right -find . %{_sourcedir} -name '*.list' -exec sed -e 's|%{our_path}/%{_lib}|%{our_path}%{_libdir}|' -i {} \; +find . %{_sourcedir} -name '*.list' -exec sed -e 's|%{emul_path}/%{_lib}|%{emul_path}%{_libdir}|' -i {} \; # Join native and multilib lists cat %{_sourcedir}/all-accel.list %{?multilib:%{_sourcedir}/multilib-accel.list} | sort -u > %{_sourcedir}/qemu-accel.list ## python-accel # Generate list of all python files find %{buildroot} -name '*.py' | sed -e "s|${buildroot_emul_path}||" >> python.list -sed -e 's|^|%{our_path}|;s|%{our_path}/%{_lib}|%{our_path}%{_libdir}|' python.list | sort -u > python-full.list +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 ## clang-accel # Prepare clang files list -sed -e 's|^|%{our_path}|;s|%{our_path}/%{_lib}|%{our_path}%{_libdir}|' clang.list | sort -u > clang-full.list +sed -e 's|^|%{emul_path}|;s|%{emul_path}/%{_lib}|%{emul_path}%{_libdir}|' clang.list | sort -u > clang-full.list # Remove common files from clang-accel comm -13 %{_sourcedir}/qemu-accel.list clang-full.list > %{_sourcedir}/clang-accel.list # Add symlinks to qemu-accel packaging -echo '%{our_path}/bin' >> %{_sourcedir}/qemu-accel.list -echo '%{our_path}/%{_lib}' >> %{_sourcedir}/qemu-accel.list -%{?multilib:echo '%{our_path}/lib' >> %{_sourcedir}/qemu-accel.list} +echo '%{emul_path}/bin' >> %{_sourcedir}/qemu-accel.list +echo '%{emul_path}/%{_lib}' >> %{_sourcedir}/qemu-accel.list +%{?multilib:echo '%{emul_path}/lib' >> %{_sourcedir}/qemu-accel.list} %fdupes %{buildroot} -%filter_provides_in %{our_path} +%filter_provides_in %{emul_path} %post ldconfig @@ -490,7 +490,7 @@ ldconfig %files -f %{_sourcedir}/qemu-accel.list %defattr(-,root,root) -%exclude %{our_path}%{py_libdir}/* +%exclude %{emul_path}%{py_libdir}/* %files -n python-accel -f %{_sourcedir}/python-accel.list %defattr(-,root,root) diff --git a/packaging/qemu-accel-armv7hl.spec b/packaging/qemu-accel-armv7hl.spec index ac54dce..8adb708 100644 --- a/packaging/qemu-accel-armv7hl.spec +++ b/packaging/qemu-accel-armv7hl.spec @@ -32,7 +32,7 @@ } # default path in qemu -%define our_path /emul +%define emul_path /emul Name: qemu-accel Version: 0.4 @@ -128,7 +128,7 @@ gcc_install_dir="$(%{target_arch}-gcc -print-file-name=)" host_python="python$(python --version 2>&1 | sed -ne '1s/.* //p' | head -c 3)" # Emul path inside buildroot for installation -buildroot_emul_path=%{buildroot}%{our_path} +buildroot_emul_path=%{buildroot}%{emul_path} binaries="%{_libdir}/libnsl.so.1 %{_libdir}/libnss_compat.so.2" # loaded via dlopen by glibc %ifarch %ix86 @@ -199,7 +199,7 @@ function prepare_package_list { done ## Store the resulting list for packaging, setting up the right prefix - cat $name.list | sed -e 's|^|%{our_path}|;s| |\n%{our_path}|g' | sort -u > %{_sourcedir}/$name-accel.list + cat $name.list | sed -e 's|^|%{emul_path}|;s| |\n%{emul_path}|g' | sort -u > %{_sourcedir}/$name-accel.list binaries="$binaries $bins" } @@ -245,10 +245,10 @@ function patch_binary { fi rm -f $outfile.data [ "$binary" == "$rtld" ] && return - patchelf --set-rpath "%{our_path}/%{_libdir}" $outfile + patchelf --set-rpath "%{emul_path}/%{_libdir}" $outfile # not all binaries have an .interp section if patchelf --print-interpreter $outfile 1>/dev/null 2>/dev/null; then - patchelf --set-interpreter %{our_path}$rtld $outfile + patchelf --set-interpreter %{emul_path}$rtld $outfile fi } @@ -271,11 +271,11 @@ do fdir=$(dirname $f) [ ! -d ${buildroot_emul_path}/$fdir ] && mkdir -p ${buildroot_emul_path}/$fdir cp -a $f ${buildroot_emul_path}/$f - echo "%{our_path}$f" >> %{_sourcedir}/multilib-accel.list + echo "%{emul_path}$f" >> %{_sourcedir}/multilib-accel.list done # Now we have to change the ld.so name to prevent name clashing in armv7l repos -i686_libdir="%{our_path}/lib" +i686_libdir="%{emul_path}/lib" # 1. Rename the actual ld.so binary cross_ld_so=$(find %{buildroot}${i686_libdir} -name 'ld-*.so' -printf '%f') @@ -284,7 +284,7 @@ mv %{buildroot}${i686_libdir}/${cross_ld_so} %{buildroot}${i686_libdir}/${new_cr sed -e "s|${cross_ld_so}|${new_cross_ld_so}|" -i %{_sourcedir}/multilib-accel.list # 2. Force the symlink to point the right file. -ln -sf %{our_path}/lib/${new_cross_ld_so} %{buildroot}${i686_libdir}/${cross_ld_symlink} +ln -sf %{emul_path}/lib/${new_cross_ld_so} %{buildroot}${i686_libdir}/${cross_ld_symlink} echo "${i686_libdir}/${cross_ld_symlink}" >> %{_sourcedir}/multilib-accel.list # create symlinks for libgcc-32bit @@ -292,7 +292,7 @@ echo "${i686_libdir}/${cross_ld_symlink}" >> %{_sourcedir}/multilib-accel.list for f in $(rpm -ql libgcc-32bit) do filename=$(basename $f) - ln -sf %{our_path}/$f %{buildroot}${i686_libdir}/${filename} + ln -sf %{emul_path}/$f %{buildroot}${i686_libdir}/${filename} echo "${i686_libdir}/${filename}" >> %{_sourcedir}/multilib-accel.list done } @@ -301,33 +301,33 @@ done ln -s usr/bin "${buildroot_emul_path}/bin" echo '%{our_path}/bin' >> %{_sourcedir}/all-accel.list ln -sf bash "${buildroot_emul_path}%{_bindir}sh" -echo '%{our_path}%{_bindir}sh' >> %{_sourcedir}/all-accel.list +echo '%{emul_path}%{_bindir}sh' >> %{_sourcedir}/all-accel.list mv ${buildroot_emul_path}/%{_lib}/* ${buildroot_emul_path}%{_libdir}/ rm -rf ${buildroot_emul_path}/%{_lib} ln -sf usr/%{_lib} ${buildroot_emul_path}/%{_lib} -echo '%{our_path}/%{_lib}' >> %{_sourcedir}/all-accel.list +echo '%{emul_path}/%{_lib}' >> %{_sourcedir}/all-accel.list %{?multilib: mv ${buildroot_emul_path}/lib/* ${buildroot_emul_path}%{_prefix}/lib/ rm -rf ${buildroot_emul_path}/lib ln -sf usr/lib ${buildroot_emul_path}/lib -sed -e 's|%{our_path}/lib|%{our_path}/usr/lib|' -i %{_sourcedir}/multilib-accel.list -echo '%{our_path}/usr/lib' >> %{_sourcedir}/multilib-accel.list +sed -e 's|%{emul_path}/lib|%{emul_path}/usr/lib|' -i %{_sourcedir}/multilib-accel.list +echo '%{emul_path}/usr/lib' >> %{_sourcedir}/multilib-accel.list } # rename binutils binaries for binary in addr2line ar as c++filt dwp elfedit gprof ld ld.bfd ld.gold nm objcopy objdump ranlib readelf size strings strip gcov do mv ${buildroot_emul_path}%{_bindir}/%{target_arch}-$binary ${buildroot_emul_path}%{_bindir}/$binary - sed -e "\|%{our_path}%{_bindir}/%{target_arch}-$binary|d" -i %{_sourcedir}/all-accel.list - echo "%{our_path}%{_bindir}/$binary" >> %{_sourcedir}/all-accel.list + sed -e "\|%{emul_path}%{_bindir}/%{target_arch}-$binary|d" -i %{_sourcedir}/all-accel.list + echo "%{emul_path}%{_bindir}/$binary" >> %{_sourcedir}/all-accel.list done mkdir -p ${buildroot_emul_path}/%{_prefix}/%{target_arch}/bin for binary in ar as ld{,.bfd,.gold} nm obj{copy,dump} ranlib strip; do - ln -sf %{our_path}%{_bindir}/$binary ${buildroot_emul_path}%{_prefix}/%{target_arch}/bin/$binary - echo "%{our_path}%{_bindir}/$binary" >> %{_sourcedir}/all-accel.list - echo "%{our_path}%{_prefix}/%{target_arch}/bin/$binary" >> %{_sourcedir}/all-accel.list + ln -sf %{emul_path}%{_bindir}/$binary ${buildroot_emul_path}%{_prefix}/%{target_arch}/bin/$binary + echo "%{emul_path}%{_bindir}/$binary" >> %{_sourcedir}/all-accel.list + echo "%{emul_path}%{_prefix}/%{target_arch}/bin/$binary" >> %{_sourcedir}/all-accel.list done # create symlinks for python @@ -339,8 +339,8 @@ if [ -z "\$PYTHONPATH" ]; then else export PYTHONPATH+=":%{libdir}/${host_python}" fi -export PYTHONHOME="%{our_path}%{_prefix}" -%{our_path}%{_bindir}/${host_python}-orig "\$@" +export PYTHONHOME="%{emul_path}%{_prefix}" +%{emul_path}%{_bindir}/${host_python}-orig "\$@" EOF chmod +x ${buildroot_emul_path}%{_bindir}/${host_python} @@ -353,7 +353,7 @@ ln -sf %{libdir}/${host_python}/site-packages/SCons ${buildroot_emul_path}%{libd # rpmlint acceleration mkdir -p ${buildroot_emul_path}/opt/testing/bin -ln -s %{our_path}%{_bindir}/${host_python}-orig ${buildroot_emul_path}/opt/testing/bin/ +ln -s %{emul_path}%{_bindir}/${host_python}-orig ${buildroot_emul_path}/opt/testing/bin/ cat > ${buildroot_emul_path}/opt/testing/bin/${host_python} << EOF #!/bin/bash if [ -z "\$PYTHONPATH" ]; then @@ -361,8 +361,8 @@ if [ -z "\$PYTHONPATH" ]; then else export PYTHONPATH+=":%{libdir}/${host_python}" fi -export PYTHONHOME="%{our_path}%{_prefix}" -%{our_path}/opt/testing/bin/${host_python}-orig "\$@" +export PYTHONHOME="%{emul_path}%{_prefix}" +%{emul_path}/opt/testing/bin/${host_python}-orig "\$@" EOF chmod +x ${buildroot_emul_path}/opt/testing/bin/${host_python} ln -s ${host_python} ${buildroot_emul_path}/opt/testing/bin/python @@ -379,10 +379,10 @@ for bin in c++ g++ gcc gfortran cpp gcc-ar gcc-nm gcc-ranlib do mv ${buildroot_emul_path}%{_bindir}/%{target_arch}-$bin ${buildroot_emul_path}%{_bindir}/$bin ln -s $bin ${buildroot_emul_path}%{_bindir}/%{target_arch}-$bin - echo "%{our_path}%{_bindir}/$bin" >> %{_sourcedir}/all-accel.list + echo "%{emul_path}%{_bindir}/$bin" >> %{_sourcedir}/all-accel.list done ln -s gcc ${buildroot_emul_path}/%{_bindir}/cc -echo '%{our_path}%{_bindir}/cc' >> %{_sourcedir}/all-accel.list +echo '%{emul_path}%{_bindir}/cc' >> %{_sourcedir}/all-accel.list # rpmbuild when generating 'requires' tag for gobject-introspection binaries # selects (64-bit) suffix for libs based on ${HOSTTYPE} bash variable @@ -401,21 +401,21 @@ gcc_build_dir=%{_builddir}/gcc-${gcc_version}/obj mkdir -p ${buildroot_emul_path}${gcc_build_dir}/gcc for binary in as cpp gcc-ar gcc-nm gcc-ranlib gcov nm do - ln -sf %{our_path}%{_bindir}/${binary} ${buildroot_emul_path}${gcc_build_dir}/gcc/${binary} - echo "%{our_path}${gcc_build_dir}/gcc/${binary}" >> %{_sourcedir}/all-accel.list + ln -sf %{emul_path}%{_bindir}/${binary} ${buildroot_emul_path}${gcc_build_dir}/gcc/${binary} + echo "%{emul_path}${gcc_build_dir}/gcc/${binary}" >> %{_sourcedir}/all-accel.list done for binary in cc1 cc1plus collect2 lto1 lto-wrapper f951 do - ln -sf %{our_path}${gcc_install_dir}${binary} ${buildroot_emul_path}${gcc_build_dir}/gcc/${binary} - echo "%{our_path}${gcc_build_dir}/gcc/${binary}" >> %{_sourcedir}/all-accel.list + ln -sf %{emul_path}${gcc_install_dir}${binary} ${buildroot_emul_path}${gcc_build_dir}/gcc/${binary} + echo "%{emul_path}${gcc_build_dir}/gcc/${binary}" >> %{_sourcedir}/all-accel.list done -ln -sf %{our_path}%{_bindir}/gcc ${buildroot_emul_path}${gcc_build_dir}/gcc/xgcc -ln -sf %{our_path}%{_bindir}/g++ ${buildroot_emul_path}${gcc_build_dir}/gcc/xg++ -echo "%{our_path}${gcc_build_dir}/gcc/xgcc" >> %{_sourcedir}/all-accel.list -echo "%{our_path}${gcc_build_dir}/gcc/xg++" >> %{_sourcedir}/all-accel.list +ln -sf %{emul_path}%{_bindir}/gcc ${buildroot_emul_path}${gcc_build_dir}/gcc/xgcc +ln -sf %{emul_path}%{_bindir}/g++ ${buildroot_emul_path}${gcc_build_dir}/gcc/xg++ +echo "%{emul_path}${gcc_build_dir}/gcc/xgcc" >> %{_sourcedir}/all-accel.list +echo "%{emul_path}${gcc_build_dir}/gcc/xg++" >> %{_sourcedir}/all-accel.list # support /lib/cpp -ln -sf %{our_path}%{_bindir}/cpp ${buildroot_emul_path}/usr/lib/cpp +ln -sf %{emul_path}%{_bindir}/cpp ${buildroot_emul_path}/usr/lib/cpp # generate baselibs.conf for current architecture to prevent rpm overwriting in download repo echo %{cross} @@ -430,7 +430,7 @@ cat %{_sourcedir}/baselibs_prologue %{_sourcedir}/baselibs_body > %{_sourcedir}/ # By default this is ${gcc_install_dir}/liblto_plugin.so target_liblto_plugin="$(%{target_arch}-gcc -print-file-name=liblto_plugin.so)" # update baselibs.conf, overwrite LTO plugin -sed -i -e "s,#PLUGIN_POSTIN#,if [ -d $(dirname ${target_liblto_plugin}) ]; then\"\n post \" ln -sf %{our_path}${target_liblto_plugin} ${target_liblto_plugin}\"\n post \"fi," %{_sourcedir}/baselibs.conf +sed -i -e "s,#PLUGIN_POSTIN#,if [ -d $(dirname ${target_liblto_plugin}) ]; then\"\n post \" ln -sf %{emul_path}${target_liblto_plugin} ${target_liblto_plugin}\"\n post \"fi," %{_sourcedir}/baselibs.conf sed -i -e "s,#PLUGIN_POSTUN#,ln -sf liblto_plugin.so.0 ${target_liblto_plugin}," %{_sourcedir}/baselibs.conf # Use /usr/lib for cross clang libdir on armv7l architecture @@ -439,42 +439,42 @@ awk '/post "/ && !x {print " post \"echo export\\ CLANG_NO_LIBDIR_SUFFIX=1 >> / } %{?multilib: -awk '/post "/ && !x {print " post \"echo '%{our_path}/lib' >> /etc/ld.so.conf\"\n"; print $0; x=1;next} 1' %{_sourcedir}/baselibs.conf > baselibs_updated && mv baselibs_updated %{_sourcedir}/baselibs.conf +awk '/post "/ && !x {print " post \"echo '%{emul_path}/lib' >> /etc/ld.so.conf\"\n"; print $0; x=1;next} 1' %{_sourcedir}/baselibs.conf > baselibs_updated && mv baselibs_updated %{_sourcedir}/baselibs.conf } # Remove the ld-$VERSION.so to prevent name clashing with native ld.so find ${buildroot_emul_path}%{_libdir} -name 'ld-*.so' -delete -sed -e '\|%{our_path}%{_libdir}/ld-[[:digit:]].*\.so|d' -i %{_sourcedir}/all-accel.list +sed -e '\|%{emul_path}%{_libdir}/ld-[[:digit:]].*\.so|d' -i %{_sourcedir}/all-accel.list # allow build of baselibs.conf sed -e "/targettype %{cross} block!/d" -i %{_sourcedir}/baselibs.conf ## Prepare file lists for packages # Change libdir to handle symlinks right -find . %{_sourcedir} -name '*.list' -exec sed -e 's|%{our_path}/%{_lib}|%{our_path}%{_libdir}|' -i {} \; +find . %{_sourcedir} -name '*.list' -exec sed -e 's|%{emul_path}/%{_lib}|%{emul_path}%{_libdir}|' -i {} \; # Join native and multilib lists cat %{_sourcedir}/all-accel.list %{?multilib:%{_sourcedir}/multilib-accel.list} | sort -u > %{_sourcedir}/qemu-accel.list ## python-accel # Generate list of all python files find %{buildroot} -name '*.py' | sed -e "s|${buildroot_emul_path}||" >> python.list -sed -e 's|^|%{our_path}|;s|%{our_path}/%{_lib}|%{our_path}%{_libdir}|' python.list | sort -u > python-full.list +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 ## clang-accel # Prepare clang files list -sed -e 's|^|%{our_path}|;s|%{our_path}/%{_lib}|%{our_path}%{_libdir}|' clang.list | sort -u > clang-full.list +sed -e 's|^|%{emul_path}|;s|%{emul_path}/%{_lib}|%{emul_path}%{_libdir}|' clang.list | sort -u > clang-full.list # Remove common files from clang-accel comm -13 %{_sourcedir}/qemu-accel.list clang-full.list > %{_sourcedir}/clang-accel.list # Add symlinks to qemu-accel packaging -echo '%{our_path}/bin' >> %{_sourcedir}/qemu-accel.list -echo '%{our_path}/%{_lib}' >> %{_sourcedir}/qemu-accel.list -%{?multilib:echo '%{our_path}/lib' >> %{_sourcedir}/qemu-accel.list} +echo '%{emul_path}/bin' >> %{_sourcedir}/qemu-accel.list +echo '%{emul_path}/%{_lib}' >> %{_sourcedir}/qemu-accel.list +%{?multilib:echo '%{emul_path}/lib' >> %{_sourcedir}/qemu-accel.list} %fdupes %{buildroot} -%filter_provides_in %{our_path} +%filter_provides_in %{emul_path} %post ldconfig @@ -490,7 +490,7 @@ ldconfig %files -f %{_sourcedir}/qemu-accel.list %defattr(-,root,root) -%exclude %{our_path}%{py_libdir}/* +%exclude %{emul_path}%{py_libdir}/* %files -n python-accel -f %{_sourcedir}/python-accel.list %defattr(-,root,root) diff --git a/packaging/qemu-accel-armv7l.spec b/packaging/qemu-accel-armv7l.spec index 67a4b89..6983664 100644 --- a/packaging/qemu-accel-armv7l.spec +++ b/packaging/qemu-accel-armv7l.spec @@ -32,7 +32,7 @@ } # default path in qemu -%define our_path /emul +%define emul_path /emul Name: qemu-accel Version: 0.4 @@ -128,7 +128,7 @@ gcc_install_dir="$(%{target_arch}-gcc -print-file-name=)" host_python="python$(python --version 2>&1 | sed -ne '1s/.* //p' | head -c 3)" # Emul path inside buildroot for installation -buildroot_emul_path=%{buildroot}%{our_path} +buildroot_emul_path=%{buildroot}%{emul_path} binaries="%{_libdir}/libnsl.so.1 %{_libdir}/libnss_compat.so.2" # loaded via dlopen by glibc %ifarch %ix86 @@ -199,7 +199,7 @@ function prepare_package_list { done ## Store the resulting list for packaging, setting up the right prefix - cat $name.list | sed -e 's|^|%{our_path}|;s| |\n%{our_path}|g' | sort -u > %{_sourcedir}/$name-accel.list + cat $name.list | sed -e 's|^|%{emul_path}|;s| |\n%{emul_path}|g' | sort -u > %{_sourcedir}/$name-accel.list binaries="$binaries $bins" } @@ -245,10 +245,10 @@ function patch_binary { fi rm -f $outfile.data [ "$binary" == "$rtld" ] && return - patchelf --set-rpath "%{our_path}/%{_libdir}" $outfile + patchelf --set-rpath "%{emul_path}/%{_libdir}" $outfile # not all binaries have an .interp section if patchelf --print-interpreter $outfile 1>/dev/null 2>/dev/null; then - patchelf --set-interpreter %{our_path}$rtld $outfile + patchelf --set-interpreter %{emul_path}$rtld $outfile fi } @@ -271,11 +271,11 @@ do fdir=$(dirname $f) [ ! -d ${buildroot_emul_path}/$fdir ] && mkdir -p ${buildroot_emul_path}/$fdir cp -a $f ${buildroot_emul_path}/$f - echo "%{our_path}$f" >> %{_sourcedir}/multilib-accel.list + echo "%{emul_path}$f" >> %{_sourcedir}/multilib-accel.list done # Now we have to change the ld.so name to prevent name clashing in armv7l repos -i686_libdir="%{our_path}/lib" +i686_libdir="%{emul_path}/lib" # 1. Rename the actual ld.so binary cross_ld_so=$(find %{buildroot}${i686_libdir} -name 'ld-*.so' -printf '%f') @@ -284,7 +284,7 @@ mv %{buildroot}${i686_libdir}/${cross_ld_so} %{buildroot}${i686_libdir}/${new_cr sed -e "s|${cross_ld_so}|${new_cross_ld_so}|" -i %{_sourcedir}/multilib-accel.list # 2. Force the symlink to point the right file. -ln -sf %{our_path}/lib/${new_cross_ld_so} %{buildroot}${i686_libdir}/${cross_ld_symlink} +ln -sf %{emul_path}/lib/${new_cross_ld_so} %{buildroot}${i686_libdir}/${cross_ld_symlink} echo "${i686_libdir}/${cross_ld_symlink}" >> %{_sourcedir}/multilib-accel.list # create symlinks for libgcc-32bit @@ -292,7 +292,7 @@ echo "${i686_libdir}/${cross_ld_symlink}" >> %{_sourcedir}/multilib-accel.list for f in $(rpm -ql libgcc-32bit) do filename=$(basename $f) - ln -sf %{our_path}/$f %{buildroot}${i686_libdir}/${filename} + ln -sf %{emul_path}/$f %{buildroot}${i686_libdir}/${filename} echo "${i686_libdir}/${filename}" >> %{_sourcedir}/multilib-accel.list done } @@ -301,33 +301,33 @@ done ln -s usr/bin "${buildroot_emul_path}/bin" echo '%{our_path}/bin' >> %{_sourcedir}/all-accel.list ln -sf bash "${buildroot_emul_path}%{_bindir}sh" -echo '%{our_path}%{_bindir}sh' >> %{_sourcedir}/all-accel.list +echo '%{emul_path}%{_bindir}sh' >> %{_sourcedir}/all-accel.list mv ${buildroot_emul_path}/%{_lib}/* ${buildroot_emul_path}%{_libdir}/ rm -rf ${buildroot_emul_path}/%{_lib} ln -sf usr/%{_lib} ${buildroot_emul_path}/%{_lib} -echo '%{our_path}/%{_lib}' >> %{_sourcedir}/all-accel.list +echo '%{emul_path}/%{_lib}' >> %{_sourcedir}/all-accel.list %{?multilib: mv ${buildroot_emul_path}/lib/* ${buildroot_emul_path}%{_prefix}/lib/ rm -rf ${buildroot_emul_path}/lib ln -sf usr/lib ${buildroot_emul_path}/lib -sed -e 's|%{our_path}/lib|%{our_path}/usr/lib|' -i %{_sourcedir}/multilib-accel.list -echo '%{our_path}/usr/lib' >> %{_sourcedir}/multilib-accel.list +sed -e 's|%{emul_path}/lib|%{emul_path}/usr/lib|' -i %{_sourcedir}/multilib-accel.list +echo '%{emul_path}/usr/lib' >> %{_sourcedir}/multilib-accel.list } # rename binutils binaries for binary in addr2line ar as c++filt dwp elfedit gprof ld ld.bfd ld.gold nm objcopy objdump ranlib readelf size strings strip gcov do mv ${buildroot_emul_path}%{_bindir}/%{target_arch}-$binary ${buildroot_emul_path}%{_bindir}/$binary - sed -e "\|%{our_path}%{_bindir}/%{target_arch}-$binary|d" -i %{_sourcedir}/all-accel.list - echo "%{our_path}%{_bindir}/$binary" >> %{_sourcedir}/all-accel.list + sed -e "\|%{emul_path}%{_bindir}/%{target_arch}-$binary|d" -i %{_sourcedir}/all-accel.list + echo "%{emul_path}%{_bindir}/$binary" >> %{_sourcedir}/all-accel.list done mkdir -p ${buildroot_emul_path}/%{_prefix}/%{target_arch}/bin for binary in ar as ld{,.bfd,.gold} nm obj{copy,dump} ranlib strip; do - ln -sf %{our_path}%{_bindir}/$binary ${buildroot_emul_path}%{_prefix}/%{target_arch}/bin/$binary - echo "%{our_path}%{_bindir}/$binary" >> %{_sourcedir}/all-accel.list - echo "%{our_path}%{_prefix}/%{target_arch}/bin/$binary" >> %{_sourcedir}/all-accel.list + ln -sf %{emul_path}%{_bindir}/$binary ${buildroot_emul_path}%{_prefix}/%{target_arch}/bin/$binary + echo "%{emul_path}%{_bindir}/$binary" >> %{_sourcedir}/all-accel.list + echo "%{emul_path}%{_prefix}/%{target_arch}/bin/$binary" >> %{_sourcedir}/all-accel.list done # create symlinks for python @@ -339,8 +339,8 @@ if [ -z "\$PYTHONPATH" ]; then else export PYTHONPATH+=":%{libdir}/${host_python}" fi -export PYTHONHOME="%{our_path}%{_prefix}" -%{our_path}%{_bindir}/${host_python}-orig "\$@" +export PYTHONHOME="%{emul_path}%{_prefix}" +%{emul_path}%{_bindir}/${host_python}-orig "\$@" EOF chmod +x ${buildroot_emul_path}%{_bindir}/${host_python} @@ -353,7 +353,7 @@ ln -sf %{libdir}/${host_python}/site-packages/SCons ${buildroot_emul_path}%{libd # rpmlint acceleration mkdir -p ${buildroot_emul_path}/opt/testing/bin -ln -s %{our_path}%{_bindir}/${host_python}-orig ${buildroot_emul_path}/opt/testing/bin/ +ln -s %{emul_path}%{_bindir}/${host_python}-orig ${buildroot_emul_path}/opt/testing/bin/ cat > ${buildroot_emul_path}/opt/testing/bin/${host_python} << EOF #!/bin/bash if [ -z "\$PYTHONPATH" ]; then @@ -361,8 +361,8 @@ if [ -z "\$PYTHONPATH" ]; then else export PYTHONPATH+=":%{libdir}/${host_python}" fi -export PYTHONHOME="%{our_path}%{_prefix}" -%{our_path}/opt/testing/bin/${host_python}-orig "\$@" +export PYTHONHOME="%{emul_path}%{_prefix}" +%{emul_path}/opt/testing/bin/${host_python}-orig "\$@" EOF chmod +x ${buildroot_emul_path}/opt/testing/bin/${host_python} ln -s ${host_python} ${buildroot_emul_path}/opt/testing/bin/python @@ -379,10 +379,10 @@ for bin in c++ g++ gcc gfortran cpp gcc-ar gcc-nm gcc-ranlib do mv ${buildroot_emul_path}%{_bindir}/%{target_arch}-$bin ${buildroot_emul_path}%{_bindir}/$bin ln -s $bin ${buildroot_emul_path}%{_bindir}/%{target_arch}-$bin - echo "%{our_path}%{_bindir}/$bin" >> %{_sourcedir}/all-accel.list + echo "%{emul_path}%{_bindir}/$bin" >> %{_sourcedir}/all-accel.list done ln -s gcc ${buildroot_emul_path}/%{_bindir}/cc -echo '%{our_path}%{_bindir}/cc' >> %{_sourcedir}/all-accel.list +echo '%{emul_path}%{_bindir}/cc' >> %{_sourcedir}/all-accel.list # rpmbuild when generating 'requires' tag for gobject-introspection binaries # selects (64-bit) suffix for libs based on ${HOSTTYPE} bash variable @@ -401,21 +401,21 @@ gcc_build_dir=%{_builddir}/gcc-${gcc_version}/obj mkdir -p ${buildroot_emul_path}${gcc_build_dir}/gcc for binary in as cpp gcc-ar gcc-nm gcc-ranlib gcov nm do - ln -sf %{our_path}%{_bindir}/${binary} ${buildroot_emul_path}${gcc_build_dir}/gcc/${binary} - echo "%{our_path}${gcc_build_dir}/gcc/${binary}" >> %{_sourcedir}/all-accel.list + ln -sf %{emul_path}%{_bindir}/${binary} ${buildroot_emul_path}${gcc_build_dir}/gcc/${binary} + echo "%{emul_path}${gcc_build_dir}/gcc/${binary}" >> %{_sourcedir}/all-accel.list done for binary in cc1 cc1plus collect2 lto1 lto-wrapper f951 do - ln -sf %{our_path}${gcc_install_dir}${binary} ${buildroot_emul_path}${gcc_build_dir}/gcc/${binary} - echo "%{our_path}${gcc_build_dir}/gcc/${binary}" >> %{_sourcedir}/all-accel.list + ln -sf %{emul_path}${gcc_install_dir}${binary} ${buildroot_emul_path}${gcc_build_dir}/gcc/${binary} + echo "%{emul_path}${gcc_build_dir}/gcc/${binary}" >> %{_sourcedir}/all-accel.list done -ln -sf %{our_path}%{_bindir}/gcc ${buildroot_emul_path}${gcc_build_dir}/gcc/xgcc -ln -sf %{our_path}%{_bindir}/g++ ${buildroot_emul_path}${gcc_build_dir}/gcc/xg++ -echo "%{our_path}${gcc_build_dir}/gcc/xgcc" >> %{_sourcedir}/all-accel.list -echo "%{our_path}${gcc_build_dir}/gcc/xg++" >> %{_sourcedir}/all-accel.list +ln -sf %{emul_path}%{_bindir}/gcc ${buildroot_emul_path}${gcc_build_dir}/gcc/xgcc +ln -sf %{emul_path}%{_bindir}/g++ ${buildroot_emul_path}${gcc_build_dir}/gcc/xg++ +echo "%{emul_path}${gcc_build_dir}/gcc/xgcc" >> %{_sourcedir}/all-accel.list +echo "%{emul_path}${gcc_build_dir}/gcc/xg++" >> %{_sourcedir}/all-accel.list # support /lib/cpp -ln -sf %{our_path}%{_bindir}/cpp ${buildroot_emul_path}/usr/lib/cpp +ln -sf %{emul_path}%{_bindir}/cpp ${buildroot_emul_path}/usr/lib/cpp # generate baselibs.conf for current architecture to prevent rpm overwriting in download repo echo %{cross} @@ -430,7 +430,7 @@ cat %{_sourcedir}/baselibs_prologue %{_sourcedir}/baselibs_body > %{_sourcedir}/ # By default this is ${gcc_install_dir}/liblto_plugin.so target_liblto_plugin="$(%{target_arch}-gcc -print-file-name=liblto_plugin.so)" # update baselibs.conf, overwrite LTO plugin -sed -i -e "s,#PLUGIN_POSTIN#,if [ -d $(dirname ${target_liblto_plugin}) ]; then\"\n post \" ln -sf %{our_path}${target_liblto_plugin} ${target_liblto_plugin}\"\n post \"fi," %{_sourcedir}/baselibs.conf +sed -i -e "s,#PLUGIN_POSTIN#,if [ -d $(dirname ${target_liblto_plugin}) ]; then\"\n post \" ln -sf %{emul_path}${target_liblto_plugin} ${target_liblto_plugin}\"\n post \"fi," %{_sourcedir}/baselibs.conf sed -i -e "s,#PLUGIN_POSTUN#,ln -sf liblto_plugin.so.0 ${target_liblto_plugin}," %{_sourcedir}/baselibs.conf # Use /usr/lib for cross clang libdir on armv7l architecture @@ -439,42 +439,42 @@ awk '/post "/ && !x {print " post \"echo export\\ CLANG_NO_LIBDIR_SUFFIX=1 >> / } %{?multilib: -awk '/post "/ && !x {print " post \"echo '%{our_path}/lib' >> /etc/ld.so.conf\"\n"; print $0; x=1;next} 1' %{_sourcedir}/baselibs.conf > baselibs_updated && mv baselibs_updated %{_sourcedir}/baselibs.conf +awk '/post "/ && !x {print " post \"echo '%{emul_path}/lib' >> /etc/ld.so.conf\"\n"; print $0; x=1;next} 1' %{_sourcedir}/baselibs.conf > baselibs_updated && mv baselibs_updated %{_sourcedir}/baselibs.conf } # Remove the ld-$VERSION.so to prevent name clashing with native ld.so find ${buildroot_emul_path}%{_libdir} -name 'ld-*.so' -delete -sed -e '\|%{our_path}%{_libdir}/ld-[[:digit:]].*\.so|d' -i %{_sourcedir}/all-accel.list +sed -e '\|%{emul_path}%{_libdir}/ld-[[:digit:]].*\.so|d' -i %{_sourcedir}/all-accel.list # allow build of baselibs.conf sed -e "/targettype %{cross} block!/d" -i %{_sourcedir}/baselibs.conf ## Prepare file lists for packages # Change libdir to handle symlinks right -find . %{_sourcedir} -name '*.list' -exec sed -e 's|%{our_path}/%{_lib}|%{our_path}%{_libdir}|' -i {} \; +find . %{_sourcedir} -name '*.list' -exec sed -e 's|%{emul_path}/%{_lib}|%{emul_path}%{_libdir}|' -i {} \; # Join native and multilib lists cat %{_sourcedir}/all-accel.list %{?multilib:%{_sourcedir}/multilib-accel.list} | sort -u > %{_sourcedir}/qemu-accel.list ## python-accel # Generate list of all python files find %{buildroot} -name '*.py' | sed -e "s|${buildroot_emul_path}||" >> python.list -sed -e 's|^|%{our_path}|;s|%{our_path}/%{_lib}|%{our_path}%{_libdir}|' python.list | sort -u > python-full.list +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 ## clang-accel # Prepare clang files list -sed -e 's|^|%{our_path}|;s|%{our_path}/%{_lib}|%{our_path}%{_libdir}|' clang.list | sort -u > clang-full.list +sed -e 's|^|%{emul_path}|;s|%{emul_path}/%{_lib}|%{emul_path}%{_libdir}|' clang.list | sort -u > clang-full.list # Remove common files from clang-accel comm -13 %{_sourcedir}/qemu-accel.list clang-full.list > %{_sourcedir}/clang-accel.list # Add symlinks to qemu-accel packaging -echo '%{our_path}/bin' >> %{_sourcedir}/qemu-accel.list -echo '%{our_path}/%{_lib}' >> %{_sourcedir}/qemu-accel.list -%{?multilib:echo '%{our_path}/lib' >> %{_sourcedir}/qemu-accel.list} +echo '%{emul_path}/bin' >> %{_sourcedir}/qemu-accel.list +echo '%{emul_path}/%{_lib}' >> %{_sourcedir}/qemu-accel.list +%{?multilib:echo '%{emul_path}/lib' >> %{_sourcedir}/qemu-accel.list} %fdupes %{buildroot} -%filter_provides_in %{our_path} +%filter_provides_in %{emul_path} %post ldconfig @@ -490,7 +490,7 @@ ldconfig %files -f %{_sourcedir}/qemu-accel.list %defattr(-,root,root) -%exclude %{our_path}%{py_libdir}/* +%exclude %{emul_path}%{py_libdir}/* %files -n python-accel -f %{_sourcedir}/python-accel.list %defattr(-,root,root) diff --git a/packaging/qemu-accel.spec.in b/packaging/qemu-accel.spec.in index 9c94ac1..3a7b43c 100644 --- a/packaging/qemu-accel.spec.in +++ b/packaging/qemu-accel.spec.in @@ -29,7 +29,7 @@ } # default path in qemu -%define our_path /emul +%define emul_path /emul Name: qemu-accel Version: 0.4 @@ -125,7 +125,7 @@ gcc_install_dir="$(%{target_arch}-gcc -print-file-name=)" host_python="python$(python --version 2>&1 | sed -ne '1s/.* //p' | head -c 3)" # Emul path inside buildroot for installation -buildroot_emul_path=%{buildroot}%{our_path} +buildroot_emul_path=%{buildroot}%{emul_path} binaries="%{_libdir}/libnsl.so.1 %{_libdir}/libnss_compat.so.2" # loaded via dlopen by glibc %ifarch %ix86 @@ -196,7 +196,7 @@ function prepare_package_list { done ## Store the resulting list for packaging, setting up the right prefix - cat $name.list | sed -e 's|^|%{our_path}|;s| |\n%{our_path}|g' | sort -u > %{_sourcedir}/$name-accel.list + cat $name.list | sed -e 's|^|%{emul_path}|;s| |\n%{emul_path}|g' | sort -u > %{_sourcedir}/$name-accel.list binaries="$binaries $bins" } @@ -242,10 +242,10 @@ function patch_binary { fi rm -f $outfile.data [ "$binary" == "$rtld" ] && return - patchelf --set-rpath "%{our_path}/%{_libdir}" $outfile + patchelf --set-rpath "%{emul_path}/%{_libdir}" $outfile # not all binaries have an .interp section if patchelf --print-interpreter $outfile 1>/dev/null 2>/dev/null; then - patchelf --set-interpreter %{our_path}$rtld $outfile + patchelf --set-interpreter %{emul_path}$rtld $outfile fi } @@ -268,11 +268,11 @@ do fdir=$(dirname $f) [ ! -d ${buildroot_emul_path}/$fdir ] && mkdir -p ${buildroot_emul_path}/$fdir cp -a $f ${buildroot_emul_path}/$f - echo "%{our_path}$f" >> %{_sourcedir}/multilib-accel.list + echo "%{emul_path}$f" >> %{_sourcedir}/multilib-accel.list done # Now we have to change the ld.so name to prevent name clashing in armv7l repos -i686_libdir="%{our_path}/lib" +i686_libdir="%{emul_path}/lib" # 1. Rename the actual ld.so binary cross_ld_so=$(find %{buildroot}${i686_libdir} -name 'ld-*.so' -printf '%f') @@ -281,7 +281,7 @@ mv %{buildroot}${i686_libdir}/${cross_ld_so} %{buildroot}${i686_libdir}/${new_cr sed -e "s|${cross_ld_so}|${new_cross_ld_so}|" -i %{_sourcedir}/multilib-accel.list # 2. Force the symlink to point the right file. -ln -sf %{our_path}/lib/${new_cross_ld_so} %{buildroot}${i686_libdir}/${cross_ld_symlink} +ln -sf %{emul_path}/lib/${new_cross_ld_so} %{buildroot}${i686_libdir}/${cross_ld_symlink} echo "${i686_libdir}/${cross_ld_symlink}" >> %{_sourcedir}/multilib-accel.list # create symlinks for libgcc-32bit @@ -289,7 +289,7 @@ echo "${i686_libdir}/${cross_ld_symlink}" >> %{_sourcedir}/multilib-accel.list for f in $(rpm -ql libgcc-32bit) do filename=$(basename $f) - ln -sf %{our_path}/$f %{buildroot}${i686_libdir}/${filename} + ln -sf %{emul_path}/$f %{buildroot}${i686_libdir}/${filename} echo "${i686_libdir}/${filename}" >> %{_sourcedir}/multilib-accel.list done } @@ -298,33 +298,33 @@ done ln -s usr/bin "${buildroot_emul_path}/bin" echo '%{our_path}/bin' >> %{_sourcedir}/all-accel.list ln -sf bash "${buildroot_emul_path}%{_bindir}sh" -echo '%{our_path}%{_bindir}sh' >> %{_sourcedir}/all-accel.list +echo '%{emul_path}%{_bindir}sh' >> %{_sourcedir}/all-accel.list mv ${buildroot_emul_path}/%{_lib}/* ${buildroot_emul_path}%{_libdir}/ rm -rf ${buildroot_emul_path}/%{_lib} ln -sf usr/%{_lib} ${buildroot_emul_path}/%{_lib} -echo '%{our_path}/%{_lib}' >> %{_sourcedir}/all-accel.list +echo '%{emul_path}/%{_lib}' >> %{_sourcedir}/all-accel.list %{?multilib: mv ${buildroot_emul_path}/lib/* ${buildroot_emul_path}%{_prefix}/lib/ rm -rf ${buildroot_emul_path}/lib ln -sf usr/lib ${buildroot_emul_path}/lib -sed -e 's|%{our_path}/lib|%{our_path}/usr/lib|' -i %{_sourcedir}/multilib-accel.list -echo '%{our_path}/usr/lib' >> %{_sourcedir}/multilib-accel.list +sed -e 's|%{emul_path}/lib|%{emul_path}/usr/lib|' -i %{_sourcedir}/multilib-accel.list +echo '%{emul_path}/usr/lib' >> %{_sourcedir}/multilib-accel.list } # rename binutils binaries for binary in addr2line ar as c++filt dwp elfedit gprof ld ld.bfd ld.gold nm objcopy objdump ranlib readelf size strings strip gcov do mv ${buildroot_emul_path}%{_bindir}/%{target_arch}-$binary ${buildroot_emul_path}%{_bindir}/$binary - sed -e "\|%{our_path}%{_bindir}/%{target_arch}-$binary|d" -i %{_sourcedir}/all-accel.list - echo "%{our_path}%{_bindir}/$binary" >> %{_sourcedir}/all-accel.list + sed -e "\|%{emul_path}%{_bindir}/%{target_arch}-$binary|d" -i %{_sourcedir}/all-accel.list + echo "%{emul_path}%{_bindir}/$binary" >> %{_sourcedir}/all-accel.list done mkdir -p ${buildroot_emul_path}/%{_prefix}/%{target_arch}/bin for binary in ar as ld{,.bfd,.gold} nm obj{copy,dump} ranlib strip; do - ln -sf %{our_path}%{_bindir}/$binary ${buildroot_emul_path}%{_prefix}/%{target_arch}/bin/$binary - echo "%{our_path}%{_bindir}/$binary" >> %{_sourcedir}/all-accel.list - echo "%{our_path}%{_prefix}/%{target_arch}/bin/$binary" >> %{_sourcedir}/all-accel.list + ln -sf %{emul_path}%{_bindir}/$binary ${buildroot_emul_path}%{_prefix}/%{target_arch}/bin/$binary + echo "%{emul_path}%{_bindir}/$binary" >> %{_sourcedir}/all-accel.list + echo "%{emul_path}%{_prefix}/%{target_arch}/bin/$binary" >> %{_sourcedir}/all-accel.list done # create symlinks for python @@ -336,8 +336,8 @@ if [ -z "\$PYTHONPATH" ]; then else export PYTHONPATH+=":%{libdir}/${host_python}" fi -export PYTHONHOME="%{our_path}%{_prefix}" -%{our_path}%{_bindir}/${host_python}-orig "\$@" +export PYTHONHOME="%{emul_path}%{_prefix}" +%{emul_path}%{_bindir}/${host_python}-orig "\$@" EOF chmod +x ${buildroot_emul_path}%{_bindir}/${host_python} @@ -350,7 +350,7 @@ ln -sf %{libdir}/${host_python}/site-packages/SCons ${buildroot_emul_path}%{libd # rpmlint acceleration mkdir -p ${buildroot_emul_path}/opt/testing/bin -ln -s %{our_path}%{_bindir}/${host_python}-orig ${buildroot_emul_path}/opt/testing/bin/ +ln -s %{emul_path}%{_bindir}/${host_python}-orig ${buildroot_emul_path}/opt/testing/bin/ cat > ${buildroot_emul_path}/opt/testing/bin/${host_python} << EOF #!/bin/bash if [ -z "\$PYTHONPATH" ]; then @@ -358,8 +358,8 @@ if [ -z "\$PYTHONPATH" ]; then else export PYTHONPATH+=":%{libdir}/${host_python}" fi -export PYTHONHOME="%{our_path}%{_prefix}" -%{our_path}/opt/testing/bin/${host_python}-orig "\$@" +export PYTHONHOME="%{emul_path}%{_prefix}" +%{emul_path}/opt/testing/bin/${host_python}-orig "\$@" EOF chmod +x ${buildroot_emul_path}/opt/testing/bin/${host_python} ln -s ${host_python} ${buildroot_emul_path}/opt/testing/bin/python @@ -376,10 +376,10 @@ for bin in c++ g++ gcc gfortran cpp gcc-ar gcc-nm gcc-ranlib do mv ${buildroot_emul_path}%{_bindir}/%{target_arch}-$bin ${buildroot_emul_path}%{_bindir}/$bin ln -s $bin ${buildroot_emul_path}%{_bindir}/%{target_arch}-$bin - echo "%{our_path}%{_bindir}/$bin" >> %{_sourcedir}/all-accel.list + echo "%{emul_path}%{_bindir}/$bin" >> %{_sourcedir}/all-accel.list done ln -s gcc ${buildroot_emul_path}/%{_bindir}/cc -echo '%{our_path}%{_bindir}/cc' >> %{_sourcedir}/all-accel.list +echo '%{emul_path}%{_bindir}/cc' >> %{_sourcedir}/all-accel.list # rpmbuild when generating 'requires' tag for gobject-introspection binaries # selects (64-bit) suffix for libs based on ${HOSTTYPE} bash variable @@ -398,21 +398,21 @@ gcc_build_dir=%{_builddir}/gcc-${gcc_version}/obj mkdir -p ${buildroot_emul_path}${gcc_build_dir}/gcc for binary in as cpp gcc-ar gcc-nm gcc-ranlib gcov nm do - ln -sf %{our_path}%{_bindir}/${binary} ${buildroot_emul_path}${gcc_build_dir}/gcc/${binary} - echo "%{our_path}${gcc_build_dir}/gcc/${binary}" >> %{_sourcedir}/all-accel.list + ln -sf %{emul_path}%{_bindir}/${binary} ${buildroot_emul_path}${gcc_build_dir}/gcc/${binary} + echo "%{emul_path}${gcc_build_dir}/gcc/${binary}" >> %{_sourcedir}/all-accel.list done for binary in cc1 cc1plus collect2 lto1 lto-wrapper f951 do - ln -sf %{our_path}${gcc_install_dir}${binary} ${buildroot_emul_path}${gcc_build_dir}/gcc/${binary} - echo "%{our_path}${gcc_build_dir}/gcc/${binary}" >> %{_sourcedir}/all-accel.list + ln -sf %{emul_path}${gcc_install_dir}${binary} ${buildroot_emul_path}${gcc_build_dir}/gcc/${binary} + echo "%{emul_path}${gcc_build_dir}/gcc/${binary}" >> %{_sourcedir}/all-accel.list done -ln -sf %{our_path}%{_bindir}/gcc ${buildroot_emul_path}${gcc_build_dir}/gcc/xgcc -ln -sf %{our_path}%{_bindir}/g++ ${buildroot_emul_path}${gcc_build_dir}/gcc/xg++ -echo "%{our_path}${gcc_build_dir}/gcc/xgcc" >> %{_sourcedir}/all-accel.list -echo "%{our_path}${gcc_build_dir}/gcc/xg++" >> %{_sourcedir}/all-accel.list +ln -sf %{emul_path}%{_bindir}/gcc ${buildroot_emul_path}${gcc_build_dir}/gcc/xgcc +ln -sf %{emul_path}%{_bindir}/g++ ${buildroot_emul_path}${gcc_build_dir}/gcc/xg++ +echo "%{emul_path}${gcc_build_dir}/gcc/xgcc" >> %{_sourcedir}/all-accel.list +echo "%{emul_path}${gcc_build_dir}/gcc/xg++" >> %{_sourcedir}/all-accel.list # support /lib/cpp -ln -sf %{our_path}%{_bindir}/cpp ${buildroot_emul_path}/usr/lib/cpp +ln -sf %{emul_path}%{_bindir}/cpp ${buildroot_emul_path}/usr/lib/cpp # generate baselibs.conf for current architecture to prevent rpm overwriting in download repo echo %{cross} @@ -427,7 +427,7 @@ cat %{_sourcedir}/baselibs_prologue %{_sourcedir}/baselibs_body > %{_sourcedir}/ # By default this is ${gcc_install_dir}/liblto_plugin.so target_liblto_plugin="$(%{target_arch}-gcc -print-file-name=liblto_plugin.so)" # update baselibs.conf, overwrite LTO plugin -sed -i -e "s,#PLUGIN_POSTIN#,if [ -d $(dirname ${target_liblto_plugin}) ]; then\"\n post \" ln -sf %{our_path}${target_liblto_plugin} ${target_liblto_plugin}\"\n post \"fi," %{_sourcedir}/baselibs.conf +sed -i -e "s,#PLUGIN_POSTIN#,if [ -d $(dirname ${target_liblto_plugin}) ]; then\"\n post \" ln -sf %{emul_path}${target_liblto_plugin} ${target_liblto_plugin}\"\n post \"fi," %{_sourcedir}/baselibs.conf sed -i -e "s,#PLUGIN_POSTUN#,ln -sf liblto_plugin.so.0 ${target_liblto_plugin}," %{_sourcedir}/baselibs.conf # Use /usr/lib for cross clang libdir on armv7l architecture @@ -436,42 +436,42 @@ awk '/post "/ && !x {print " post \"echo export\\ CLANG_NO_LIBDIR_SUFFIX=1 >> / } %{?multilib: -awk '/post "/ && !x {print " post \"echo '%{our_path}/lib' >> /etc/ld.so.conf\"\n"; print $0; x=1;next} 1' %{_sourcedir}/baselibs.conf > baselibs_updated && mv baselibs_updated %{_sourcedir}/baselibs.conf +awk '/post "/ && !x {print " post \"echo '%{emul_path}/lib' >> /etc/ld.so.conf\"\n"; print $0; x=1;next} 1' %{_sourcedir}/baselibs.conf > baselibs_updated && mv baselibs_updated %{_sourcedir}/baselibs.conf } # Remove the ld-$VERSION.so to prevent name clashing with native ld.so find ${buildroot_emul_path}%{_libdir} -name 'ld-*.so' -delete -sed -e '\|%{our_path}%{_libdir}/ld-[[:digit:]].*\.so|d' -i %{_sourcedir}/all-accel.list +sed -e '\|%{emul_path}%{_libdir}/ld-[[:digit:]].*\.so|d' -i %{_sourcedir}/all-accel.list # allow build of baselibs.conf sed -e "/targettype %{cross} block!/d" -i %{_sourcedir}/baselibs.conf ## Prepare file lists for packages # Change libdir to handle symlinks right -find . %{_sourcedir} -name '*.list' -exec sed -e 's|%{our_path}/%{_lib}|%{our_path}%{_libdir}|' -i {} \; +find . %{_sourcedir} -name '*.list' -exec sed -e 's|%{emul_path}/%{_lib}|%{emul_path}%{_libdir}|' -i {} \; # Join native and multilib lists cat %{_sourcedir}/all-accel.list %{?multilib:%{_sourcedir}/multilib-accel.list} | sort -u > %{_sourcedir}/qemu-accel.list ## python-accel # Generate list of all python files find %{buildroot} -name '*.py' | sed -e "s|${buildroot_emul_path}||" >> python.list -sed -e 's|^|%{our_path}|;s|%{our_path}/%{_lib}|%{our_path}%{_libdir}|' python.list | sort -u > python-full.list +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 ## clang-accel # Prepare clang files list -sed -e 's|^|%{our_path}|;s|%{our_path}/%{_lib}|%{our_path}%{_libdir}|' clang.list | sort -u > clang-full.list +sed -e 's|^|%{emul_path}|;s|%{emul_path}/%{_lib}|%{emul_path}%{_libdir}|' clang.list | sort -u > clang-full.list # Remove common files from clang-accel comm -13 %{_sourcedir}/qemu-accel.list clang-full.list > %{_sourcedir}/clang-accel.list # Add symlinks to qemu-accel packaging -echo '%{our_path}/bin' >> %{_sourcedir}/qemu-accel.list -echo '%{our_path}/%{_lib}' >> %{_sourcedir}/qemu-accel.list -%{?multilib:echo '%{our_path}/lib' >> %{_sourcedir}/qemu-accel.list} +echo '%{emul_path}/bin' >> %{_sourcedir}/qemu-accel.list +echo '%{emul_path}/%{_lib}' >> %{_sourcedir}/qemu-accel.list +%{?multilib:echo '%{emul_path}/lib' >> %{_sourcedir}/qemu-accel.list} %fdupes %{buildroot} -%filter_provides_in %{our_path} +%filter_provides_in %{emul_path} %post ldconfig @@ -487,7 +487,7 @@ ldconfig %files -f %{_sourcedir}/qemu-accel.list %defattr(-,root,root) -%exclude %{our_path}%{py_libdir}/* +%exclude %{emul_path}%{py_libdir}/* %files -n python-accel -f %{_sourcedir}/python-accel.list %defattr(-,root,root) -- cgit v1.2.3