diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5f8ecb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/fastavro-0.17.3.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index d5a012c..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# python-fastavro - -Fast Avro for Python \ No newline at end of file diff --git a/python-fastavro.spec b/python-fastavro.spec new file mode 100644 index 0000000..4c9744f --- /dev/null +++ b/python-fastavro.spec @@ -0,0 +1,121 @@ +%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: 1%{?dist} +Summary: %{sum} + +# https://github.com/tebeka/fastavro/issues/60 +# Apache avro is under ASL 2.0 +# https://avro.apache.org/docs/1.8.2/api/cpp/html/ResolvingReader_8hh_source.html etc +License: ASL 2.0 +URL: https://github.com/tebeka/%{srcname} +Source0: https://github.com/tebeka/%{srcname}/archive/%{version}/%{srcname}-%{version}.tar.gz + +%description +%{_description} + +%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} +%{_description} + + + +%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} +%{_description} + +%package doc +Summary: %{sum} +%description doc +Documentation for %{name}. + +%prep +%autosetup -n %{srcname}-%{version} +rm -rf *.egg-info +# Remove cython constraint - the marked issue has been solved in Cython +sed -i "s/Cython>=.*',/Cython',/" setup.py +# We don't run the flake8 and manifest check tests so we remove this from the +# setup.py file to prevent it from trying to fetch stuff from pypi +sed -i "/tests_require=/d" setup.py + +%build +%py2_build +%py3_build + +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 + popd +popd + + +%install +%py2_install +%py3_install + +# Install man page +install -v -p -D -m 0644 docs/_build/man/%{srcname}.1 %{buildroot}%{_mandir}/man1/%{srcname}.1 || exit -1 + +%check +%{__python2} setup.py build_ext --inplace +PYTHONPATH=. pytest-2 tests + +%{__python3} setup.py build_ext --inplace +PYTHONPATH=. pytest-3 tests + +%files -n python2-%{srcname} +%license NOTICE.txt +%{python2_sitearch}/%{srcname}-%{version}-py?.?.egg-info +%{python2_sitearch}/%{srcname}/ + +%files -n python3-%{srcname} +%license NOTICE.txt +%{python3_sitearch}/%{srcname}-%{version}-py?.?.egg-info +%{python3_sitearch}/%{srcname}/ +%{_bindir}/%{srcname} +%{_mandir}/man1/%{srcname}.* + +%files doc +%doc README.md +%license NOTICE.txt +%doc docs/_build/html + +%changelog +* Sun Jan 21 2018 Ankur Sinha - 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 - 0.17.1-1 +- Initial build diff --git a/sources b/sources new file mode 100644 index 0000000..10b6bdf --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (fastavro-0.17.3.tar.gz) = 53a9306314b136a23a51b9693cb875f043a606bf43ca87ff07fd41481ef772c2bf364d1302263e3395b3779693a036035f2b29b60a0bab93c574ee58dcc31714