File google-cloud-sdk.spec of Package google-cloud-sdk.1615

#
# spec file for package google-cloud-sdk
#
# 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/
#


Name:           google-cloud-sdk
Version:        0.9.87
Release:        0
Summary:        Tools for Google Cloud Services
License:        Apache-2.0
Group:          System/Management
# Get the filename to download from
# https://dl.google.com/dl/cloudsdk/release/sha1.txt
Url:            https://dl.google.com/dl/cloudsdk/release
Source0:        %{name}-%{version}.tar.bz2
Source1:        setup.py
Patch1:         hidePathMangeling.patch
Patch2:         disableSelfUpdate.patch
Requires:       python
Requires:       python-Jinja2
Requires:       python-MarkupSafe
Requires:       python-SocksiPy
Requires:       python-antlr3_runtime
Requires:       python-argcomplete
Requires:       python-argparse
Requires:       python-docker-py
Requires:       python-enum34
Requires:       python-httplib2          => 0.8
Requires:       python-ipaddr
Requires:       python-oauth2
Requires:       python-oauth2client
Requires:       python-oauth2client-gce
Requires:       python-portpicker
Requires:       python-pyasn1
Requires:       python-pyasn1-modules
Requires:       python-python-gflags
Requires:       python-python-mimeparse
Requires:       python-requests
Requires:       python-rsa
Requires:       python-six
Requires:       python-uritemplate
Requires:       python-websocket-client
Requires:       python-yaml
Provides:       gcutils > 1.13.0
Provides:       gsutils > 3.42
Obsoletes:      gcutils <= 1.13.0
Obsoletes:      gsutils <= 3.42
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
Google Cloud SDK contains tools and libraries that allow you to create and
manage resources on Google Cloud Platform, including App Engine, Compute
Engine, Cloud Storage, Cloud SQL, and BigQuery.

%prep
%setup -q
%patch1
%patch2

cp %{SOURCE1} %{_builddir}/%{name}-%{version}

%build
python setup.py build

%install
# Leave it to Google to set silly permissions, fix it
find . -name "*.html" | xargs chmod -x 
find . -name "*.json" | xargs chmod -x
find . -name "*_test.py" | xargs chmod +x
find lib/protorpc -name "*.py" | xargs chmod -x
# Remove shebang from files intended for import
find lib/googlecloudsdk/third_party/appengine -type f | xargs grep -l '#!' | xargs sed -i 1d
find lib/protorpc -type f | xargs grep -l '#!' | xargs sed -i 1d
# Install gcloud
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
install -d %{buildroot}/%{_bindir}
install -d %{buildroot}/%{_defaultdocdir}/%{name}
install -d %{buildroot}/%{_mandir}
install -d %{buildroot}/%{_sysconfdir}/bash_completion.d
cp completion.bash.inc %{buildroot}/%{_sysconfdir}/bash_completion.d/gcloud.sh
echo "#!/bin/sh" > %{buildroot}/%{_bindir}/gcloud
echo "python %{python_sitelib}/googlecloudsdk/gcloud/gcloud.py \"\$@\"" >> %{buildroot}/%{_bindir}/gcloud
chmod +x %{buildroot}/%{_bindir}/gcloud

%files
%defattr(-,root,root,-)
%doc LICENSE README RELEASE_NOTES
%dir %{python_sitelib}/google
%dir %{python_sitelib}/googlecloudsdk
%dir %{python_sitelib}/google_cloud_sdk-%{version}-py%{py_ver}.egg-info
%{_bindir}/gcloud
%{python_sitelib}/google/*
%{python_sitelib}/googlecloudsdk/*
%{python_sitelib}/google_cloud_sdk-%{version}-py%{py_ver}.egg-info/*
%config %{_sysconfdir}/bash_completion.d/gcloud.sh
# built in dependency on fancy_urllib, not available as stand alone code stream
%dir %{python_sitelib}/fancy_urllib
%{python_sitelib}/fancy_urllib/*
# built in dependency on protorpc, not available as stand alone code stream
%dir %{python_sitelib}/protorpc
%{python_sitelib}/protorpc/*

%changelog