File: install.sh

package info (click to toggle)
docker.io 26.1.5%2Bdfsg1-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 68,576 kB
  • sloc: sh: 5,748; makefile: 912; ansic: 664; asm: 228; python: 162
file content (39 lines) | stat: -rwxr-xr-x 580 bytes parent folder | download | duplicates (7)
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
#!/bin/bash

set -e
set -x

RM_GOPATH=0

TMP_GOPATH=${TMP_GOPATH:-""}

: ${PREFIX:="/usr/local/bin"}

if [ -z "$TMP_GOPATH" ]; then
	export GOPATH="$(mktemp -d)"
	RM_GOPATH=1
else
	export GOPATH="$TMP_GOPATH"
fi
case "$(go env GOARCH)" in
	mips* | ppc64)
		# pie build mode is not supported on mips architectures
		export GO_BUILDMODE=""
		;;
	*)
		export GO_BUILDMODE="-buildmode=pie"
		;;
esac

dir="$(dirname $0)"

bin=$1
shift

if [ ! -f "${dir}/${bin}.installer" ]; then
	echo "Could not find installer for \"$bin\""
	exit 1
fi

. ${dir}/${bin}.installer
install_${bin} "$@"