mirror of
https://github.com/termux/termux-packages.git
synced 2025-01-31 20:12:26 +00:00
ff24b1e888
This commit has been automatically submitted by Github Actions.
42 lines
1.5 KiB
Bash
42 lines
1.5 KiB
Bash
TERMUX_PKG_HOMEPAGE=https://github.com/hetznercloud/cli
|
|
TERMUX_PKG_DESCRIPTION="Hetzner Cloud command line client"
|
|
TERMUX_PKG_LICENSE="MIT"
|
|
TERMUX_PKG_MAINTAINER="@termux"
|
|
TERMUX_PKG_VERSION="1.50.0"
|
|
TERMUX_PKG_SRCURL=https://github.com/hetznercloud/cli/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
|
|
TERMUX_PKG_SHA256=61fb1823a176ec77c102c30b3a7de50c67df7eda6dd8a3bf1f17c882e8c78011
|
|
TERMUX_PKG_DEPENDS="resolv-conf"
|
|
TERMUX_PKG_BUILD_IN_SRC=true
|
|
TERMUX_PKG_AUTO_UPDATE=true
|
|
|
|
termux_step_pre_configure() {
|
|
termux_setup_golang
|
|
|
|
go mod init || :
|
|
go mod tidy
|
|
}
|
|
|
|
termux_step_make() {
|
|
# Below are taken from github.com/hetznercloud/cli@v1.30.1/.goreleaser.yml
|
|
local LD_FLAGS="-s -w -X 'github.com/hetznercloud/cli/internal/version.Version=v${TERMUX_PKG_VERSION}'"
|
|
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
|
|
go build -ldflags "${LD_FLAGS}" -o hcloud cmd/hcloud/main.go
|
|
}
|
|
|
|
termux_step_make_install() {
|
|
install -Dm700 -t $TERMUX_PREFIX/bin hcloud
|
|
|
|
install -Dm644 /dev/null "$TERMUX_PREFIX"/share/bash-completion/completions/hcloud
|
|
install -Dm644 /dev/null "$TERMUX_PREFIX"/share/zsh/site-functions/_hcloud
|
|
install -Dm644 /dev/null "$TERMUX_PREFIX"/share/fish/vendor_completions.d/hcloud.fish
|
|
}
|
|
|
|
termux_step_create_debscripts() {
|
|
cat <<-EOF >./postinst
|
|
#!${TERMUX_PREFIX}/bin/sh
|
|
hcloud completion bash > ${TERMUX_PREFIX}/share/bash-completion/completions/hcloud
|
|
hcloud completion zsh > ${TERMUX_PREFIX}/share/zsh/site-functions/_hcloud
|
|
hcloud completion fish > ${TERMUX_PREFIX}/share/fish/vendor_completions.d/hcloud.fish
|
|
EOF
|
|
}
|