Blob Blame History Raw
%__platform_python /usr/libexec/platform-python
%platform_python_sitelib %(%{__platform_python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
%platform_python_sitearch %(%{__platform_python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
%platform_python_version %(%{__platform_python} -c "import sys; sys.stdout.write(sys.version[:3])")
%platform_python_version_nodots %(%{__platform_python} -c "import sys; sys.stdout.write(sys.version[:3].replace('.',''))")
%platform_py_dir %{_builddir}/platform-python-%{name}-%{version}-%{release}

%platform_py_shbang_opts -s

# Use the slashes after expand so that the command starts on the same line as
# the macro
%platform_py_build() %{expand:\\\
  CFLAGS="%{optflags}" %{__platform_python} %{py_setup} %{?py_setup_args} build --executable="%{__platform_python} %{platform_py_shbang_opts}" %{?*}
  sleep 1
}

%platform_py_build_egg() %{expand:\\\
  CFLAGS="%{optflags}" %{__platform_python} %{py_setup} %{?py_setup_args} bdist_egg %{?*}
  sleep 1
}

%platform_py_build_wheel() %{expand:\\\
  CFLAGS="%{optflags}" %{__platform_python} %{py_setup} %{?py_setup_args} bdist_wheel %{?*}
  sleep 1
}

%platform_py_install() %{expand:\\\
  CFLAGS="%{optflags}" %{__platform_python} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
}

%platform_py_install_egg() %{expand:\\\
  mkdir -p %{buildroot}%{platform_python_sitelib}
  CFLAGS="%{optflags}" %{__platform_python} -m easy_install -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{platform_python_version}.egg %{?*}
}

%platform_py_install_wheel() %{expand:\\\
  CFLAGS="%{optflags}" %{__platform_python} -m pip install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} --no-deps
}