%global with_python3 1 Summary: Mercurial Python library Name: python-hglib Version: 1.6 Release: 2%{?dist} License: MIT URL: http://selenic.com/repo/python-hglib Source0: https://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz BuildArch: noarch BuildRequires: mercurial BuildRequires: python-devel BuildRequires: python-nose %if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3-nose %endif %description python-hglib is a library with a fast, convenient interface to Mercurial. It uses Mercurials command server for communication with hg. %if 0%{?with_python3} %package -n python3-hglib Summary: Mercurial Python library %description -n python3-hglib python-hglib is a library with a fast, convenient interface to Mercurial. It uses Mercurials command server for communication with hg. This is the Python 3 build of python-hglib. %endif %prep %setup -q %if 0%{?with_python3} 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} pushd %{py3dir} %{__python3} setup.py install -O1 --skip-build --root %{buildroot} %endif %check %{__python2} test.py --with-doctest %if 0%{?with_python3} pushd %{py3dir} %{__python3} test.py --with-doctest %endif %files %license LICENSE %{python2_sitelib}/hglib %{python2_sitelib}/python_hglib-*-py*.egg-info %if 0%{?with_python3} %files -n python3-hglib %license LICENSE %{python3_sitelib}/hglib %{python3_sitelib}/python_hglib-*-py*egg-info %endif %changelog * Wed Jun 24 2015 Terje Rosten - 1.6-2 - use license macro (bz #1231330) * Fri Jun 12 2015 Terje Rosten - 1.6-1 - initial package