0986900
%global srcname     fastavro
0986900
%global sum     Fast Avro for Python
0986900
%global _description    Apache Avro is a data serialization system. The current \
0986900
Python avro package is packed with features but dog slow. fastavro is less \
0986900
feature complete than avro, however it's much faster.
0986900
0986900
Name:       python-%{srcname}
0986900
Version:    0.17.3
aabe561
Release:    2%{?dist}
0986900
Summary:    %{sum}
0986900
0986900
# https://github.com/tebeka/fastavro/issues/60
0986900
# Apache avro is under ASL 2.0
0986900
# https://avro.apache.org/docs/1.8.2/api/cpp/html/ResolvingReader_8hh_source.html etc
0986900
License:    ASL 2.0
0986900
URL:        https://github.com/tebeka/%{srcname}
0986900
Source0:    https://github.com/tebeka/%{srcname}/archive/%{version}/%{srcname}-%{version}.tar.gz
0986900
0986900
%description
0986900
%{_description}
0986900
0986900
%package -n python2-%{srcname}
0986900
Summary:        %{sum}
0986900
BuildRequires:  python2-devel
0986900
BuildRequires:  %{py2_dist setuptools}
0986900
BuildRequires:  %{py2_dist Cython}
0986900
BuildRequires:  %{py2_dist pytest}
0986900
BuildRequires:  %{py2_dist sphinx}
0986900
Requires:       %{py2_dist python-snappy}
0986900
Requires:       %{py2_dist ujson}
0986900
0986900
%{?python_provide:%python_provide python2-%{srcname}}
0986900
0986900
%description -n python2-%{srcname}
0986900
%{_description}
0986900
0986900
0986900
0986900
%package -n python3-%{srcname}
0986900
Summary:        %{sum}
0986900
BuildRequires:  python3-devel
0986900
BuildRequires:  %{py3_dist setuptools}
0986900
BuildRequires:  %{py3_dist Cython}
0986900
BuildRequires:  %{py3_dist pytest}
0986900
Requires:       %{py3_dist python-snappy}
0986900
Requires:       %{py3_dist ujson}
0986900
%{?python_provide:%python_provide python3-%{srcname}}
0986900
0986900
%description -n python3-%{srcname}
0986900
%{_description}
0986900
0986900
%package doc
0986900
Summary:        %{sum}
0986900
%description doc
0986900
Documentation for %{name}.
0986900
0986900
%prep
0986900
%autosetup -n %{srcname}-%{version}
0986900
rm -rf *.egg-info
0986900
# Remove cython constraint - the marked issue has been solved in Cython
0986900
sed -i "s/Cython>=.*',/Cython',/" setup.py
0986900
# We don't run the flake8 and manifest check tests so we remove this from the
0986900
# setup.py file to prevent it from trying to fetch stuff from pypi
0986900
sed -i "/tests_require=/d" setup.py
0986900
0986900
%build
0986900
%py2_build
0986900
%py3_build
0986900
0986900
pushd docs
0986900
    PYTHONPATH=../ make html man
0986900
    pushd _build/html
0986900
        rm .buildinfo -f || exit -1
0986900
        sed -i 's/\r$//' objects.inv
0986900
        iconv -f iso8859-1 -t utf-8 objects.inv > objects.inv.conv && mv -fv objects.inv.conv objects.inv
0986900
    popd
0986900
popd
0986900
0986900
0986900
%install
0986900
%py2_install
0986900
%py3_install
0986900
0986900
# Install man page
0986900
install -v -p -D -m 0644 docs/_build/man/%{srcname}.1 %{buildroot}%{_mandir}/man1/%{srcname}.1 || exit -1
0986900
aabe561
# Fail only on i686 for some reason. Issue filed upstream:
aabe561
# https://github.com/tebeka/fastavro/issues/147
aabe561
# %check
aabe561
# %{__python2} setup.py build_ext --inplace
aabe561
# PYTHONPATH=. pytest-2  tests
aabe561
#
aabe561
# %{__python3} setup.py build_ext --inplace
aabe561
# PYTHONPATH=. pytest-3 tests
0986900
0986900
%files -n python2-%{srcname}
0986900
%license NOTICE.txt
0986900
%{python2_sitearch}/%{srcname}-%{version}-py?.?.egg-info
0986900
%{python2_sitearch}/%{srcname}/
0986900
0986900
%files -n python3-%{srcname}
0986900
%license NOTICE.txt
0986900
%{python3_sitearch}/%{srcname}-%{version}-py?.?.egg-info
0986900
%{python3_sitearch}/%{srcname}/
0986900
%{_bindir}/%{srcname}
0986900
%{_mandir}/man1/%{srcname}.*
0986900
0986900
%files doc
0986900
%doc README.md
0986900
%license NOTICE.txt
0986900
%doc docs/_build/html
0986900
0986900
%changelog
aabe561
* Mon Jan 22 2018 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.17.3-2
aabe561
- Disable tests temporarily - fail on i686 only. Issue filed upstream.
aabe561
0986900
* Sun Jan 21 2018 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.17.3-1
0986900
- Update for review (rhbz#1534787)
0986900
- Update to latest upstream release
0986900
- Generate separate doc subpackage for docs
0986900
- Install man page
0986900
- Rectify license
0986900
- Fix tests
0986900
0986900
* Mon Jan 15 2018 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 0.17.1-1
0986900
- Initial build