summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-connectivity/tailscale/tailscale_1.98.3.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-networking/recipes-connectivity/tailscale/tailscale_1.98.3.bb')
-rw-r--r--meta-networking/recipes-connectivity/tailscale/tailscale_1.98.3.bb90
1 files changed, 90 insertions, 0 deletions
diff --git a/meta-networking/recipes-connectivity/tailscale/tailscale_1.98.3.bb b/meta-networking/recipes-connectivity/tailscale/tailscale_1.98.3.bb
new file mode 100644
index 0000000000..a352c5cf58
--- /dev/null
+++ b/meta-networking/recipes-connectivity/tailscale/tailscale_1.98.3.bb
@@ -0,0 +1,90 @@
1SUMMARY = "Tailscale client and daemon"
2DESCRIPTION = "The easiest, most secure way to use WireGuard and 2FA."
3HOMEPAGE = "https://github.com/tailscale/tailscale"
4SECTION = "networking"
5
6LICENSE = "BSD-3-Clause"
7LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=cadeae10a8856ddfdb129866b75b33e3"
8require ${BPN}-licenses.inc
9
10MAJOR_MINOR = "${@oe.utils.trim_version('${PV}', 2)}"
11SRC_URI = "git://github.com/tailscale/tailscale.git;protocol=https;branch=release-branch/${MAJOR_MINOR};destsuffix=${GO_SRCURI_DESTSUFFIX} \
12 file://default \
13 file://tailscaled.init \
14 "
15SRCREV = "8f2c8d6a14419e95fb9d02d6bf6113893daef5c3"
16SRCREV_SHORT = "${@d.getVar('SRCREV')[:8]}"
17require ${BPN}-go-mods.inc
18
19GO_IMPORT = "tailscale.com"
20GO_INSTALL = "${GO_IMPORT}/cmd/tailscaled"
21GO_LINKSHARED = ""
22GOBUILDFLAGS:prepend = "-tags=${@','.join(d.getVar('PACKAGECONFIG_CONFARGS').split())} "
23GO_EXTRA_LDFLAGS = "-X tailscale.com/version.longStamp=${PV}-${SRCREV_SHORT} -X tailscale.com/version.shortStamp=${PV}"
24
25# Pass build tags so go list in update-modules discovers all conditional deps
26export GOFLAGS = "-tags=${@','.join(d.getVar('PACKAGECONFIG_CONFARGS').split())}"
27
28inherit go-mod go-mod-update-modules \
29 ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'update-rc.d', '', d)} \
30 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}
31
32PACKAGECONFIG ??= "aws bird capture cli kube ssh tap wakeonlan"
33PACKAGECONFIG[aws] = "ts_aws,ts_omit_aws"
34PACKAGECONFIG[bird] = "ts_bird,ts_omit_bird"
35PACKAGECONFIG[capture] = "ts_capture,ts_omit_capture"
36PACKAGECONFIG[cli] = "ts_include_cli,ts_omit_include_cli"
37PACKAGECONFIG[completion] = "ts_completion,ts_omit_completion"
38PACKAGECONFIG[kube] = "ts_kube,ts_omit_kube"
39PACKAGECONFIG[ssh] = "ts_ssh,ts_omit_ssh"
40PACKAGECONFIG[tap] = "ts_tap,ts_omit_tap"
41PACKAGECONFIG[wakeonlan] = "ts_wakeonlan,ts_omit_wakeonlan"
42
43INITSCRIPT_PACKAGES = "${PN}d"
44INITSCRIPT_NAME:${PN}d = "tailscaled"
45INITSCRIPT_PARAMS:${PN}d = "defaults 91 9"
46
47SYSTEMD_PACKAGES = "${BPN}d"
48SYSTEMD_SERVICE:${BPN}d = "${BPN}d.service"
49
50# override do_install, since it installs in bin instead of sbin
51do_install() {
52 install -d ${D}/${sbindir}
53 install -m 0755 ${B}/${GO_BUILD_BINDIR}/tailscaled ${D}/${sbindir}/tailscaled
54
55 if [ "${@bb.utils.contains('PACKAGECONFIG', 'cli', 'true', 'false', d)}" = 'true' ]; then
56 install -d ${D}/${bindir}
57 ln -sr ${D}${sbindir}/tailscaled ${D}${bindir}/tailscale
58 fi
59
60 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
61 install -d ${D}${sysconfdir}/init.d
62 install -m 0755 ${UNPACKDIR}/tailscaled.init ${D}${sysconfdir}/init.d/tailscaled
63 install -d ${D}${sysconfdir}/default
64 install -m 644 ${UNPACKDIR}/default ${D}${sysconfdir}/default/${BPN}d
65 fi
66
67 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
68 install -d ${D}${systemd_system_unitdir}
69 install -m 644 ${B}/src/tailscale.com/cmd/tailscaled/tailscaled.service ${D}${systemd_system_unitdir}/${BPN}d.service
70 install -d ${D}${sysconfdir}/default
71 install -m 644 ${B}/src/tailscale.com/cmd/tailscaled/tailscaled.defaults ${D}${sysconfdir}/default/${BPN}d
72 fi
73
74}
75
76PACKAGES =+ "${PN}d"
77
78# mark these as src, since there are bash script etc in there and QA will complain otherwise
79FILES:${PN}-src += "${libdir}/go/src"
80FILES:${PN}d = "${sysconfdir} ${systemd_system_unitdir}"
81
82RDEPENDS:${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'completion', 'bash-completion', '', d)}"
83RDEPENDS:${PN}d = "iptables"
84
85RRECOMMENDS:${PN}d = "\
86 kernel-module-wireguard \
87 kernel-module-tun \
88 kernel-module-xt-mark \
89 kernel-module-xt-tcpudp \
90 kernel-module-xt-masquerade"