Blob Blame History Raw
%global srcname     fastavro
%global sum     Fast Avro for Python
%global _description    Apache Avro is a data serialization system. The current \
Python avro package is packed with features but dog slow. fastavro is less \
feature complete than avro, however it's much faster.

Name:       python-%{srcname}
Version:    0.17.3
Release:    2%{?dist}
Summary:    %{sum}

# Apache avro is under ASL 2.0
# etc
License:    ASL 2.0


%package -n python2-%{srcname}
Summary:        %{sum}
BuildRequires:  python2-devel
BuildRequires:  %{py2_dist setuptools}
BuildRequires:  %{py2_dist Cython}
BuildRequires:  %{py2_dist pytest}
BuildRequires:  %{py2_dist sphinx}
Requires:       %{py2_dist python-snappy}
Requires:       %{py2_dist ujson}

%{?python_provide:%python_provide python2-%{srcname}}

%description -n python2-%{srcname}

%package -n python3-%{srcname}
Summary:        %{sum}
BuildRequires:  python3-devel
BuildRequires:  %{py3_dist setuptools}
BuildRequires:  %{py3_dist Cython}
BuildRequires:  %{py3_dist pytest}
Requires:       %{py3_dist python-snappy}
Requires:       %{py3_dist ujson}
%{?python_provide:%python_provide python3-%{srcname}}

%description -n python3-%{srcname}

%package doc
Summary:        %{sum}
%description doc
Documentation for %{name}.

%autosetup -n %{srcname}-%{version}
rm -rf *.egg-info
# Remove cython constraint - the marked issue has been solved in Cython
sed -i "s/Cython>=.*',/Cython',/"
# We don't run the flake8 and manifest check tests so we remove this from the
# file to prevent it from trying to fetch stuff from pypi
sed -i "/tests_require=/d"


pushd docs
    PYTHONPATH=../ make html man
    pushd _build/html
        rm .buildinfo -f || exit -1
        sed -i 's/\r$//' objects.inv
        iconv -f iso8859-1 -t utf-8 objects.inv > objects.inv.conv && mv -fv objects.inv.conv objects.inv


# Install man page
install -v -p -D -m 0644 docs/_build/man/%{srcname}.1 %{buildroot}%{_mandir}/man1/%{srcname}.1 || exit -1

# Fail only on i686 for some reason. Issue filed upstream:
# %check
# %{__python2} build_ext --inplace
# PYTHONPATH=. pytest-2  tests
# %{__python3} build_ext --inplace
# PYTHONPATH=. pytest-3 tests

%files -n python2-%{srcname}
%license NOTICE.txt

%files -n python3-%{srcname}
%license NOTICE.txt

%files doc
%license NOTICE.txt
%doc docs/_build/html

* Mon Jan 22 2018 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.17.3-2
- Disable tests temporarily - fail on i686 only. Issue filed upstream.

* Sun Jan 21 2018 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.17.3-1
- Update for review (rhbz#1534787)
- Update to latest upstream release
- Generate separate doc subpackage for docs
- Install man page
- Rectify license
- Fix tests

* Mon Jan 15 2018 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.17.1-1
- Initial build