summaryrefslogtreecommitdiff
path: root/modulemd-tools.spec
diff options
context:
space:
mode:
Diffstat (limited to 'modulemd-tools.spec')
-rw-r--r--modulemd-tools.spec11
1 files changed, 10 insertions, 1 deletions
diff --git a/modulemd-tools.spec b/modulemd-tools.spec
index b787cf5..c03f0aa 100644
--- a/modulemd-tools.spec
+++ b/modulemd-tools.spec
@@ -7,6 +7,15 @@ BuildArch: noarch
%global release_name %{name}-%{version}-1
%global python3 %{__python3}
+# This is intended for Python 3 only, hence also no Python version in the name.
+%global __pytest /usr/bin/pytest%(test %{python3_pkgversion} == 3 || echo -%{python3_version})
+%global pytest %{expand:\\\
+ CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\
+ PATH="%{buildroot}%{_bindir}:$PATH"\\\
+ PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}"\\\
+ PYTHONDONTWRITEBYTECODE=1\\\
+ %{?__pytest_addopts:PYTEST_ADDOPTS="${PYTEST_ADDOPTS:-} %{__pytest_addopts}"}\\\
+ %__pytest}
URL: https://github.com/rpm-software-management/modulemd-tools
Source0: %{url}/archive/%{release_name}.tar.gz
@@ -149,7 +158,7 @@ cd createrepo_mod
cd ..
cd modulemd-add-platform
-/usr/bin/pytest
+%pytest
cd ..
cd modulemd-merge