diff options
Diffstat (limited to 'packaging/qemu-accel.spec.in')
-rw-r--r-- | packaging/qemu-accel.spec.in | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/packaging/qemu-accel.spec.in b/packaging/qemu-accel.spec.in index 0767396..9fde2d6 100644 --- a/packaging/qemu-accel.spec.in +++ b/packaging/qemu-accel.spec.in @@ -127,6 +127,15 @@ Group: Development/Cross Compilation %description -n python-accel This package is used in qemu-accel to accelerate python. +%post -n python-accel +ldconfig + +# Check if there is possibility of gcc-unforce-options call and fix permissions +rpm -qa --qf '%{NAME}\n' | grep force-options && \ + chmod a+w /usr/bin && \ + chmod a+w /emul/usr/bin/ && chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-*/obj/gcc/ \ + && find -L /emul/usr/*/gcc -name 'collect2' | xargs dirname | xargs chmod a+w + %package -n clang-accel AutoReqProv: off Requires: qemu-accel @@ -140,6 +149,15 @@ Requires: qemu-accel %description -n clang-accel This package is used in qemu-accel to accelerate clang compiler. +%post -n clang-accel +# Check if there is possibility of gcc-unforce-options call and fix permissions +pkg=$(rpm -qa --qf '%{NAME}\n' | grep force-options) +if [[ x"$pkg" != x"" ]]; then + chmod a+w /usr/bin + chmod a+w /emul/usr/bin/ && chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-*/obj/gcc/ \ + && find -L /emul/usr/*/gcc -name 'collect2' | xargs dirname | xargs chmod a+w +fi + %prep %build @@ -511,8 +529,13 @@ 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 %{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 +sed -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," -i %{_sourcedir}/baselibs.conf +sed -e "s,#PLUGIN_POSTUN#,ln -sf liblto_plugin.so.0 ${target_liblto_plugin}," -i %{_sourcedir}/baselibs.conf + +# Add support of gcc-unforce-options for baselibs-generated packages +sed -e "s,#PYTHON_POSTIN#,rpm -qa --qf '%%%%{NAME}' | grep force-options \&\& chmod a+w /usr/bin \&\& chmod a+w /emul/usr/bin/ \&\& chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-*/obj/gcc/ \&\& find -L /emul/usr/*/gcc -name 'collect2' | xargs dirname | xargs chmod a+w," -i %{_sourcedir}/baselibs.conf +sed -e "s,#CLANG_POSTIN#,rpm -qa --qf '%%%%{NAME}' | grep force-options \&\& chmod a+w /usr/bin \&\& chmod a+w /emul/usr/bin/ \&\& chmod a+w /emul/home/abuild/rpmbuild/BUILD/gcc-*/obj/gcc/ \&\& find -L /emul/usr/*/gcc -name 'collect2' | xargs dirname | xargs chmod a+w," -i %{_sourcedir}/baselibs.conf + # Use /usr/lib for cross clang libdir on armv7l architecture %{?armv7l: @@ -564,9 +587,6 @@ ldconfig %postun ldconfig -%post -n python-accel -ldconfig - %postun -n python-accel ldconfig |