Blame SOURCES/macros.python3

f245b7
%__python3 /usr/bin/python3
f245b7
%python3_sitelib %(%{__python3} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
f245b7
%python3_sitearch %(%{__python3} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
f245b7
%python3_version %(%{__python3} -Ic "import sys; sys.stdout.write(sys.version[:3])")
f245b7
%python3_version_nodots %(%{__python3} -Ic "import sys; sys.stdout.write(sys.version[:3].replace('.',''))")
f245b7
%python3_platform %(%{__python3} -Ic "import sysconfig; print(sysconfig.get_platform())")
f245b7
%py3dir %{_builddir}/python3-%{name}-%{version}-%{release}
f245b7
f245b7
%py3_shbang_opts -s
f245b7
f245b7
# Use the slashes after expand so that the command starts on the same line as
f245b7
# the macro
f245b7
%py3_build() %{expand:\\\
f245b7
  CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
f245b7
  %{__python3} %{py_setup} %{?py_setup_args} build --executable="%{__python3} %{py3_shbang_opts}" %{?*}
f245b7
  sleep 1
f245b7
}
f245b7
f245b7
%py3_build_egg() %{expand:\\\
f245b7
  CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
f245b7
  %{__python3} %{py_setup} %{?py_setup_args} bdist_egg %{?*}
f245b7
  sleep 1
f245b7
}
f245b7
f245b7
%py3_build_wheel() %{expand:\\\
f245b7
  CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
f245b7
  %{__python3} %{py_setup} %{?py_setup_args} bdist_wheel %{?*}
f245b7
  sleep 1
f245b7
}
f245b7
f245b7
%py3_install() %{expand:\\\
f245b7
  CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
f245b7
  %{__python3} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
f245b7
}
f245b7
f245b7
%py3_install_egg() %{expand:\\\
f245b7
  mkdir -p %{buildroot}%{python3_sitelib}
f245b7
  easy_install-%{python3_version} -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python3_version}.egg %{?*}
f245b7
}
f245b7
f245b7
%py3_install_wheel() %{expand:\\\
f245b7
  pip%{python3_version} install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} --no-deps
f245b7
}