# just like it is determided in python.spec
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}
+
binaries="%{_libdir}/libnsl.so.1 %{_libdir}/libnss_compat.so.2" # loaded via dlopen by glibc
%ifarch %ix86
LD="/%{_lib}/ld-linux.so.2"
local filetype=`file --brief $binary`
[[ x"$filetype" == x"POSIX shell script"* ]] && return
- local outfile=%{buildroot}%{our_path}$binary
+ local outfile=${buildroot_emul_path}$binary
[[ ! -e $binary ]] && echo "WARNING: File '${binary}' not found, ignoring" && return
[[ -f $outfile ]] && echo "WARNING: File '${outfile}' exists, ignoring" && return
mkdir -p ${outfile%/*}
cross_ld_symlink=$(basename `rpm -ql glibc-32bit | grep -E 'ld-linux\.so\.[[:digit:]]+'`)
# Patch all 32bit binaries to use the right ld.so though symlink
-mkdir -p %{buildroot}%{our_path}%{_prefix}/lib
-mkdir -p %{buildroot}%{our_path}/lib
+mkdir -p ${buildroot_emul_path}%{_prefix}/lib
+mkdir -p ${buildroot_emul_path}/lib
for f in $(rpm -ql glibc-32bit) \
$(rpm -ql libgcc-32bit)
do
fdir=$(dirname $f)
- [ ! -d %{buildroot}%{our_path}/$fdir ] && mkdir -p %{buildroot}%{our_path}/$fdir
- cp -a $f %{buildroot}%{our_path}/$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
done
}
# create symlinks for bash
-ln -s usr/bin "%{buildroot}%{our_path}/bin"
+ln -s usr/bin "${buildroot_emul_path}/bin"
echo '%{our_path}/bin' >> %{_sourcedir}/all-accel.list
-ln -sf bash "%{buildroot}%{our_path}%{_bindir}sh"
+ln -sf bash "${buildroot_emul_path}%{_bindir}sh"
echo '%{our_path}%{_bindir}sh' >> %{_sourcedir}/all-accel.list
-mv %{buildroot}%{our_path}/%{_lib}/* %{buildroot}%{our_path}%{_libdir}/
-rm -rf %{buildroot}%{our_path}/%{_lib}
-ln -sf usr/%{_lib} %{buildroot}%{our_path}/%{_lib}
+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
%{?multilib:
-mv %{buildroot}%{our_path}/lib/* %{buildroot}%{our_path}%{_prefix}/lib/
-rm -rf %{buildroot}%{our_path}/lib
-ln -sf usr/lib %{buildroot}%{our_path}/lib
+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
}
# 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}%{our_path}%{_bindir}/%{target_arch}-$binary %{buildroot}%{our_path}%{_bindir}/$binary
+ 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
done
-mkdir -p %{buildroot}%{our_path}/%{_prefix}/%{target_arch}/bin
+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}%{our_path}%{_prefix}/%{target_arch}/bin/$binary
+ 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
done
# create symlinks for python
-mv %{buildroot}%{our_path}%{_bindir}/${host_python} %{buildroot}%{our_path}%{_bindir}/${host_python}-orig
-cat > %{buildroot}%{our_path}%{_bindir}/${host_python} << EOF
+mv ${buildroot_emul_path}%{_bindir}/${host_python} ${buildroot_emul_path}%{_bindir}/${host_python}-orig
+cat > ${buildroot_emul_path}%{_bindir}/${host_python} << EOF
#!/bin/bash
if [ -z "\$PYTHONPATH" ]; then
export PYTHONPATH="%{libdir}/${host_python}"
export PYTHONHOME="%{our_path}%{_prefix}"
%{our_path}%{_bindir}/${host_python}-orig "\$@"
EOF
-chmod +x %{buildroot}%{our_path}%{_bindir}/${host_python}
+chmod +x ${buildroot_emul_path}%{_bindir}/${host_python}
-ln -s ${host_python} %{buildroot}%{our_path}%{_bindir}/python
-ln -s ${host_python} %{buildroot}%{our_path}%{_libdir}/python
+ln -s ${host_python} ${buildroot_emul_path}%{_bindir}/python
+ln -s ${host_python} ${buildroot_emul_path}%{_libdir}/python
#create symlinks for Scons
-mkdir -p %{buildroot}%{our_path}%{libdir}/${host_python}/site-packages
-ln -sf %{libdir}/${host_python}/site-packages/SCons %{buildroot}%{our_path}%{libdir}/${host_python}/site-packages/SCons
+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
# rpmlint acceleration
-mkdir -p %{buildroot}%{our_path}/opt/testing/bin
-ln -s %{our_path}%{_bindir}/${host_python}-orig %{buildroot}%{our_path}/opt/testing/bin/
-cat > %{buildroot}%{our_path}/opt/testing/bin/${host_python} << EOF
+mkdir -p ${buildroot_emul_path}/opt/testing/bin
+ln -s %{our_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
export PYTHONPATH="%{libdir}/${host_python}"
export PYTHONHOME="%{our_path}%{_prefix}"
%{our_path}/opt/testing/bin/${host_python}-orig "\$@"
EOF
-chmod +x %{buildroot}%{our_path}/opt/testing/bin/${host_python}
-ln -s ${host_python} %{buildroot}%{our_path}/opt/testing/bin/python
+chmod +x ${buildroot_emul_path}/opt/testing/bin/${host_python}
+ln -s ${host_python} ${buildroot_emul_path}/opt/testing/bin/python
-mkdir -p %{buildroot}%{our_path}%{_libdir}/${host_python}/site-packages/rpm/
-mkdir -p %{buildroot}%{our_path}%{_libdir}/${host_python}/encodings/
-cp %{_libdir}/${host_python}/site-packages/rpm/*.py %{buildroot}%{our_path}%{_libdir}/${host_python}/site-packages/rpm/
-cp %{_libdir}/${host_python}/*.py %{buildroot}%{our_path}%{_libdir}/${host_python}/
-cp %{_libdir}/${host_python}/encodings/*.py %{buildroot}%{our_path}%{_libdir}/${host_python}/encodings/
-find %{buildroot} -name 'python*' | sed -e 's|%{buildroot}%{our_path}||' | tee -a python.list
+mkdir -p ${buildroot_emul_path}%{_libdir}/${host_python}/site-packages/rpm/
+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/
+find %{buildroot} -name 'python*' | sed -e "s|${buildroot_emul_path}||" | tee -a python.list
# rename gcc binaries
for bin in c++ g++ gcc gfortran cpp gcc-ar gcc-nm gcc-ranlib
do
- mv %{buildroot}%{our_path}%{_bindir}/%{target_arch}-$bin %{buildroot}%{our_path}%{_bindir}/$bin
- ln -s $bin %{buildroot}%{our_path}%{_bindir}/%{target_arch}-$bin
+ 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
done
-ln -s gcc %{buildroot}%{our_path}/%{_bindir}/cc
+ln -s gcc ${buildroot_emul_path}/%{_bindir}/cc
echo '%{our_path}%{_bindir}/cc' >> %{_sourcedir}/all-accel.list
# rpmbuild when generating 'requires' tag for gobject-introspection binaries
# so we replace x86_64 to armv7l to avoid bogus dependencies
%ifarch x86_64
%{?armv7l:
-sed -i -e "s/x86_64/armv7l/g" %{buildroot}%{our_path}%{_bindir}/bash
+sed -i -e "s/x86_64/armv7l/g" ${buildroot_emul_path}%{_bindir}/bash
}
%endif
gcc_build_dir=%{_builddir}/gcc-${gcc_version}/obj
# create symlinks for gcc build (CC_FOR_TARGET)
-mkdir -p %{buildroot}%{our_path}${gcc_build_dir}/gcc
+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}%{our_path}${gcc_build_dir}/gcc/${binary}
+ 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
done
for binary in cc1 cc1plus collect2 lto1 lto-wrapper f951
do
- ln -sf %{our_path}${gcc_install_dir}${binary} %{buildroot}%{our_path}${gcc_build_dir}/gcc/${binary}
+ 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
done
-ln -sf %{our_path}%{_bindir}/gcc %{buildroot}%{our_path}${gcc_build_dir}/gcc/xgcc
-ln -sf %{our_path}%{_bindir}/g++ %{buildroot}%{our_path}${gcc_build_dir}/gcc/xg++
+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
# support /lib/cpp
-ln -sf %{our_path}%{_bindir}/cpp %{buildroot}%{our_path}/usr/lib/cpp
+ln -sf %{our_path}%{_bindir}/cpp ${buildroot_emul_path}/usr/lib/cpp
# generate baselibs.conf for current architecture to prevent rpm overwriting in download repo
echo %{cross}
}
# Remove the ld-$VERSION.so to prevent name clashing with native ld.so
-find %{buildroot}%{our_path}%{_libdir} -name 'ld-*.so' -delete
+find ${buildroot_emul_path}%{_libdir} -name 'ld-*.so' -delete
sed -e '\|%{our_path}%{_libdir}/ld-[[:digit:]].*\.so|d' -i %{_sourcedir}/all-accel.list
# allow build of baselibs.conf
## python-accel
# Generate list of all python files
-find %{buildroot} -name '*.py' | sed -e 's|%{buildroot}%{our_path}||' >> python.list
+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
# Remove common files from python-accel
comm -13 %{_sourcedir}/qemu-accel.list python-full.list | sort -u > %{_sourcedir}/python-accel.list
# just like it is determided in python.spec
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}
+
binaries="%{_libdir}/libnsl.so.1 %{_libdir}/libnss_compat.so.2" # loaded via dlopen by glibc
%ifarch %ix86
LD="/%{_lib}/ld-linux.so.2"
local filetype=`file --brief $binary`
[[ x"$filetype" == x"POSIX shell script"* ]] && return
- local outfile=%{buildroot}%{our_path}$binary
+ local outfile=${buildroot_emul_path}$binary
[[ ! -e $binary ]] && echo "WARNING: File '${binary}' not found, ignoring" && return
[[ -f $outfile ]] && echo "WARNING: File '${outfile}' exists, ignoring" && return
mkdir -p ${outfile%/*}
cross_ld_symlink=$(basename `rpm -ql glibc-32bit | grep -E 'ld-linux\.so\.[[:digit:]]+'`)
# Patch all 32bit binaries to use the right ld.so though symlink
-mkdir -p %{buildroot}%{our_path}%{_prefix}/lib
-mkdir -p %{buildroot}%{our_path}/lib
+mkdir -p ${buildroot_emul_path}%{_prefix}/lib
+mkdir -p ${buildroot_emul_path}/lib
for f in $(rpm -ql glibc-32bit) \
$(rpm -ql libgcc-32bit)
do
fdir=$(dirname $f)
- [ ! -d %{buildroot}%{our_path}/$fdir ] && mkdir -p %{buildroot}%{our_path}/$fdir
- cp -a $f %{buildroot}%{our_path}/$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
done
}
# create symlinks for bash
-ln -s usr/bin "%{buildroot}%{our_path}/bin"
+ln -s usr/bin "${buildroot_emul_path}/bin"
echo '%{our_path}/bin' >> %{_sourcedir}/all-accel.list
-ln -sf bash "%{buildroot}%{our_path}%{_bindir}sh"
+ln -sf bash "${buildroot_emul_path}%{_bindir}sh"
echo '%{our_path}%{_bindir}sh' >> %{_sourcedir}/all-accel.list
-mv %{buildroot}%{our_path}/%{_lib}/* %{buildroot}%{our_path}%{_libdir}/
-rm -rf %{buildroot}%{our_path}/%{_lib}
-ln -sf usr/%{_lib} %{buildroot}%{our_path}/%{_lib}
+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
%{?multilib:
-mv %{buildroot}%{our_path}/lib/* %{buildroot}%{our_path}%{_prefix}/lib/
-rm -rf %{buildroot}%{our_path}/lib
-ln -sf usr/lib %{buildroot}%{our_path}/lib
+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
}
# 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}%{our_path}%{_bindir}/%{target_arch}-$binary %{buildroot}%{our_path}%{_bindir}/$binary
+ 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
done
-mkdir -p %{buildroot}%{our_path}/%{_prefix}/%{target_arch}/bin
+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}%{our_path}%{_prefix}/%{target_arch}/bin/$binary
+ 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
done
# create symlinks for python
-mv %{buildroot}%{our_path}%{_bindir}/${host_python} %{buildroot}%{our_path}%{_bindir}/${host_python}-orig
-cat > %{buildroot}%{our_path}%{_bindir}/${host_python} << EOF
+mv ${buildroot_emul_path}%{_bindir}/${host_python} ${buildroot_emul_path}%{_bindir}/${host_python}-orig
+cat > ${buildroot_emul_path}%{_bindir}/${host_python} << EOF
#!/bin/bash
if [ -z "\$PYTHONPATH" ]; then
export PYTHONPATH="%{libdir}/${host_python}"
export PYTHONHOME="%{our_path}%{_prefix}"
%{our_path}%{_bindir}/${host_python}-orig "\$@"
EOF
-chmod +x %{buildroot}%{our_path}%{_bindir}/${host_python}
+chmod +x ${buildroot_emul_path}%{_bindir}/${host_python}
-ln -s ${host_python} %{buildroot}%{our_path}%{_bindir}/python
-ln -s ${host_python} %{buildroot}%{our_path}%{_libdir}/python
+ln -s ${host_python} ${buildroot_emul_path}%{_bindir}/python
+ln -s ${host_python} ${buildroot_emul_path}%{_libdir}/python
#create symlinks for Scons
-mkdir -p %{buildroot}%{our_path}%{libdir}/${host_python}/site-packages
-ln -sf %{libdir}/${host_python}/site-packages/SCons %{buildroot}%{our_path}%{libdir}/${host_python}/site-packages/SCons
+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
# rpmlint acceleration
-mkdir -p %{buildroot}%{our_path}/opt/testing/bin
-ln -s %{our_path}%{_bindir}/${host_python}-orig %{buildroot}%{our_path}/opt/testing/bin/
-cat > %{buildroot}%{our_path}/opt/testing/bin/${host_python} << EOF
+mkdir -p ${buildroot_emul_path}/opt/testing/bin
+ln -s %{our_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
export PYTHONPATH="%{libdir}/${host_python}"
export PYTHONHOME="%{our_path}%{_prefix}"
%{our_path}/opt/testing/bin/${host_python}-orig "\$@"
EOF
-chmod +x %{buildroot}%{our_path}/opt/testing/bin/${host_python}
-ln -s ${host_python} %{buildroot}%{our_path}/opt/testing/bin/python
+chmod +x ${buildroot_emul_path}/opt/testing/bin/${host_python}
+ln -s ${host_python} ${buildroot_emul_path}/opt/testing/bin/python
-mkdir -p %{buildroot}%{our_path}%{_libdir}/${host_python}/site-packages/rpm/
-mkdir -p %{buildroot}%{our_path}%{_libdir}/${host_python}/encodings/
-cp %{_libdir}/${host_python}/site-packages/rpm/*.py %{buildroot}%{our_path}%{_libdir}/${host_python}/site-packages/rpm/
-cp %{_libdir}/${host_python}/*.py %{buildroot}%{our_path}%{_libdir}/${host_python}/
-cp %{_libdir}/${host_python}/encodings/*.py %{buildroot}%{our_path}%{_libdir}/${host_python}/encodings/
-find %{buildroot} -name 'python*' | sed -e 's|%{buildroot}%{our_path}||' | tee -a python.list
+mkdir -p ${buildroot_emul_path}%{_libdir}/${host_python}/site-packages/rpm/
+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/
+find %{buildroot} -name 'python*' | sed -e "s|${buildroot_emul_path}||" | tee -a python.list
# rename gcc binaries
for bin in c++ g++ gcc gfortran cpp gcc-ar gcc-nm gcc-ranlib
do
- mv %{buildroot}%{our_path}%{_bindir}/%{target_arch}-$bin %{buildroot}%{our_path}%{_bindir}/$bin
- ln -s $bin %{buildroot}%{our_path}%{_bindir}/%{target_arch}-$bin
+ 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
done
-ln -s gcc %{buildroot}%{our_path}/%{_bindir}/cc
+ln -s gcc ${buildroot_emul_path}/%{_bindir}/cc
echo '%{our_path}%{_bindir}/cc' >> %{_sourcedir}/all-accel.list
# rpmbuild when generating 'requires' tag for gobject-introspection binaries
# so we replace x86_64 to armv7l to avoid bogus dependencies
%ifarch x86_64
%{?armv7l:
-sed -i -e "s/x86_64/armv7l/g" %{buildroot}%{our_path}%{_bindir}/bash
+sed -i -e "s/x86_64/armv7l/g" ${buildroot_emul_path}%{_bindir}/bash
}
%endif
gcc_build_dir=%{_builddir}/gcc-${gcc_version}/obj
# create symlinks for gcc build (CC_FOR_TARGET)
-mkdir -p %{buildroot}%{our_path}${gcc_build_dir}/gcc
+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}%{our_path}${gcc_build_dir}/gcc/${binary}
+ 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
done
for binary in cc1 cc1plus collect2 lto1 lto-wrapper f951
do
- ln -sf %{our_path}${gcc_install_dir}${binary} %{buildroot}%{our_path}${gcc_build_dir}/gcc/${binary}
+ 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
done
-ln -sf %{our_path}%{_bindir}/gcc %{buildroot}%{our_path}${gcc_build_dir}/gcc/xgcc
-ln -sf %{our_path}%{_bindir}/g++ %{buildroot}%{our_path}${gcc_build_dir}/gcc/xg++
+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
# support /lib/cpp
-ln -sf %{our_path}%{_bindir}/cpp %{buildroot}%{our_path}/usr/lib/cpp
+ln -sf %{our_path}%{_bindir}/cpp ${buildroot_emul_path}/usr/lib/cpp
# generate baselibs.conf for current architecture to prevent rpm overwriting in download repo
echo %{cross}
}
# Remove the ld-$VERSION.so to prevent name clashing with native ld.so
-find %{buildroot}%{our_path}%{_libdir} -name 'ld-*.so' -delete
+find ${buildroot_emul_path}%{_libdir} -name 'ld-*.so' -delete
sed -e '\|%{our_path}%{_libdir}/ld-[[:digit:]].*\.so|d' -i %{_sourcedir}/all-accel.list
# allow build of baselibs.conf
## python-accel
# Generate list of all python files
-find %{buildroot} -name '*.py' | sed -e 's|%{buildroot}%{our_path}||' >> python.list
+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
# Remove common files from python-accel
comm -13 %{_sourcedir}/qemu-accel.list python-full.list | sort -u > %{_sourcedir}/python-accel.list
# just like it is determided in python.spec
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}
+
binaries="%{_libdir}/libnsl.so.1 %{_libdir}/libnss_compat.so.2" # loaded via dlopen by glibc
%ifarch %ix86
LD="/%{_lib}/ld-linux.so.2"
local filetype=`file --brief $binary`
[[ x"$filetype" == x"POSIX shell script"* ]] && return
- local outfile=%{buildroot}%{our_path}$binary
+ local outfile=${buildroot_emul_path}$binary
[[ ! -e $binary ]] && echo "WARNING: File '${binary}' not found, ignoring" && return
[[ -f $outfile ]] && echo "WARNING: File '${outfile}' exists, ignoring" && return
mkdir -p ${outfile%/*}
cross_ld_symlink=$(basename `rpm -ql glibc-32bit | grep -E 'ld-linux\.so\.[[:digit:]]+'`)
# Patch all 32bit binaries to use the right ld.so though symlink
-mkdir -p %{buildroot}%{our_path}%{_prefix}/lib
-mkdir -p %{buildroot}%{our_path}/lib
+mkdir -p ${buildroot_emul_path}%{_prefix}/lib
+mkdir -p ${buildroot_emul_path}/lib
for f in $(rpm -ql glibc-32bit) \
$(rpm -ql libgcc-32bit)
do
fdir=$(dirname $f)
- [ ! -d %{buildroot}%{our_path}/$fdir ] && mkdir -p %{buildroot}%{our_path}/$fdir
- cp -a $f %{buildroot}%{our_path}/$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
done
}
# create symlinks for bash
-ln -s usr/bin "%{buildroot}%{our_path}/bin"
+ln -s usr/bin "${buildroot_emul_path}/bin"
echo '%{our_path}/bin' >> %{_sourcedir}/all-accel.list
-ln -sf bash "%{buildroot}%{our_path}%{_bindir}sh"
+ln -sf bash "${buildroot_emul_path}%{_bindir}sh"
echo '%{our_path}%{_bindir}sh' >> %{_sourcedir}/all-accel.list
-mv %{buildroot}%{our_path}/%{_lib}/* %{buildroot}%{our_path}%{_libdir}/
-rm -rf %{buildroot}%{our_path}/%{_lib}
-ln -sf usr/%{_lib} %{buildroot}%{our_path}/%{_lib}
+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
%{?multilib:
-mv %{buildroot}%{our_path}/lib/* %{buildroot}%{our_path}%{_prefix}/lib/
-rm -rf %{buildroot}%{our_path}/lib
-ln -sf usr/lib %{buildroot}%{our_path}/lib
+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
}
# 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}%{our_path}%{_bindir}/%{target_arch}-$binary %{buildroot}%{our_path}%{_bindir}/$binary
+ 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
done
-mkdir -p %{buildroot}%{our_path}/%{_prefix}/%{target_arch}/bin
+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}%{our_path}%{_prefix}/%{target_arch}/bin/$binary
+ 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
done
# create symlinks for python
-mv %{buildroot}%{our_path}%{_bindir}/${host_python} %{buildroot}%{our_path}%{_bindir}/${host_python}-orig
-cat > %{buildroot}%{our_path}%{_bindir}/${host_python} << EOF
+mv ${buildroot_emul_path}%{_bindir}/${host_python} ${buildroot_emul_path}%{_bindir}/${host_python}-orig
+cat > ${buildroot_emul_path}%{_bindir}/${host_python} << EOF
#!/bin/bash
if [ -z "\$PYTHONPATH" ]; then
export PYTHONPATH="%{libdir}/${host_python}"
export PYTHONHOME="%{our_path}%{_prefix}"
%{our_path}%{_bindir}/${host_python}-orig "\$@"
EOF
-chmod +x %{buildroot}%{our_path}%{_bindir}/${host_python}
+chmod +x ${buildroot_emul_path}%{_bindir}/${host_python}
-ln -s ${host_python} %{buildroot}%{our_path}%{_bindir}/python
-ln -s ${host_python} %{buildroot}%{our_path}%{_libdir}/python
+ln -s ${host_python} ${buildroot_emul_path}%{_bindir}/python
+ln -s ${host_python} ${buildroot_emul_path}%{_libdir}/python
#create symlinks for Scons
-mkdir -p %{buildroot}%{our_path}%{libdir}/${host_python}/site-packages
-ln -sf %{libdir}/${host_python}/site-packages/SCons %{buildroot}%{our_path}%{libdir}/${host_python}/site-packages/SCons
+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
# rpmlint acceleration
-mkdir -p %{buildroot}%{our_path}/opt/testing/bin
-ln -s %{our_path}%{_bindir}/${host_python}-orig %{buildroot}%{our_path}/opt/testing/bin/
-cat > %{buildroot}%{our_path}/opt/testing/bin/${host_python} << EOF
+mkdir -p ${buildroot_emul_path}/opt/testing/bin
+ln -s %{our_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
export PYTHONPATH="%{libdir}/${host_python}"
export PYTHONHOME="%{our_path}%{_prefix}"
%{our_path}/opt/testing/bin/${host_python}-orig "\$@"
EOF
-chmod +x %{buildroot}%{our_path}/opt/testing/bin/${host_python}
-ln -s ${host_python} %{buildroot}%{our_path}/opt/testing/bin/python
+chmod +x ${buildroot_emul_path}/opt/testing/bin/${host_python}
+ln -s ${host_python} ${buildroot_emul_path}/opt/testing/bin/python
-mkdir -p %{buildroot}%{our_path}%{_libdir}/${host_python}/site-packages/rpm/
-mkdir -p %{buildroot}%{our_path}%{_libdir}/${host_python}/encodings/
-cp %{_libdir}/${host_python}/site-packages/rpm/*.py %{buildroot}%{our_path}%{_libdir}/${host_python}/site-packages/rpm/
-cp %{_libdir}/${host_python}/*.py %{buildroot}%{our_path}%{_libdir}/${host_python}/
-cp %{_libdir}/${host_python}/encodings/*.py %{buildroot}%{our_path}%{_libdir}/${host_python}/encodings/
-find %{buildroot} -name 'python*' | sed -e 's|%{buildroot}%{our_path}||' | tee -a python.list
+mkdir -p ${buildroot_emul_path}%{_libdir}/${host_python}/site-packages/rpm/
+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/
+find %{buildroot} -name 'python*' | sed -e "s|${buildroot_emul_path}||" | tee -a python.list
# rename gcc binaries
for bin in c++ g++ gcc gfortran cpp gcc-ar gcc-nm gcc-ranlib
do
- mv %{buildroot}%{our_path}%{_bindir}/%{target_arch}-$bin %{buildroot}%{our_path}%{_bindir}/$bin
- ln -s $bin %{buildroot}%{our_path}%{_bindir}/%{target_arch}-$bin
+ 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
done
-ln -s gcc %{buildroot}%{our_path}/%{_bindir}/cc
+ln -s gcc ${buildroot_emul_path}/%{_bindir}/cc
echo '%{our_path}%{_bindir}/cc' >> %{_sourcedir}/all-accel.list
# rpmbuild when generating 'requires' tag for gobject-introspection binaries
# so we replace x86_64 to armv7l to avoid bogus dependencies
%ifarch x86_64
%{?armv7l:
-sed -i -e "s/x86_64/armv7l/g" %{buildroot}%{our_path}%{_bindir}/bash
+sed -i -e "s/x86_64/armv7l/g" ${buildroot_emul_path}%{_bindir}/bash
}
%endif
gcc_build_dir=%{_builddir}/gcc-${gcc_version}/obj
# create symlinks for gcc build (CC_FOR_TARGET)
-mkdir -p %{buildroot}%{our_path}${gcc_build_dir}/gcc
+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}%{our_path}${gcc_build_dir}/gcc/${binary}
+ 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
done
for binary in cc1 cc1plus collect2 lto1 lto-wrapper f951
do
- ln -sf %{our_path}${gcc_install_dir}${binary} %{buildroot}%{our_path}${gcc_build_dir}/gcc/${binary}
+ 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
done
-ln -sf %{our_path}%{_bindir}/gcc %{buildroot}%{our_path}${gcc_build_dir}/gcc/xgcc
-ln -sf %{our_path}%{_bindir}/g++ %{buildroot}%{our_path}${gcc_build_dir}/gcc/xg++
+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
# support /lib/cpp
-ln -sf %{our_path}%{_bindir}/cpp %{buildroot}%{our_path}/usr/lib/cpp
+ln -sf %{our_path}%{_bindir}/cpp ${buildroot_emul_path}/usr/lib/cpp
# generate baselibs.conf for current architecture to prevent rpm overwriting in download repo
echo %{cross}
}
# Remove the ld-$VERSION.so to prevent name clashing with native ld.so
-find %{buildroot}%{our_path}%{_libdir} -name 'ld-*.so' -delete
+find ${buildroot_emul_path}%{_libdir} -name 'ld-*.so' -delete
sed -e '\|%{our_path}%{_libdir}/ld-[[:digit:]].*\.so|d' -i %{_sourcedir}/all-accel.list
# allow build of baselibs.conf
## python-accel
# Generate list of all python files
-find %{buildroot} -name '*.py' | sed -e 's|%{buildroot}%{our_path}||' >> python.list
+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
# Remove common files from python-accel
comm -13 %{_sourcedir}/qemu-accel.list python-full.list | sort -u > %{_sourcedir}/python-accel.list
# just like it is determided in python.spec
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}
+
binaries="%{_libdir}/libnsl.so.1 %{_libdir}/libnss_compat.so.2" # loaded via dlopen by glibc
%ifarch %ix86
LD="/%{_lib}/ld-linux.so.2"
local filetype=`file --brief $binary`
[[ x"$filetype" == x"POSIX shell script"* ]] && return
- local outfile=%{buildroot}%{our_path}$binary
+ local outfile=${buildroot_emul_path}$binary
[[ ! -e $binary ]] && echo "WARNING: File '${binary}' not found, ignoring" && return
[[ -f $outfile ]] && echo "WARNING: File '${outfile}' exists, ignoring" && return
mkdir -p ${outfile%/*}
cross_ld_symlink=$(basename `rpm -ql glibc-32bit | grep -E 'ld-linux\.so\.[[:digit:]]+'`)
# Patch all 32bit binaries to use the right ld.so though symlink
-mkdir -p %{buildroot}%{our_path}%{_prefix}/lib
-mkdir -p %{buildroot}%{our_path}/lib
+mkdir -p ${buildroot_emul_path}%{_prefix}/lib
+mkdir -p ${buildroot_emul_path}/lib
for f in $(rpm -ql glibc-32bit) \
$(rpm -ql libgcc-32bit)
do
fdir=$(dirname $f)
- [ ! -d %{buildroot}%{our_path}/$fdir ] && mkdir -p %{buildroot}%{our_path}/$fdir
- cp -a $f %{buildroot}%{our_path}/$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
done
}
# create symlinks for bash
-ln -s usr/bin "%{buildroot}%{our_path}/bin"
+ln -s usr/bin "${buildroot_emul_path}/bin"
echo '%{our_path}/bin' >> %{_sourcedir}/all-accel.list
-ln -sf bash "%{buildroot}%{our_path}%{_bindir}sh"
+ln -sf bash "${buildroot_emul_path}%{_bindir}sh"
echo '%{our_path}%{_bindir}sh' >> %{_sourcedir}/all-accel.list
-mv %{buildroot}%{our_path}/%{_lib}/* %{buildroot}%{our_path}%{_libdir}/
-rm -rf %{buildroot}%{our_path}/%{_lib}
-ln -sf usr/%{_lib} %{buildroot}%{our_path}/%{_lib}
+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
%{?multilib:
-mv %{buildroot}%{our_path}/lib/* %{buildroot}%{our_path}%{_prefix}/lib/
-rm -rf %{buildroot}%{our_path}/lib
-ln -sf usr/lib %{buildroot}%{our_path}/lib
+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
}
# 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}%{our_path}%{_bindir}/%{target_arch}-$binary %{buildroot}%{our_path}%{_bindir}/$binary
+ 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
done
-mkdir -p %{buildroot}%{our_path}/%{_prefix}/%{target_arch}/bin
+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}%{our_path}%{_prefix}/%{target_arch}/bin/$binary
+ 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
done
# create symlinks for python
-mv %{buildroot}%{our_path}%{_bindir}/${host_python} %{buildroot}%{our_path}%{_bindir}/${host_python}-orig
-cat > %{buildroot}%{our_path}%{_bindir}/${host_python} << EOF
+mv ${buildroot_emul_path}%{_bindir}/${host_python} ${buildroot_emul_path}%{_bindir}/${host_python}-orig
+cat > ${buildroot_emul_path}%{_bindir}/${host_python} << EOF
#!/bin/bash
if [ -z "\$PYTHONPATH" ]; then
export PYTHONPATH="%{libdir}/${host_python}"
export PYTHONHOME="%{our_path}%{_prefix}"
%{our_path}%{_bindir}/${host_python}-orig "\$@"
EOF
-chmod +x %{buildroot}%{our_path}%{_bindir}/${host_python}
+chmod +x ${buildroot_emul_path}%{_bindir}/${host_python}
-ln -s ${host_python} %{buildroot}%{our_path}%{_bindir}/python
-ln -s ${host_python} %{buildroot}%{our_path}%{_libdir}/python
+ln -s ${host_python} ${buildroot_emul_path}%{_bindir}/python
+ln -s ${host_python} ${buildroot_emul_path}%{_libdir}/python
#create symlinks for Scons
-mkdir -p %{buildroot}%{our_path}%{libdir}/${host_python}/site-packages
-ln -sf %{libdir}/${host_python}/site-packages/SCons %{buildroot}%{our_path}%{libdir}/${host_python}/site-packages/SCons
+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
# rpmlint acceleration
-mkdir -p %{buildroot}%{our_path}/opt/testing/bin
-ln -s %{our_path}%{_bindir}/${host_python}-orig %{buildroot}%{our_path}/opt/testing/bin/
-cat > %{buildroot}%{our_path}/opt/testing/bin/${host_python} << EOF
+mkdir -p ${buildroot_emul_path}/opt/testing/bin
+ln -s %{our_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
export PYTHONPATH="%{libdir}/${host_python}"
export PYTHONHOME="%{our_path}%{_prefix}"
%{our_path}/opt/testing/bin/${host_python}-orig "\$@"
EOF
-chmod +x %{buildroot}%{our_path}/opt/testing/bin/${host_python}
-ln -s ${host_python} %{buildroot}%{our_path}/opt/testing/bin/python
+chmod +x ${buildroot_emul_path}/opt/testing/bin/${host_python}
+ln -s ${host_python} ${buildroot_emul_path}/opt/testing/bin/python
-mkdir -p %{buildroot}%{our_path}%{_libdir}/${host_python}/site-packages/rpm/
-mkdir -p %{buildroot}%{our_path}%{_libdir}/${host_python}/encodings/
-cp %{_libdir}/${host_python}/site-packages/rpm/*.py %{buildroot}%{our_path}%{_libdir}/${host_python}/site-packages/rpm/
-cp %{_libdir}/${host_python}/*.py %{buildroot}%{our_path}%{_libdir}/${host_python}/
-cp %{_libdir}/${host_python}/encodings/*.py %{buildroot}%{our_path}%{_libdir}/${host_python}/encodings/
-find %{buildroot} -name 'python*' | sed -e 's|%{buildroot}%{our_path}||' | tee -a python.list
+mkdir -p ${buildroot_emul_path}%{_libdir}/${host_python}/site-packages/rpm/
+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/
+find %{buildroot} -name 'python*' | sed -e "s|${buildroot_emul_path}||" | tee -a python.list
# rename gcc binaries
for bin in c++ g++ gcc gfortran cpp gcc-ar gcc-nm gcc-ranlib
do
- mv %{buildroot}%{our_path}%{_bindir}/%{target_arch}-$bin %{buildroot}%{our_path}%{_bindir}/$bin
- ln -s $bin %{buildroot}%{our_path}%{_bindir}/%{target_arch}-$bin
+ 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
done
-ln -s gcc %{buildroot}%{our_path}/%{_bindir}/cc
+ln -s gcc ${buildroot_emul_path}/%{_bindir}/cc
echo '%{our_path}%{_bindir}/cc' >> %{_sourcedir}/all-accel.list
# rpmbuild when generating 'requires' tag for gobject-introspection binaries
# so we replace x86_64 to armv7l to avoid bogus dependencies
%ifarch x86_64
%{?armv7l:
-sed -i -e "s/x86_64/armv7l/g" %{buildroot}%{our_path}%{_bindir}/bash
+sed -i -e "s/x86_64/armv7l/g" ${buildroot_emul_path}%{_bindir}/bash
}
%endif
gcc_build_dir=%{_builddir}/gcc-${gcc_version}/obj
# create symlinks for gcc build (CC_FOR_TARGET)
-mkdir -p %{buildroot}%{our_path}${gcc_build_dir}/gcc
+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}%{our_path}${gcc_build_dir}/gcc/${binary}
+ 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
done
for binary in cc1 cc1plus collect2 lto1 lto-wrapper f951
do
- ln -sf %{our_path}${gcc_install_dir}${binary} %{buildroot}%{our_path}${gcc_build_dir}/gcc/${binary}
+ 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
done
-ln -sf %{our_path}%{_bindir}/gcc %{buildroot}%{our_path}${gcc_build_dir}/gcc/xgcc
-ln -sf %{our_path}%{_bindir}/g++ %{buildroot}%{our_path}${gcc_build_dir}/gcc/xg++
+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
# support /lib/cpp
-ln -sf %{our_path}%{_bindir}/cpp %{buildroot}%{our_path}/usr/lib/cpp
+ln -sf %{our_path}%{_bindir}/cpp ${buildroot_emul_path}/usr/lib/cpp
# generate baselibs.conf for current architecture to prevent rpm overwriting in download repo
echo %{cross}
}
# Remove the ld-$VERSION.so to prevent name clashing with native ld.so
-find %{buildroot}%{our_path}%{_libdir} -name 'ld-*.so' -delete
+find ${buildroot_emul_path}%{_libdir} -name 'ld-*.so' -delete
sed -e '\|%{our_path}%{_libdir}/ld-[[:digit:]].*\.so|d' -i %{_sourcedir}/all-accel.list
# allow build of baselibs.conf
## python-accel
# Generate list of all python files
-find %{buildroot} -name '*.py' | sed -e 's|%{buildroot}%{our_path}||' >> python.list
+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
# Remove common files from python-accel
comm -13 %{_sourcedir}/qemu-accel.list python-full.list | sort -u > %{_sourcedir}/python-accel.list