File python-gdata.spec of Package python-gdata

#
# spec file for package python-gdata
#
# Copyright (c) 2017 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/
#


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without test
Name:           python-gdata
Version:        2.0.18
Release:        0
Summary:        Python library to access data through Google Data APIs
License:        Apache-2.0
Group:          Development/Libraries/Python
Url:            http://code.google.com/p/gdata-python-client
Source:         https://gdata-python-client.googlecode.com/files/gdata-%{version}.tar.gz
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
Suggests:       python-gdata-doc
BuildArch:      noarch

%{python_subpackages}

%package -n %{name}-doc
Summary:        Documentation files for %name
Group:          Documentation/HTML

%description
The Google data Python Client Library provides a library and source
code that make it easy to access data through Google Data APIs.

%description -n %{name}-doc
HTML documentation on provided interfaces and samples for %name.

%prep
%setup -q -n gdata-%{version}
find samples/oauth src/gdata samples/apps/marketplace_sample -type f \( -name "*.py" -or -name "*.css" -or -name "*.txt" \) -exec sed -i 's|\r||' {} \; # Fix wrong EOL encoding
find samples -type f -name "*.py" -exec chmod 0644 {} \; # Remove executable perms on samples
find samples/apps/marketplace_sample -type f \( -name "*.c" -o -name "*.txt" \) -exec chmod 0644 {} \; # Remove executable perms on samples
# Remove unnecessary Python shebangs
find . -type f -exec sed -i -r '1s|^#! *(.+)/python(.*)$||' {} \;
find . -type f -exec sed -i -r '1s|^#! */usr/bin/env +python.*$||' {} \;
rm pydocs/generate_docs

%build
%{python_build}

%install
%{python_install}
%{python_expand %fdupes %{buildroot}%{$python_sitelib}}

%files %{python_files}
%doc README.txt RELEASE_NOTES.txt
%{python_sitelib}/*

%files -n %{name}-doc
%doc pydocs samples

%changelog
openSUSE Build Service is sponsored by