%if 0%{?fedora}
%bcond_without python3
%else
%global with_python3 0
%{!?__python2: %global __python2 %{__python}}
%{!?python2_sitelib: %global python2_sitelib %{python_sitelib}}
%endif
%global pkgname django-fas
Name: python-%{pkgname}
Version: 1.0.2
Release: 1%{?dist}
Summary: Django auth backend for FAS (Fedora Accounts System)
Group: Development/Libraries
License: BSD
URL: https://github.com/misli/%{pkgname}/
Source0: http://github.srcurl.net/misli/%{pkgname}/%{version}/%{pkgname}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%endif
Requires: python-django
Requires: python-openid
Provides: %{pkgname} = %{version}-%{release}
%description
This is Django auth backend for FAS (Fedora Accounts System).
%if 0%{?with_python3}
%package -n python3-%{pkgname}
Summary: Django auth backend for FAS (Fedora Accounts System)
Group: Development/Libraries
Requires: python3-django
Requires: python3-openid
Provides: %{pkgname} = %{version}-%{release}
%description -n python3-%{pkgname}
This is Django auth backend for FAS (Fedora Accounts System).
%endif
%prep
%setup -q -n %{pkgname}-%{version}
%if 0%{?with_python3}
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 --skip-build --root %{buildroot}
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root %{buildroot}
popd
%endif
%files
%doc LICENSE README.md
%dir %{python2_sitelib}/fas
%{python2_sitelib}/fas/*.py*
%{python2_sitelib}/django_fas-%{version}-py2.*.egg-info
%if 0%{?with_python3}
%files -n python3-%{pkgname}
%doc LICENSE README.md
%dir %{python3_sitelib}/fas
%{python3_sitelib}/fas/*.py
%dir %{python3_sitelib}/fas/__pycache__
%{python3_sitelib}/fas/__pycache__/*.py*
%{python3_sitelib}/django_fas-%{version}-py3.*.egg-info
%endif
%changelog
* Mon May 4 2015 Jakub Dorňák <jdornak@redhat.com> - 1.0.2-1
- Initial package