@ -82,6 +82,35 @@
end
}
# With $PATH and $PYTHONPATH set to the %%buildroot,
# try to import the given Python module(s).
# Useful as a smoke test in %%check when running tests is not feasible.
# Use spaces or commas as separators.
%py_check_import() %{expand:\\\
(cd %{_topdir} &&\\\
PATH="%{buildroot}%{_bindir}:$PATH"\\\
PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python_sitearch}:%{buildroot}%{python_sitelib}}"\\\
PYTHONDONTWRITEBYTECODE=1\\\
%{__python} -c "import %{lua:local m=rpm.expand('%{?*}'):gsub('[%s,]+', ', ');print(m)}"
)
}
%py2_check_import() %{expand:\\\
(cd %{_topdir} &&\\\
PATH="%{buildroot}%{_bindir}:$PATH"\\\
PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python2_sitearch}:%{buildroot}%{python2_sitelib}}"\\\
PYTHONDONTWRITEBYTECODE=1\\\
%{__python2} -c "import %{lua:local m=rpm.expand('%{?*}'):gsub('[%s,]+', ', ');print(m)}"
)
}
%py3_check_import() %{expand:\\\
(cd %{_topdir} &&\\\
PATH="%{buildroot}%{_bindir}:$PATH"\\\
PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}"\\\
PYTHONDONTWRITEBYTECODE=1\\\
%{__python3} -c "import %{lua:local m=rpm.expand('%{?*}'):gsub('[%s,]+', ', ');print(m)}"
)
}
%python_disable_dependency_generator() \
%undefine __pythondist_requires \
%{nil}