Blame SOURCES/macros.python39

93c559
%__python3 /usr/bin/python3.9
93c559
%python3_pkgversion 39
93c559
%__pytest /usr/bin/pytest-3.9
93c559
93c559
# The following are macros from macros.python3 in Fedora that are newer/different than those in the python3-rpm-macros package in RHEL.
93c559
# These macros overwrite/supercede some of the macros in the python3-rpm-macros package in RHEL.
93c559
93c559
%python3_version %(%{__python3} -Ic "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))")
93c559
%python3_version_nodots %(%{__python3} -Ic "import sys; sys.stdout.write('{0.major}{0.minor}'.format(sys.version_info))")
93c559
93c559
%py3_install() %{expand:\\\
93c559
  CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
93c559
  %{__python3} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
93c559
  rm -rfv %{buildroot}%{_bindir}/__pycache__
93c559
}
93c559
93c559
%py3_install_egg() %{expand:\\\
93c559
  mkdir -p %{buildroot}%{python3_sitelib}
93c559
  CFLAGS="%{optflags}" %{__python3} -m easy_install -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python3_version}.egg %{?*}
93c559
  rm -rfv %{buildroot}%{_bindir}/__pycache__
93c559
}
93c559
93c559
%py3_install_wheel() %{expand:\\\
93c559
  CFLAGS="%{optflags}" %{__python3} -m pip install -I dist/%{1} --root %{buildroot} --no-deps --no-index --no-warn-script-location
93c559
  rm -rfv %{buildroot}%{_bindir}/__pycache__
93c559
  for distinfo in %{buildroot}%{python3_sitelib}/*.dist-info %{buildroot}%{python3_sitearch}/*.dist-info; do
93c559
    if [ -f ${distinfo}/direct_url.json ]; then
93c559
      rm -fv ${distinfo}/direct_url.json
93c559
      sed -i '/direct_url.json/d' ${distinfo}/RECORD
93c559
    fi
93c559
  done
93c559
}