diff options
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.bb | 90 |
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 @@ | |||
| 1 | SUMMARY = "Tailscale client and daemon" | ||
| 2 | DESCRIPTION = "The easiest, most secure way to use WireGuard and 2FA." | ||
| 3 | HOMEPAGE = "https://github.com/tailscale/tailscale" | ||
| 4 | SECTION = "networking" | ||
| 5 | |||
| 6 | LICENSE = "BSD-3-Clause" | ||
| 7 | LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=cadeae10a8856ddfdb129866b75b33e3" | ||
| 8 | require ${BPN}-licenses.inc | ||
| 9 | |||
| 10 | MAJOR_MINOR = "${@oe.utils.trim_version('${PV}', 2)}" | ||
| 11 | SRC_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 | " | ||
| 15 | SRCREV = "8f2c8d6a14419e95fb9d02d6bf6113893daef5c3" | ||
| 16 | SRCREV_SHORT = "${@d.getVar('SRCREV')[:8]}" | ||
| 17 | require ${BPN}-go-mods.inc | ||
| 18 | |||
| 19 | GO_IMPORT = "tailscale.com" | ||
| 20 | GO_INSTALL = "${GO_IMPORT}/cmd/tailscaled" | ||
| 21 | GO_LINKSHARED = "" | ||
| 22 | GOBUILDFLAGS:prepend = "-tags=${@','.join(d.getVar('PACKAGECONFIG_CONFARGS').split())} " | ||
| 23 | GO_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 | ||
| 26 | export GOFLAGS = "-tags=${@','.join(d.getVar('PACKAGECONFIG_CONFARGS').split())}" | ||
| 27 | |||
| 28 | inherit 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 | |||
| 32 | PACKAGECONFIG ??= "aws bird capture cli kube ssh tap wakeonlan" | ||
| 33 | PACKAGECONFIG[aws] = "ts_aws,ts_omit_aws" | ||
| 34 | PACKAGECONFIG[bird] = "ts_bird,ts_omit_bird" | ||
| 35 | PACKAGECONFIG[capture] = "ts_capture,ts_omit_capture" | ||
| 36 | PACKAGECONFIG[cli] = "ts_include_cli,ts_omit_include_cli" | ||
| 37 | PACKAGECONFIG[completion] = "ts_completion,ts_omit_completion" | ||
| 38 | PACKAGECONFIG[kube] = "ts_kube,ts_omit_kube" | ||
| 39 | PACKAGECONFIG[ssh] = "ts_ssh,ts_omit_ssh" | ||
| 40 | PACKAGECONFIG[tap] = "ts_tap,ts_omit_tap" | ||
| 41 | PACKAGECONFIG[wakeonlan] = "ts_wakeonlan,ts_omit_wakeonlan" | ||
| 42 | |||
| 43 | INITSCRIPT_PACKAGES = "${PN}d" | ||
| 44 | INITSCRIPT_NAME:${PN}d = "tailscaled" | ||
| 45 | INITSCRIPT_PARAMS:${PN}d = "defaults 91 9" | ||
| 46 | |||
| 47 | SYSTEMD_PACKAGES = "${BPN}d" | ||
| 48 | SYSTEMD_SERVICE:${BPN}d = "${BPN}d.service" | ||
| 49 | |||
| 50 | # override do_install, since it installs in bin instead of sbin | ||
| 51 | do_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 | |||
| 76 | PACKAGES =+ "${PN}d" | ||
| 77 | |||
| 78 | # mark these as src, since there are bash script etc in there and QA will complain otherwise | ||
| 79 | FILES:${PN}-src += "${libdir}/go/src" | ||
| 80 | FILES:${PN}d = "${sysconfdir} ${systemd_system_unitdir}" | ||
| 81 | |||
| 82 | RDEPENDS:${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'completion', 'bash-completion', '', d)}" | ||
| 83 | RDEPENDS:${PN}d = "iptables" | ||
| 84 | |||
| 85 | RRECOMMENDS:${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" | ||
