Blob Blame History Raw
%global pypi_name dbfread
%global project_owner olemb
%global github_name dbfread
%global commit 300b2d7d907388cc3578d3fa4472e0419ccd34b9
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global desc DBF is a file format used by databases such dBase, Visual FoxPro, and \
FoxBase+. This library reads DBF files and returns the data as native Python \
data types for further processing. It is primarily intended for batch jobs and \
one-off scripts.\
Full documentation at\
See docs/changes.rst for a full list of changes in each version.

Name:           python-%{pypi_name}
Version:        2.0.7
Release:        3.git%{shortcommit}%{?dist}
Summary:        Read DBF Files with Python

License:        MIT
BuildArch:      noarch


%package -n     python2-%{pypi_name}
BuildRequires:  python2-devel
BuildRequires:  python2-pytest
Summary:        %{summary}
%{?python_provide:%python_provide python2-%{pypi_name}}

%description -n python2-%{pypi_name}

%package -n     python3-%{pypi_name}
Summary:        %{summary}
BuildRequires:  python3-devel
BuildRequires:  python3-pytest
%{?python_provide:%python_provide python3-%{pypi_name}}

%description -n python3-%{pypi_name}

%package -n    python-%{pypi_name}-doc
Summary:       %{summary}
BuildRequires: python2-sphinx
BuildArch:     noarch

%description -n python-%{pypi_name}-doc

Documentation package.

%setup -qn %{github_name}-%{commit}
# Remove shebang in examples
sed -i '1{\@^#!/usr/bin/env python@d}' examples/{*.py,**/*.py,dbf2sqlite}
# Make sure examples are not executable
chmod -x examples/{*.py,**/*.py,dbf2sqlite}


# Build documentation
pushd docs
    make html
    rm -f _build/html/.buildinfo


# The script will launch pytest for Python 2 and 3.

%files -n python2-%{pypi_name}
%doc README.rst
%license LICENSE

%files -n python3-%{pypi_name}
%doc README.rst
%license LICENSE

%files -n python-%{pypi_name}-doc
%license LICENSE
%doc README.rst docs/_build/ examples

* Tue Apr 04 2017 Julien Enselme <> - 2.0.7-3.git300b2d7
- Fix shebang in examples

* Mon Mar 13 2017 Julien Enselme <> - 2.0.7-2.git300b2d7
- Add dependency to sphinx to build the documentation

* Sun Mar 12 2017 Julien Enselme <> - 2.0.7-1.git300b2d7
- Inital package