%global srcname django-pgjson %global modname %(n=%{srcname}; echo ${n//-/_}) # Tests are requiring PgSQL running %bcond_with tests Name: python-%{srcname} Version: 0.3.1 Release: 1%{?dist} Summary: PostgreSQL json field support for Django License: BSD URL: https://djangonauts.github.io/django-pgjson/ Source0: https://github.com/djangonauts/django-pgjson/archive/%{version}/%{srcname}-%{version}.tar.gz BuildArch: noarch %description %{summary}. %package -n python2-%{srcname} Summary: %{summary} %{?python_provide:%python_provide python2-%{srcname}} BuildRequires: python2-devel BuildRequires: python2-setuptools %if %{with tests} BuildRequires: python2-django BuildRequires: python2-psycopg2 %endif Requires: python2-django Requires: python2-psycopg2 %description -n python2-%{srcname} %{summary}. Python 2 version. %package -n python3-%{srcname} Summary: %{summary} %{?python_provide:%python_provide python3-%{srcname}} BuildRequires: python3-devel BuildRequires: python3-setuptools %if %{with tests} BuildRequires: python3-django BuildRequires: python3-psycopg2 %endif Requires: python3-django Requires: python3-psycopg2 %description -n python3-%{srcname} %{summary}. Python 3 version. %prep %autosetup -n %{srcname}-%{version} %build %py2_build %py3_build %install %py2_install %py3_install %if %{with tests} %check %global cpus %(f=%{_smp_mflags}; echo ${f#-j}) %{__python2} runtests.py --parallel %{cpus} %{__python3} runtests.py --parallel %{cpus} %endif %files -n python2-%{srcname} %license LICENSE %doc CHANGES.txt %{python2_sitelib}/%{modname}-*.egg-info/ %{python2_sitelib}/%{modname}/ %files -n python3-%{srcname} %license LICENSE %doc CHANGES.txt %{python3_sitelib}/%{modname}-*.egg-info/ %{python3_sitelib}/%{modname}/ %changelog * Fri Aug 26 2016 Igor Gnatenko - 0.3.1-1 - Initial package