File python-google-apitools.spec of Package python-google-apitools.4874

#
# spec file for package python-google-apitools
#
# Copyright (c) 2016 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/
#


Name:           python-google-apitools
Version:        0.5.6
Release:        0
Url:            https://github.com/google/apitools
Summary:        Google API utils
License:        Apache-2.0
Group:          Development/Languages/Python
Source:         apitools-%{version}.tar.gz
Patch1:         apitools-test-clientgen.patch
Patch2:         apitools-test-fix-path-gen_client.patch
Patch3:         apitools-test-disable-requires-internet.patch
Requires:       python-httplib2         >= 0.8
Requires:       python-oauth2client     >= 1.5.2
Requires:       python-oauth2client-gce >= 1.5.2
%if 0%{?suse_version} && 0%{?suse_version} <= 1315
Requires:       python-setuptools       >= 18.0
%else
Requires:       python-setuptools       >= 18.5
%endif
Requires:       python-google-apputils  >= 0.4.0
Requires:       python-gflags           >= 2.0
BuildRequires:  python-httplib2         >= 0.8
BuildRequires:  python-oauth2client     >= 1.5.2
BuildRequires:  python-oauth2client-gce >= 1.5.2
%if 0%{?suse_version} && 0%{?suse_version} <= 1315
BuildRequires:  python-setuptools       >= 18.0
%else
BuildRequires:  python-setuptools       >= 18.5
%endif
BuildRequires:  python-google-apputils  >= 0.4.0
BuildRequires:  python-gflags           >= 2.0
# For testing
BuildRequires:  python-mock             >= 1.0.1
BuildRequires:  python-nose
BuildRequires:  python-unittest2        >= 0.5.1
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
Requires:       python-argparse         >= 1.2.1
BuildRequires:  python-argparse         >= 1.2.1
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch:      noarch
%endif

%description
google-apitools is a collection of utilities to make it easier to build client-side tools, especially those that talk to Google APIs.

%prep
%setup -q -n apitools-%{version}
%patch1
%patch2
%patch3
find . -name "*.py" | xargs sed -i 's|#!/usr/bin/env python||'

%build
python setup.py build

%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
# samples is a rather generic name
mv %{buildroot}%{python_sitelib}/samples %{buildroot}%{python_sitelib}/apitools-samples

%check
nosetests

%files
%defattr(-,root,root,-)
%doc LICENSE README.rst
%{python_sitelib}/*
%{_bindir}/gen_client
openSUSE Build Service is sponsored by