%global with_python3 1 %global srcname restauth-common Name: python-restauth-common Version: 0.5.1 Release: 3%{?dist} Summary: Python module containing classes used by both RestAuth server/client Group: Development/Languages License: GPLv3+ URL: https://common.restauth.net/ Source0: https://common.restauth.net/download/%{srcname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python-sphinx BuildRequires: python2-devel %if 0%{?with_python3} BuildRequires: python3-devel %endif # if with_python3 %description RestAuthCommon is a small project that collects various code that is used in both server and client reference implementations of the RestAuth protocol, which are both written in python. %if 0%{?with_python3} %package -n python3-restauth-common Summary: Python module containing classes used by both RestAuth server/client Group: Development/Languages %description -n python3-restauth-common RestAuthCommon is a small project that collects various code that is used in both server and client reference implementations of the RestAuth protocol, which are both written in python. %endif # if with_python3 %package doc Summary: RestAuthCommon Documentation Group: Documentation Requires: python-restauth-common = %{version}-%{release} %description doc Documentation for RestAuthCommon %prep %setup -q -n %{srcname}-%{version} %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} %endif # with_python3 %build CFLAGS="%{optflags}" %{__python} setup.py build %if 0%{?with_python3} pushd %{py3dir} CFLAGS="%{optflags}" %{__python3} setup.py build popd %endif # with_python3 %{__python} setup.py build_doc %install # Must do the python3 install first because the scripts in /usr/bin are # overwritten with every setup.py install (and we want the python2 version # to be the default for now). %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install --skip-build --root %{buildroot} rm -rf %{py3dir}/usr/share/doc/* popd %endif # with_python3 %{__python} setup.py install --skip-build --root %{buildroot} rm -rf %{buildroot}/usr/share/doc/* # Install doc cp -a ./doc/_build/html ./ rm -f html/\.buildinfo %files %doc AUTHORS COPYING COPYRIGHT ChangeLog %{python_sitelib}/* %if 0%{?with_python3} %files -n python3-restauth-common %doc AUTHORS COPYING COPYRIGHT ChangeLog %{python3_sitelib}/* %endif # with_python3 %files doc %doc html %changelog * Mon Nov 28 2011 Jan Kaluza <jkaluza@redhat.com> - 0.5.1-3 - shorter Summary - fixed rpmlint warnings * Tue Nov 22 2011 Jan Kaluza <jkaluza@redhat.com> - 0.5.1-2 - include docs * Wed Nov 02 2011 Jan Kaluza <jkaluza@redhat.com> - 0.5.1-1 - Initial version