Blame SOURCES/macros.python39

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