File python-dbf.spec of Package python-dbf

#
# spec file for package python-dbf
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define _pyname dbf

Name:           python-dbf
Version:        0.96.005
Release:        0
Summary:        Pure python package for reading/writing dBase, FoxPro, and Visual FoxPro .dbf
License:        BSD-3-Clause
Group:          Development/Languages/Python
Url:            https://pypi.python.org/pypi/%{_pyname}
Source:         http://pypi.python.org/packages/source/d/%{_pyname}/%{_pyname}-%{version}.tar.gz
# Added from upstream license
Source1:        LICENSE
BuildRequires:  fdupes
BuildRequires:  python
BuildRequires:  python-devel
BuildRequires:  python-setuptools
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch:      noarch
%endif


%description
Pure python package for reading/writing dBase, FoxPro, and Visual FoxPro .dbf
files (including memos)

Currently supports dBase III, Clipper, FoxPro, and Visual FoxPro tables. Text is
returned as unicode, and codepage settings in tables are honored. Memos and Null
fields are supported.

%prep
%setup -q -n %{_pyname}-%{version}
# rem remove py2 version
rm -f dbf/ver_2.py
# Fix wrong encoding line
sed -i 's/\r//' dbf/README.md
sed -i 's/\r//' dbf/WHATSNEW

cp %{S:1} .

%build
#nothing to do install relaunch build
#python setup.py build

%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%fdupes %{buildroot}%{_prefix}

%files
%defattr(-,root,root,-)
%doc dbf/README.md dbf/WHATSNEW LICENSE
%{python_sitelib}/%{_pyname}-%{version}-py%{py_ver}.egg-info
%{python_sitelib}/%{_pyname}

%changelog
openSUSE Build Service is sponsored by