Remove stray __pycache__ directory from /usr/bin when running %py_install, %py_install_wheel and %py_install_egg macros

Solves bz#1739848
This commit is contained in:
Anna Khaitovich 2019-12-28 19:16:16 +01:00 committed by Miro Hrončok
commit 2314fd928a
4 changed files with 11 additions and 0 deletions

View file

@ -33,13 +33,16 @@
%py2_install() %{expand:\\\
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
%{__python2} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
rm -rfv %{buildroot}%{_bindir}/__pycache__
}
%py2_install_egg() %{expand:\\\
mkdir -p %{buildroot}%{python2_sitelib}
easy_install-%{python2_version} -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python2_version}.egg %{?*}
rm -rfv %{buildroot}%{_bindir}/__pycache__
}
%py2_install_wheel() %{expand:\\\
pip%{python2_version} install -I dist/%{1} --root %{buildroot} --no-deps
rm -rfv %{buildroot}%{_bindir}/__pycache__
}