Blame SOURCES/macros.python2

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