-
Notifications
You must be signed in to change notification settings - Fork 0
/
plan.sh
49 lines (42 loc) · 1.6 KB
/
plan.sh
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
# See full docs at https://www.habitat.sh/docs/reference/plan-syntax/
pkg_name=nomad
pkg_origin=qubitrenegade
pkg_version="0.8.3"
pkg_maintainer="The Habitat Maintainers <[email protected]>"
pkg_license=("MPL-2.0")
pkg_source="https://releases.hashicorp.com/${pkg_name}/${pkg_version}/${pkg_name}_${pkg_version}_linux_amd64.zip"
pkg_filename="${pkg_name}-${pkg_version}_linux_amd64.zip"
pkg_description="A tool for managing a cluster of machines and running applications on them; https://github.com/qubitrenegade/habitat-nomad"
pkg_upstream_url="https://www.nomadproject.io"
pkg_shasum="c7faaee8fad0f6a74df01b9283253ee565f85791adca1d6a38462e0387dee175"
pkg_deps=(core/glibc core/bash)
pkg_build_deps=(core/unzip core/patchelf)
pkg_bin_dirs=(bin)
pkg_svc_user="root"
pkg_svc_group="$pkg_svc_user"
pkg_exports=(
[host]=srv.address
# [port]=srv.port
# [ssl-port]=srv.ssl.port
)
# Optional.
# An array of `pkg_exports` keys containing default values for which ports that this package
# exposes. These values are used as sensible defaults for other tools. For example, when exporting
# a package to a container format.
# pkg_exposes=(port ssl-port)
pkg_binds_optional=(
[consul]="host"
)
# unzip our package into ${pkg_name}-${pkg_version} instead of just ${pkg_name}
do_unpack() {
cd "${HAB_CACHE_SRC_PATH}" || exit
unzip ${pkg_filename} -d "${pkg_name}-${pkg_version}"
}
# Since we have a precompiled binary, skip trying to compile it
do_build() {
return 0
}
do_install() {
install -D nomad "${pkg_prefix}/bin/nomad"
patchelf --interpreter "$(pkg_path_for glibc)/lib64/ld-linux-x86-64.so.2" "${pkg_prefix}/bin/nomad"
}