diff options
author | Slava Barinov <v.barinov@samsung.com> | 2021-05-13 15:20:27 +0300 |
---|---|---|
committer | Slava Barinov <v.barinov@samsung.com> | 2021-05-13 19:00:08 +0300 |
commit | a8aa21c9e8a7120221503afaea8213f5e47121c0 (patch) | |
tree | 12cd7f0fa33907b18d431f6350d615fb295bd92b | |
parent | 63cc2e9d512c36ca662f0af2411395b935fa82a7 (diff) | |
download | qemu-accel-a8aa21c9e8a7120221503afaea8213f5e47121c0.tar.gz qemu-accel-a8aa21c9e8a7120221503afaea8213f5e47121c0.tar.bz2 qemu-accel-a8aa21c9e8a7120221503afaea8213f5e47121c0.zip |
Fix directory permissions for *-force-options packagessubmit/tizen_base/20210514.081010accepted/tizen/base/tool/20210514.083901
Change-Id: Icf48f938a67607e1d68a57616ecf0c0aa1038f2e
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
-rw-r--r-- | packaging/baselibs_body | 2 | ||||
-rw-r--r-- | packaging/qemu-accel-aarch64.spec | 30 | ||||
-rw-r--r-- | packaging/qemu-accel-armv7hl.spec | 30 | ||||
-rw-r--r-- | packaging/qemu-accel-armv7l.spec | 30 | ||||
-rw-r--r-- | packaging/qemu-accel.spec.in | 30 |
5 files changed, 102 insertions, 20 deletions
diff --git a/packaging/baselibs_body b/packaging/baselibs_body index d00e563..8a9e92c 100644 --- a/packaging/baselibs_body +++ b/packaging/baselibs_body @@ -18,6 +18,7 @@ python-accel targettype 32bit block! autoreqprov off +/ + post "#PYTHON_POSTIN#" clang-accel targettype aarch64 block! @@ -25,3 +26,4 @@ clang-accel targettype 32bit block! autoreqprov off +/ + post "#CLANG_POSTIN#" diff --git a/packaging/qemu-accel-aarch64.spec b/packaging/qemu-accel-aarch64.spec index 1c9c9fb..3531b4c 100644 --- a/packaging/qemu-accel-aarch64.spec +++ b/packaging/qemu-accel-aarch64.spec @@ -130,6 +130,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 @@ -143,6 +152,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 @@ -514,8 +532,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: @@ -567,9 +590,6 @@ ldconfig %postun ldconfig -%post -n python-accel -ldconfig - %postun -n python-accel ldconfig diff --git a/packaging/qemu-accel-armv7hl.spec b/packaging/qemu-accel-armv7hl.spec index ecdb4d6..a5d2bc3 100644 --- a/packaging/qemu-accel-armv7hl.spec +++ b/packaging/qemu-accel-armv7hl.spec @@ -130,6 +130,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 @@ -143,6 +152,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 @@ -514,8 +532,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: @@ -567,9 +590,6 @@ ldconfig %postun ldconfig -%post -n python-accel -ldconfig - %postun -n python-accel ldconfig diff --git a/packaging/qemu-accel-armv7l.spec b/packaging/qemu-accel-armv7l.spec index 98d0dc1..33fb131 100644 --- a/packaging/qemu-accel-armv7l.spec +++ b/packaging/qemu-accel-armv7l.spec @@ -130,6 +130,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 @@ -143,6 +152,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 @@ -514,8 +532,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: @@ -567,9 +590,6 @@ ldconfig %postun ldconfig -%post -n python-accel -ldconfig - %postun -n python-accel ldconfig 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 |