blob: b47ceeb25044eeabef48022131aadc04c326ff0a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
# Maintainer: Josef Vybíhal <josef.vybihal@gmail.com>
# Contributor: Polarian <polarian@polarian.dev>
# Contributor: Benjamin Denhartog <ben@sudoforge.com>
# Contributor: Mansour Behabadi <mansour@oxplot.com>
# Contributor: Troy Engel <troyengel+arch@gmail.com>
# Contributor: Geoff Hill <geoff@geoffhill.org>
# Contributor: Sebastien Bariteau <numkem@numkem.org>
# Contributor: Justin Dray <justin@dray.be>
# shellcheck disable=SC2034
# Cloud Storage Bucket: https://console.cloud.google.com/storage/browser/cloud-sdk-release/for_packagers/linux
# deb pool:
# - https://packages.cloud.google.com/apt/dists/cloud-sdk/main/binary-amd64/Packages
# - https://packages.cloud.google.com/apt/pool/google-cloud-cli_455.0.0-0_all_568366af2c266f73f44b302536eb2b7e143d67d783aaf0f89452dbd8ca805410.deb
_extractedName="google-cloud-sdk"
pkgname="google-cloud-cli"
pkgver=462.0.0
pkgrel=1
pkgdesc="A set of command-line tools for the Google Cloud Platform. Includes gcloud (with beta and alpha commands), gsutil, and bq."
url="https://cloud.google.com/cli/"
license=('Apache-2.0')
arch=('x86_64')
depends=('python')
optdepends=(
"python-crcmod: [gsutil] verify the integrity of GCS object contents"
)
options=('!strip' 'staticlibs' !zipman)
# TODO:
# - cleanup of package content
# - maybe use .deb as source? (already compressed manpages)
# - aarch64 as separate source
# - packages for components
source=(
"$pkgname-$pkgver.orig.tar.gz::https://dl.google.com/dl/cloudsdk/release/downloads/for_packagers/linux/${pkgname}_${pkgver}.orig_amd64.tar.gz"
"google-cloud-cli.sh"
"0003-add-compdef-to-zsh-completion.patch"
)
# Conflict the old package name to force migration
conflicts=('google-cloud-sdk')
provides=('google-cloud-sdk')
sha256sums=('4d1d60fa056f2f491b179f4d23b89899b9b7fc1691ad8ddcbf2ac901540c3021'
'e03ffb8a534b175dc497621a0396bcc29884279daa519e2cb90bd98c61d6530a'
'4694f5191ceea7cf8076861ce5790ba9e809023da278b0f6ed862b9611e5aa93')
prepare() {
cd "${_extractedName}"
for f in "${source[@]}"; do
[[ "$f" =~ \.patch$ ]] && \
( \
patch -p1 -i "${srcdir}/${f}" > /dev/null 2>&1 ||\
( \
echo "failed to apply patch: $(basename ${f})" && \
exit 1 \
) \
)
done
}
package() {
mkdir "${pkgdir}/opt"
cp -r "${_extractedName}" "${pkgdir}/opt/$pkgname"
# The Google code uses a _TraceAction() method which spams the screen even
# in "quiet" mode, we're throwing away output on purpose to keep it clean
# ref: lib/googlecloudsdk/core/platforms_install.py
"${pkgdir}/opt/${pkgname}/install.sh" \
--quiet \
--usage-reporting false \
--path-update false \
--bash-completion false \
> /dev/null
find $pkgdir -name '__pycache__' -type d -exec rm -rf {} +
install -D -m 0755 "${srcdir}/${source[1]}" \
"${pkgdir}/etc/profile.d/google-cloud-cli.sh"
install -D -m 0644 "${pkgdir}/opt/${pkgname}/completion.bash.inc" \
"${pkgdir}/etc/bash_completion.d/google-cloud-cli"
install -D -m 0644 "${pkgdir}/opt/${pkgname}/completion.zsh.inc" \
"${pkgdir}/usr/share/zsh/site-functions/_gcloud"
mkdir -p "${pkgdir}/usr/share"
mv -f "${pkgdir}/opt/${pkgname}/help/man" "${pkgdir}/usr/share/"
}
|