%if 0%{?rhel} && 0%{?rhel} >= 8 %global with_python3 1 %else %{!?__python2: %global __python2 /usr/bin/python2} %{!?python2_sitelib2: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} %endif %if 0%{?fedora} >= 25 %global with_python3 1 %endif %define name python-pytest-modifyjunit %define owner IDM QE %define project pytest-modifyjunit %define version 0.1 %define release 1 %define srcname python-pytest-modifyjunit Name: %{name} Version: %{version} Release: %{release}%{?dist} Summary: pytest plugin to modify junit to add additional properties License: GPLv3+ Source0: https://pagure.io/releases/pytest-modifyjunit/pytest-modifyjunit-0.1.tar.gz BuildArch: noarch %if 0%{?with_python3} BuildRequires: python3-devel %else BuildRequires: python-devel %endif %if 0%{?fedora} Requires: python3-pytest %else Requires: pytest %else %endif %description pytest plugin to modify junit to add additional properties %prep %setup -qn %{project} %if 0%{?with_python3} echo %{py3dir} rm -rf %{py3dir} cp -a . %{py3dir} %endif %build %{__python2} setup.py build %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif %install %{__python2} setup.py install -O1 --skip-build --root %{buildroot} %if 0%{?with_python3} %py_byte_compile %{__python2} %{buildroot}%{python_sitelib}/%{srcname} %else %{__python2} -m compileall %{buildroot}%{python_sitelib}/%{srcname} %endif %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install --skip-build --root %{buildroot} %py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}/%{srcname} popd %endif %files %doc README.rst %if 0%{?fedora} %{python2_sitelib}/* %endif %if 0%{?with_python3} %{python3_sitelib}/* %else: %{python2_sitelib}/* %endif %changelog * Mon Nov 14 2016 Niranjan MR - 0.1-1 - initial version-