%__python2 /usr/bin/python2 %python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") %python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") %py2ver %(%{__python2} -V 2>&1 | cut -f2 -d" " | cut -f1,2 -d".") %python2_version %(%{__python2} -c "import sys; print(sys.version[0:3])") %py2_ver %(%{__python2} -c "import sys; v=sys.version_info[:2]; print('%%d.%%d'%%v)" 2>/dev/null || echo PYTHON-NOT-FOUND) %py2_prefix %(%{__python2} -c "import sys; print(sys.prefix)" 2>/dev/null || echo PYTHON-NOT-FOUND) %py2_platsitedir %python2_sitearch %py2_puresitedir %python2_sitelib %py2_incdir %(%{__python2} -c 'from distutils.sysconfig import get_python_inc; print(get_python_inc())' 2>/dev/null || echo PYTHON-INCLUDEDIR-NOT-FOUND) %py2dir %{_builddir}/python2-%{name}-%{version}-%{release} %py2_setup setup.py %py2_shbang_opts -s # Use the slashes after expand so that the command starts on the same line as # the macro %py2_build() %{expand:\\\ CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} build --executable="%{__python2} %{py2_shbang_opts}" %{?*} sleep 1 } %py2_build_egg() %{expand:\\\ CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} bdist_egg %{?*} sleep 1 } %py2_build_wheel() %{expand:\\\ CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} bdist_wheel %{?*} sleep 1 } %py2_install() %{expand:\\\ CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*} } %py2_install_egg() %{expand:\\\ mkdir -p %{buildroot}%{python2_sitelib} easy_install-%{python2_version} -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python2_version}.egg %{?*} } %py2_install_wheel() %{expand:\\\ pip%{python2_version} install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} }