%global commit d2a380ed1506ee483cda3b576227f649b0da109b
%global shortcommit %(c=%{commit}; echo ${c:0:7})
+# compatibility macros
%{!?py2_build:%global py2_build %{__python2} setup.py build --executable="%{__python2} -s"}
%{!?py2_install:%global py2_install %{__python2} setup.py install -O1 --skip-build --root %{buildroot}}
%{!?py3_build:%global py3_build %{__python3} setup.py build --executable="%{__python3} -s"}
%{!?py3_install:%global py3_install %{__python3} setup.py install -O1 --skip-build --root %{buildroot}}
+%if 0%{?rhel} && 0%{?rhel} <= 6
+%{!?__python2: %global __python2 /usr/bin/python2}
+%{!?python2_version: %global python2_version %(%{__python2} -c "import sys; sys.stdout.write(sys.version[:3])")}
+%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
+%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
+%endif
%if 0%{?rhel}
%global with_python3 0
%global with_python3 1
%endif
+%if 0%{?rhel} && 0%{?rhel} <= 6
+%global with_tests 0
+%else
+%global with_tests 1
+%endif
+
Name: python-%{srcname}
Version: 0.0.1
Release: 0.20150826git%{shortcommit}%{?dist}
%check
+%if 0%{?with_tests}
pushd python2
%{__python2} setup.py test
popd
%{__python3} ./test_parse_uri.py
popd
%endif
+%endif
+
+%{!?_licensedir:%global license %doc}
%files -n python2-%{srcname}
%license python2/LICENSE