Blame python-jsonmodels.spec

Omer Anson fce3226
%global pypi_name jsonmodels
Omer Anson fce3226
# Tests require invoke, which is only available for Fedora
Omer Anson fce3226
%global use_tests 0%{?fedora:1}
Omer Anson fce3226
# Python3 is not available on centos
Omer Anson fce3226
%global is_install_py3 0%{?fedora:1}
Omer Anson fce3226
Summary: Create Python structures that are converted to, or read from JSON
Omer Anson fce3226
Name: python-jsonmodels
Omer Anson fce3226
Version: 2.2
Omer Anson fce3226
Release: 1%{?dist}
Omer Anson fce3226
Source0: https://github.com/beregond/%{pypi_name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Omer Anson fce3226
License: BSD
Omer Anson fce3226
BuildArch: noarch
Omer Anson fce3226
Url: https://github.com/beregond/jsonmodels
Omer Anson fce3226
Omer Anson fce3226
BuildRequires: python2-devel
Omer Anson fce3226
%if 0%{?use_tests:1}
Omer Anson fce3226
BuildRequires: python-invoke
Omer Anson fce3226
%endif
Omer Anson fce3226
%if 0%{?is_install_py3:1}
Omer Anson fce3226
BuildRequires: python3-devel
Omer Anson fce3226
BuildRequires: python3-invoke
Omer Anson fce3226
%endif
Omer Anson fce3226
Omer Anson fce3226
%description
Omer Anson fce3226
Models to make it easier to deal with structures that are converted to, or
Omer Anson fce3226
read from JSON.
Omer Anson fce3226
Omer Anson fce3226
%package -n     python2-%{pypi_name}
Omer Anson fce3226
Summary: %summary
Omer Anson fce3226
Omer Anson fce3226
BuildRequires: python-dateutil
Omer Anson fce3226
BuildRequires: pytest
Omer Anson fce3226
BuildRequires: python-pytest-cov
Omer Anson fce3226
BuildRequires: python-six
Omer Anson fce3226
Requires: python-dateutil
Omer Anson fce3226
Requires: python-six
Omer Anson fce3226
Omer Anson fce3226
%description -n     python2-%{pypi_name}
Omer Anson fce3226
Python 2 models to make it easier to deal with structures that are
Omer Anson fce3226
converted to, or read from JSON.
Omer Anson fce3226
Omer Anson fce3226
Omer Anson fce3226
%if %{is_install_py3}
Omer Anson fce3226
%package -n     python3-%{pypi_name}
Omer Anson fce3226
Summary: %summary
Omer Anson fce3226
Omer Anson fce3226
BuildRequires: python3-dateutil
Omer Anson fce3226
BuildRequires: python3-pytest
Omer Anson fce3226
BuildRequires: python3-pytest-cov
Omer Anson fce3226
BuildRequires: python3-six
Omer Anson fce3226
Requires: python3-dateutil
Omer Anson fce3226
Requires: python3-six
Omer Anson fce3226
Omer Anson fce3226
%description -n     python3-%{pypi_name}
Omer Anson fce3226
Python 3 models to make it easier to deal with structures that are
Omer Anson fce3226
converted to, or read from JSON.
Omer Anson fce3226
%endif
Omer Anson fce3226
Omer Anson fce3226
%prep
Omer Anson fce3226
%setup -q -n %{pypi_name}-%{version}
Omer Anson fce3226
Omer Anson fce3226
%build
Omer Anson fce3226
%py2_build
Omer Anson fce3226
%if 0%{?py3_build:1}
Omer Anson fce3226
%py3_build
Omer Anson fce3226
%endif
Omer Anson fce3226
Omer Anson fce3226
%install
Omer Anson fce3226
%py2_install
Omer Anson fce3226
%if 0%{?py3_install:1}
Omer Anson fce3226
%py3_install
Omer Anson fce3226
%endif
Omer Anson fce3226
Omer Anson fce3226
%if %{use_tests}
Omer Anson fce3226
%check
Omer Anson fce3226
PYTHONPATH=$(pwd) %{__python2} setup.py test
Omer Anson fce3226
PYTHONPATH=$(pwd) %{__python3} setup.py test
Omer Anson fce3226
%endif
Omer Anson fce3226
Omer Anson fce3226
%files -n python2-%{pypi_name}
Omer Anson fce3226
%license LICENSE
Omer Anson fce3226
%doc README.rst
Omer Anson fce3226
%{python2_sitelib}/%{pypi_name}-%{version}-py%{python2_version}.egg-info
Omer Anson fce3226
%{python2_sitelib}/%{pypi_name}/
Omer Anson fce3226
Omer Anson fce3226
%if %{is_install_py3}
Omer Anson fce3226
%files -n python3-%{pypi_name}
Omer Anson fce3226
%license LICENSE
Omer Anson fce3226
%doc README.rst
Omer Anson fce3226
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
Omer Anson fce3226
%{python3_sitelib}/%{pypi_name}/
Omer Anson fce3226
%endif
Omer Anson fce3226
Omer Anson fce3226
%changelog
Omer Anson fce3226
* Wed Nov 15 2017 Omer Anson <oaanson@gmail.com> 2.2-1
Omer Anson fce3226
- Initial release