f7f032
%global pypi_name dbfread
f7f032
%global project_owner olemb
f7f032
%global github_name dbfread
f7f032
%global commit 300b2d7d907388cc3578d3fa4472e0419ccd34b9
f7f032
%global shortcommit %(c=%{commit}; echo ${c:0:7})
f7f032
%global desc DBF is a file format used by databases such dBase, Visual FoxPro, and \
f7f032
FoxBase+. This library reads DBF files and returns the data as native Python \
f7f032
data types for further processing. It is primarily intended for batch jobs and \
f7f032
one-off scripts.\
f7f032
\
f7f032
Full documentation at https://dbfread.readthedocs.io/\
f7f032
\
f7f032
See docs/changes.rst for a full list of changes in each version.
f7f032
f7f032
f7f032
Name:           python-%{pypi_name}
f7f032
Version:        2.0.7
5038eb
Release:        16.git%{shortcommit}%{?dist}
f7f032
Summary:        Read DBF Files with Python
f7f032
f7f032
License:        MIT
f7f032
URL:            https://pypi.python.org/pypi/dbfread
f7f032
Source0:        https://github.com/%{project_owner}/%{github_name}/archive/%{commit}/%{github_name}-%{commit}.tar.gz
128bf9
# Fix tests with pytest4
128bf9
Patch0:         https://patch-diff.githubusercontent.com/raw/olemb/dbfread/pull/33.patch
f7f032
BuildArch:      noarch
f7f032
f7f032
%description
f7f032
%{desc}
f7f032
f7f032
f7f032
%package -n     python3-%{pypi_name}
f7f032
Summary:        %{summary}
f7f032
BuildRequires:  python3-devel
f7f032
BuildRequires:  python3-pytest
f7f032
%{?python_provide:%python_provide python3-%{pypi_name}}
f7f032
f7f032
%description -n python3-%{pypi_name}
f7f032
%{desc}
f7f032
f7f032
f7f032
%package -n    python-%{pypi_name}-doc
f7f032
Summary:       %{summary}
4cadc5
BuildRequires:  python3dist(sphinx)
f7f032
BuildArch:     noarch
f7f032
f7f032
%description -n python-%{pypi_name}-doc
f7f032
%{desc}
f7f032
f7f032
Documentation package.
f7f032
f7f032
f7f032
%prep
f7f032
%setup -qn %{github_name}-%{commit}
f7f032
# Remove shebang in examples
f7f032
sed -i '1{\@^#!/usr/bin/env python@d}' examples/{*.py,**/*.py,dbf2sqlite}
f7f032
# Make sure examples are not executable
f7f032
chmod -x examples/{*.py,**/*.py,dbf2sqlite}
128bf9
%patch0 -p1
f7f032
f7f032
f7f032
%build
f7f032
%py3_build
f7f032
f7f032
# Build documentation
f7f032
pushd docs
4cadc5
    make html SPHINXBUILD=sphinx-build-%{python3_version}
f7f032
    rm -f _build/html/.buildinfo
f7f032
popd
f7f032
f7f032
f7f032
%install
f7f032
%py3_install
f7f032
f7f032
f7f032
%check
f7f032
# The script will launch pytest for Python 2 and 3.
4cadc5
pytest-%{python3_version}
f7f032
f7f032
f7f032
%files -n python3-%{pypi_name}
f7f032
%doc README.rst
f7f032
%license LICENSE
f7f032
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info/
f7f032
%{python3_sitelib}/%{pypi_name}/
f7f032
f7f032
f7f032
%files -n python-%{pypi_name}-doc
f7f032
%license LICENSE
f7f032
%doc README.rst docs/_build/ examples
f7f032
f7f032
f7f032
%changelog
5038eb
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.7-16.git300b2d7
5038eb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
5038eb
6226c9
* Tue May 26 2020 Miro Hron훾ok <mhroncok@redhat.com> - 2.0.7-15.git300b2d7
6226c9
- Rebuilt for Python 3.9
6226c9
43ce11
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.7-14.git300b2d7
43ce11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
43ce11
ee25d8
* Thu Oct 03 2019 Miro Hron훾ok <mhroncok@redhat.com> - 2.0.7-13.git300b2d7
ee25d8
- Rebuilt for Python 3.8.0rc1 (#1748018)
ee25d8
e5e54f
* Mon Aug 19 2019 Miro Hron훾ok <mhroncok@redhat.com> - 2.0.7-12.git300b2d7
e5e54f
- Rebuilt for Python 3.8
e5e54f
e2591a
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.7-11.git300b2d7
e2591a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
e2591a
128bf9
* Sat Jul 13 2019 Julien Enselme <jujens@jujens.eu> - 2.0.7-10.git300b2d7
128bf9
- Fix tests with pytest4
128bf9
478deb
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.7-9.git300b2d7
478deb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
478deb
4cadc5
* Wed Jan 02 2019 Julien Enselme <jujens@jujens.eu> - 2.0.7-8
4cadc5
- Remove Python 2 subpackage
4cadc5
d39af0
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.7-7.git300b2d7
d39af0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
d39af0
b7f1b5
* Tue Jun 19 2018 Miro Hron훾ok <mhroncok@redhat.com> - 2.0.7-6.git300b2d7
b7f1b5
- Rebuilt for Python 3.7
b7f1b5
a49490
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.7-5.git300b2d7
a49490
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
a49490
f818ab
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.7-4.git300b2d7
f818ab
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
f818ab
f7f032
* Tue Apr 04 2017 Julien Enselme <jujens@jujens.eu> - 2.0.7-3.git300b2d7
f7f032
- Fix shebang in examples
f7f032
f7f032
* Mon Mar 13 2017 Julien Enselme <jujens@jujens.eu> - 2.0.7-2.git300b2d7
f7f032
- Add dependency to sphinx to build the documentation
f7f032
f7f032
* Sun Mar 12 2017 Julien Enselme <jujens@jujens.eu> - 2.0.7-1.git300b2d7
f7f032
- Inital package