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