Blame SOURCES/macros.python2

f5a09a
%__python2 /usr/bin/python2
f5a09a
%python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
f5a09a
%python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
f5a09a
%python2_version %(%{__python2} -c "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))")
f5a09a
%python2_version_nodots %(%{__python2} -c "import sys; sys.stdout.write('{0.major}{0.minor}'.format(sys.version_info))")
f5a09a
f5a09a
%py2_shbang_opts -s
f5a09a
f5a09a
# Use the slashes after expand so that the command starts on the same line as
f5a09a
# the macro
f5a09a
%py2_build() %{expand:\\\
f5a09a
  CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} build --executable="%{__python2} %{py2_shbang_opts}" %{?*}
f5a09a
  sleep 1
f5a09a
}
f5a09a
f5a09a
%py2_build_egg() %{expand:\\\
f5a09a
  CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} bdist_egg %{?*}
f5a09a
  sleep 1
f5a09a
}
f5a09a
f5a09a
%py2_build_wheel() %{expand:\\\
f5a09a
  CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} bdist_wheel %{?*}
f5a09a
  sleep 1
f5a09a
}
f5a09a
f5a09a
%py2_install() %{expand:\\\
f5a09a
  CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
f5a09a
}
f5a09a
f5a09a
%py2_install_egg() %{expand:\\\
f5a09a
  mkdir -p %{buildroot}%{python2_sitelib}
f5a09a
  easy_install-%{python2_version} -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python2_version}.egg %{?*}
f5a09a
}
f5a09a
f5a09a
%py2_install_wheel() %{expand:\\\
f5a09a
  pip%{python2_version} install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} --no-deps
f5a09a
}