File python-django-nose.spec of Package python-django-nose

%global pkgname django-nose

%if 0%{?fedora} < 35
%global with_python2 1
%else
%global with_python2 0
%endif

%if 0%{?fedora} >= 22
%global with_python3 1
%else
%global with_python3 0
%endif

Name:           python-%{pkgname}
Version:        1.4.7
Release:        1%{?dist}
Summary:        Django test runner that uses nose

License:        BSD
URL:            https://github.com/jbalogh/django-nose
Source0:        https://files.pythonhosted.org/packages/source/d/%{pkgname}/%{pkgname}-%{version}.tar.gz

BuildArch:      noarch


%global _description\
Django test runner that uses nose.

%description %_description

%if 0%{?with_python2}
%package -n python2-%{pkgname}
Summary: %summary
BuildRequires:  python2-devel
BuildRequires:  python2-setuptools
Requires:       python2-nose
Requires:       python2-django
Provides:       %{pkgname} = %{version}-%{release}
%{?python_provide:%python_provide python2-%{pkgname}}

%description -n python2-%{pkgname} %_description

%endif

%if 0%{?with_python3}
%package -n python3-%{pkgname}
Summary:        Django test runner that uses nose
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
Requires:       python3-nose
Requires:       python3-django

%description -n python3-%{pkgname}
Django test runner that uses nose.

%endif

%prep
%setup -q -n %{pkgname}-%{version}

%build
%if 0%{?with_python2}
%py2_build
%endif
%if 0%{?with_python3}
%py3_build
%endif


%install
%if 0%{?with_python2}
%py2_install
%endif
%if 0%{?with_python3}
%py3_install
%endif

# remove testapp
rm -rf %{buildroot}/%{python2_sitelib}/testapp
rm -rf %{buildroot}/%{python3_sitelib}/testapp


%if 0%{?with_python2}
%files -n python2-%{pkgname}
%doc README.rst
%license LICENSE
%{python2_sitelib}/django_nose
%{python2_sitelib}/django_nose-%{version}-py*.*.egg-info
%endif

%if 0%{?with_python3}
%files -n python3-%{pkgname}
%doc README.rst
%license LICENSE
%{python3_sitelib}/django_nose
%{python3_sitelib}/django_nose-%{version}-py*.*.egg-info
%endif