f7f032d
%global pypi_name dbfread
f7f032d
%global project_owner olemb
f7f032d
%global github_name dbfread
f7f032d
%global commit 300b2d7d907388cc3578d3fa4472e0419ccd34b9
f7f032d
%global shortcommit %(c=%{commit}; echo ${c:0:7})
f7f032d
%global desc DBF is a file format used by databases such dBase, Visual FoxPro, and \
f7f032d
FoxBase+. This library reads DBF files and returns the data as native Python \
f7f032d
data types for further processing. It is primarily intended for batch jobs and \
f7f032d
one-off scripts.\
f7f032d
\
f7f032d
Full documentation at https://dbfread.readthedocs.io/\
f7f032d
\
f7f032d
See docs/changes.rst for a full list of changes in each version.
f7f032d
f7f032d
f7f032d
Name:           python-%{pypi_name}
f7f032d
Version:        2.0.7
d39af08
Release:        7.git%{shortcommit}%{?dist}
f7f032d
Summary:        Read DBF Files with Python
f7f032d
f7f032d
License:        MIT
f7f032d
URL:            https://pypi.python.org/pypi/dbfread
f7f032d
Source0:        https://github.com/%{project_owner}/%{github_name}/archive/%{commit}/%{github_name}-%{commit}.tar.gz
f7f032d
BuildArch:      noarch
f7f032d
f7f032d
%description
f7f032d
%{desc}
f7f032d
f7f032d
f7f032d
%package -n     python2-%{pypi_name}
f7f032d
BuildRequires:  python2-devel
f7f032d
BuildRequires:  python2-pytest
f7f032d
Summary:        %{summary}
f7f032d
%{?python_provide:%python_provide python2-%{pypi_name}}
f7f032d
f7f032d
%description -n python2-%{pypi_name}
f7f032d
%{desc}
f7f032d
f7f032d
f7f032d
%package -n     python3-%{pypi_name}
f7f032d
Summary:        %{summary}
f7f032d
BuildRequires:  python3-devel
f7f032d
BuildRequires:  python3-pytest
f7f032d
%{?python_provide:%python_provide python3-%{pypi_name}}
f7f032d
f7f032d
%description -n python3-%{pypi_name}
f7f032d
%{desc}
f7f032d
f7f032d
f7f032d
%package -n    python-%{pypi_name}-doc
f7f032d
Summary:       %{summary}
f7f032d
BuildRequires: python2-sphinx
f7f032d
BuildArch:     noarch
f7f032d
f7f032d
%description -n python-%{pypi_name}-doc
f7f032d
%{desc}
f7f032d
f7f032d
Documentation package.
f7f032d
f7f032d
f7f032d
%prep
f7f032d
%setup -qn %{github_name}-%{commit}
f7f032d
# Remove shebang in examples
f7f032d
sed -i '1{\@^#!/usr/bin/env python@d}' examples/{*.py,**/*.py,dbf2sqlite}
f7f032d
# Make sure examples are not executable
f7f032d
chmod -x examples/{*.py,**/*.py,dbf2sqlite}
f7f032d
f7f032d
f7f032d
%build
f7f032d
%py2_build
f7f032d
%py3_build
f7f032d
f7f032d
# Build documentation
f7f032d
pushd docs
f7f032d
    make html
f7f032d
    rm -f _build/html/.buildinfo
f7f032d
popd
f7f032d
f7f032d
f7f032d
%install
f7f032d
%py3_install
f7f032d
%py2_install
f7f032d
f7f032d
f7f032d
%check
f7f032d
# The script will launch pytest for Python 2 and 3.
f7f032d
python3 run_tests.py
f7f032d
f7f032d
f7f032d
%files -n python2-%{pypi_name}
f7f032d
%doc README.rst
f7f032d
%license LICENSE
f7f032d
%{python2_sitelib}/%{pypi_name}-%{version}-py%{python2_version}.egg-info/
f7f032d
%{python2_sitelib}/%{pypi_name}/
f7f032d
f7f032d
f7f032d
%files -n python3-%{pypi_name}
f7f032d
%doc README.rst
f7f032d
%license LICENSE
f7f032d
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info/
f7f032d
%{python3_sitelib}/%{pypi_name}/
f7f032d
f7f032d
f7f032d
%files -n python-%{pypi_name}-doc
f7f032d
%license LICENSE
f7f032d
%doc README.rst docs/_build/ examples
f7f032d
f7f032d
f7f032d
%changelog
d39af08
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.7-7.git300b2d7
d39af08
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
d39af08
b7f1b5f
* Tue Jun 19 2018 Miro HronĨok <mhroncok@redhat.com> - 2.0.7-6.git300b2d7
b7f1b5f
- Rebuilt for Python 3.7
b7f1b5f
a49490f
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.7-5.git300b2d7
a49490f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
a49490f
f818abe
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.7-4.git300b2d7
f818abe
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
f818abe
f7f032d
* Tue Apr 04 2017 Julien Enselme <jujens@jujens.eu> - 2.0.7-3.git300b2d7
f7f032d
- Fix shebang in examples
f7f032d
f7f032d
* Mon Mar 13 2017 Julien Enselme <jujens@jujens.eu> - 2.0.7-2.git300b2d7
f7f032d
- Add dependency to sphinx to build the documentation
f7f032d
f7f032d
* Sun Mar 12 2017 Julien Enselme <jujens@jujens.eu> - 2.0.7-1.git300b2d7
f7f032d
- Inital package