File package.diff of Package python-funcparserlib

--- python-funcparserlib.spec.orig
+++ python-funcparserlib.spec
@@ -55,18 +55,41 @@ as well as a tiny lexer generator for to
 
 %prep
 %setup -q -n funcparserlib-%{version}
+%ifpython2
+cp -pr . ../funcparserlib-%{version}-python2
+%endif
 python-modernize -nw funcparserlib/
 sed -i "s/ur'/r'/" funcparserlib/tests/*.py
 
 %build
+%ifpython2
+%python3_build
+cd ../funcparserlib-%{version}-python2
+%python2_build
+%else
 %python_build
+%endif
 
 %install
+%ifpython2
+%python3_install
+cd ../funcparserlib-%{version}-python2
+%python2_install
+%else
 %python_install
+%endif
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 
 %check
+%ifpython2
+%{python_expand PYTHONPATH=%{buildroot}%{$python_sitelib}
+PYTHONDONTWRITEBYTECODE=1
+[ "$python" = "python2" ] && { cd ../funcparserlib-%{version}-python2; } || { cd ../funcparserlib-%{version}; }
+pytest-%{$python_bin_suffix} --ignore=_build.python2 --ignore=_build.python3 -v
+}
+%else
 %pytest
+%endif
 
 %files %{python_files}
 %license LICENSE
openSUSE Build Service is sponsored by