File google-cloud-sdk.spec of Package google-cloud-sdk
#
# spec file for package google-cloud-sdk
#
# Copyright (c) 2015 SUSE LINUX Products 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.44
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: gsutilHideDeps.patch
Patch2: gcutilHideDeps.patch
Patch3: gcutilNoInternalVersionCheck.patch
Patch4: bqHideDeps.patch
Patch5: hideImplicitVersionMgmt.patch
Patch6: hidePathMangeling.patch
Patch7: gsutil_noVersioCheckOrUpdate.patch
Patch8: gsutil_respectBotoCfgKeyword.patch
Requires: google-api-python-client => 1.2
Requires: python
Requires: python-SocksiPy
Requires: python-argcomplete
Requires: python-argparse
Requires: python-boto => 2.30.0
Requires: python-crcmod
Requires: python-docker-py
Requires: python-gcs-oauth2-boto-plugin
Requires: python-google-apputils
Requires: python-httplib2 => 0.8
Requires: python-ipaddr
Requires: python-iso8601
Requires: python-python-gflags
Requires: python-python-mimeparse
Requires: python-requests
Requires: python-retry_decorator
Requires: python-setuptools
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.
%package doc
Summary: Documentation for google-cloud-sdk
Group: System/Management
PreReq: google-cloud-sdk = %version
%description doc
This package provides html documentation for google-cloud-sdk
%package gsutil-tests
Summary: Test for gsutil
Group: System/Management
PreReq: google-cloud-sdk = %version
%description gsutil-tests
This package provides test cases for gsutil. The functionality for gsutil
is not yet integrated into the gcloud master command utility.
%prep
%setup -q
%patch1
%patch2 -p1
%patch3 -p1
%patch4
%patch5
%patch6
%patch7
%patch8
cp %{SOURCE1} %{_builddir}/%{name}-%{version}
%build
python setup.py build
pushd platform/gsutil
python setup.py build
popd
pushd platform/gcutil
python setup.py build
popd
pushd platform/bq
python setup.py build
popd
%install
# Leave it to Google to set silly permissions, fix it
chmod -x help/man/man1/*
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
sed -i 1d lib/protorpc/*.py
sed -i 1d lib/protorpc/webapp/*.py
sed -i 1d lib/protorpc/wsgi/*.py
# 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 -r help/man/man1 %{buildroot}/%{_mandir}
cp completion.bash.inc %{buildroot}/%{_sysconfdir}/bash_completion.d/gcloud.sh
cp -r lib/googlecloudsdk/gcloud/reference/* %{buildroot}/%{_defaultdocdir}/%{name}
echo "#!/bin/sh" > %{buildroot}/%{_bindir}/gcloud
echo "python %{python_sitelib}/googlecloudsdk/gcloud/gcloud.py \"\$@\"" >> %{buildroot}/%{_bindir}/gcloud
chmod +x %{buildroot}/%{_bindir}/gcloud
# Install gsutil
pushd platform/gsutil
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
popd
# install gcutil
pushd platform/gcutil
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
popd
# Install bigquery
pushd platform/bq
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
popd
%files
%defattr(-,root,root,-)
# man pages for gcloud
%doc %{_mandir}/*
## gcloud stuff
%dir %{python_sitelib}/google
%dir %{python_sitelib}/googlecloudapis
%dir %{python_sitelib}/googlecloudsdk
%dir %{python_sitelib}/google_cloud_sdk-%{version}-py%{py_ver}.egg-info
%{_bindir}/gcloud
%{python_sitelib}/google/*
%{python_sitelib}/googlecloudapis/*
%{python_sitelib}/googlecloudsdk/*
%{python_sitelib}/google_cloud_sdk-%{version}-py%{py_ver}.egg-info/*
%config %{_sysconfdir}/bash_completion.d/gcloud.sh
# integrated gsutil
%dir %{python_sitelib}/gslib
%dir %{python_sitelib}/gslib/addlhelp
%dir %{python_sitelib}/gslib/commands
%dir %{python_sitelib}/gslib/data
# tests are accessed during regular command execution, go figure
%dir %{python_sitelib}/gslib/tests
# Note third_party contains protorpc which appears to be another
# implementation of the included dependency. Leave it to Google to
# mis-manage even in house developed dependencies.
%dir %{python_sitelib}/gslib/third_party
%dir %{python_sitelib}/gsutil-4.7-py%{py_ver}.egg-info
%doc %{python_sitelib}/gslib/CHECKSUM
%doc %{python_sitelib}/gslib/README
%doc %{python_sitelib}/gslib/VERSION
%{python_sitelib}/gslib/addlhelp/*
%{python_sitelib}/gslib/commands/*
%{python_sitelib}/gslib/data/*
%{python_sitelib}/gslib/tests/*
%{python_sitelib}/gsutil-4.7-py%{py_ver}.egg-info/*
%{python_sitelib}/gslib/third_party/*
%{python_sitelib}/gslib/*.py*
%{_bindir}/gsutil
# integrated gcutil
%dir %{python_sitelib}/gcutil_lib
%dir %{python_sitelib}/gcutil-1.16.5-py%{py_ver}.egg-info
%{python_sitelib}/gcutil_lib/*
%{python_sitelib}/gcutil-1.16.5-py%{py_ver}.egg-info/*
%{_bindir}/gcutil
# integrated bq
%dir %{python_sitelib}/discovery
%dir %{python_sitelib}/bigquery-2.0.18-py%{py_ver}.egg-info
%{python_sitelib}/discovery/*
%{python_sitelib}/bigquery_client.*
%{python_sitelib}/bq*
%{python_sitelib}/bigquery-2.0.18-py%{py_ver}.egg-info/*
%{python_sitelib}/table_formatter.*
%{_bindir}/bq
# built in dependency on protorpc, not available as stand alone code stream
%dir %{python_sitelib}/protorpc
%{python_sitelib}/protorpc/*
%files doc
%defattr(-,root,root)
%dir %{_defaultdocdir}/%{name}
%doc LICENSE README RELEASE_NOTES
%doc %{_defaultdocdir}/%{name}/*
%changelog