Blame SOURCES/macros.python

2599dd
%py_setup setup.py
2599dd
%py_shbang_opts -s
2599dd
2599dd
# Use the slashes after expand so that the command starts on the same line as
2599dd
# the macro
2599dd
%py_build() %{expand:\\\
2599dd
  CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
2e4bbb
  %{__python} %{py_setup} %{?py_setup_args} build --executable="%{__python} %{py_shbang_opts}" %{?*}
2599dd
  sleep 1
2599dd
}
2599dd
2599dd
%py_build_egg() %{expand:\\\
2599dd
  CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
2599dd
  %{__python} %{py_setup} %{?py_setup_args} bdist_egg %{?*}
2599dd
  sleep 1
2599dd
}
2599dd
2599dd
%py_build_wheel() %{expand:\\\
2599dd
  CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
2599dd
  %{__python} %{py_setup} %{?py_setup_args} bdist_wheel %{?*}
2599dd
  sleep 1
2599dd
}
2599dd
2599dd
%py_install() %{expand:\\\
2599dd
  CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
2599dd
  %{__python} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*}
2599dd
}
2599dd
2599dd
%py_install_egg() %{expand:\\\
2599dd
  mkdir -p %{buildroot}%{python_sitelib}
2599dd
  easy_install -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python_version}.egg %{?*}
2599dd
}
2599dd
2599dd
%py_install_wheel() %{expand:\\\
2599dd
  pip install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} --no-deps
2599dd
}
2599dd
2599dd
%python_provide() %{lua:
2599dd
  function string.starts(String,Start)
2599dd
    return string.sub(String,1,string.len(Start))==Start
2599dd
  end
2599dd
  package = rpm.expand("%{?1}")
2599dd
  vr = rpm.expand("%{?epoch:%{epoch}:}%{version}-%{release}")
2599dd
  if (string.starts(package, "python2-")) then
2599dd
    --No unversioned provides as python2 is not default
2599dd
  elseif (string.starts(package, "python" .. rpm.expand("%{python3_pkgversion}") .. "-")) then
2599dd
    --No unversioned provides as python3 is not default
2599dd
  elseif (rpm.expand("%{?python3_other_pkgversion}") ~= "" and string.starts(package, "python" .. rpm.expand("%{python3_other_pkgversion}") .. "-")) then
2599dd
    --No unversioned provides as python3_other is not default
2599dd
  elseif (string.starts(package, "pypy-")) then
2599dd
    --No unversioned provides as pypy is not default
2599dd
  elseif (string.starts(package, "pypy3-")) then
2599dd
    --No unversioned provides as pypy is not default
2599dd
  elseif (string.starts(package, "python-")) then
2599dd
    --Providing the current default python
2599dd
    print("Provides: python2-")
2599dd
    print(string.sub(package,8,string.len(package)))
2599dd
    print(" = ")
2599dd
    print(vr)
2599dd
  else
2599dd
    print("%python_provide: ERROR: ")
2599dd
    print(package)
2599dd
    print(" not recognized.")
2599dd
  end
2599dd
}
2599dd
2599dd
%python_enable_dependency_generator() \
2599dd
%global __python_requires %{_rpmconfigdir}/pythondistdeps.py --requires \
2599dd
%{nil}