-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathshellhub-agent_0.26.0.bb
More file actions
79 lines (62 loc) · 2.9 KB
/
Copy pathshellhub-agent_0.26.0.bb
File metadata and controls
79 lines (62 loc) · 2.9 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
SUMMARY = "ShellHub Agent"
DESCRIPTION = "ShellHub agent: enables remote SSH access to Linux devices behind firewall or NAT."
HOMEPAGE = "https://shellhub.io"
BUGTRACKER = "https://github.com/shellhub-io/shellhub/issues"
SECTION = "console/network"
CVE_PRODUCT = "shellhub"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${S}/src/${GO_IMPORT}/LICENSE.md;md5=fa818a259cbed7ce8bc2a22d35a464fc"
DEPENDS = "libxcrypt"
SRC_URI = "\
git://github.com/shellhub-io/shellhub;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX} \
file://shellhub-agent.initd \
file://shellhub-agent.profile.d \
file://shellhub-agent.service \
file://shellhub-agent.start \
file://shellhub-agent.wrapper.in \
"
SRCREV = "34c91084a44f7a863c130e99b194e724de83a149"
inherit go systemd update-rc.d
# Avoid dynamic linking as it causes segfault
GO_LINKSHARED = ""
SYSTEMD_SERVICE:${PN} = "${PN}.service"
INITSCRIPT_NAME = "${PN}"
INITSCRIPT_PARAMS = "defaults 99"
GO_IMPORT = "github.com/shellhub-io/shellhub"
GO_INSTALL = "github.com/shellhub-io/shellhub/agent"
GO_LDFLAGS = '-ldflags="${GO_RPATH} ${GO_LINKMODE} -X main.AgentVersion=v${PV} -extldflags '${GO_EXTLDFLAGS}'"'
GOBUILDFLAGS:append = " -modcacherw"
do_compile[dirs] += "${B}/src/${GO_IMPORT}/agent"
# nooelint: oelint.task.network go modules are fetched during compile
do_compile[network] = "1"
do_install:append() {
# We name the binary as shellhub-agent
install -d ${D}${libexecdir}/shellhub/bin/
mv ${D}${bindir}/agent ${D}${libexecdir}/shellhub/bin/shellhub-agent
# Handle init system integration
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
install -Dm 0644 ${UNPACKDIR}/shellhub-agent.service ${D}${systemd_unitdir}/system/shellhub-agent.service
sed -i -e 's,@BINDIR@,${bindir},g' ${D}${systemd_unitdir}/system/shellhub-agent.service
fi
if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
install -Dm 0755 ${UNPACKDIR}/shellhub-agent.initd ${D}/${sysconfdir}/init.d/shellhub-agent
install -Dm 0755 ${UNPACKDIR}/shellhub-agent.start ${D}${libdir}/shellhub-agent/shellhub-agent.start
sed -e 's,@BINDIR@,${bindir},g' \
-e 's,@LIBDIR@,${libdir},g' \
-e 's,@LOCALSTATEDIR@,${localstatedir},g' \
-e 's,@SYSCONFDIR@,${sysconfdir},g' \
-i ${D}/${sysconfdir}/init.d/shellhub-agent
fi
# Shell prompt handling
install -Dm 0755 ${UNPACKDIR}/shellhub-agent.profile.d ${D}/${sysconfdir}/profile.d/shellhub-agent.sh
# Script that allow to run sh files before shellhub-agent binary start
install -Dm 0755 ${UNPACKDIR}/shellhub-agent.wrapper.in ${D}${bindir}/shellhub-agent
sed -e 's,@LIBEXEC@,${libexecdir},g' -i ${D}${bindir}/shellhub-agent
}
RDEPENDS:${PN} += "\
openssh-scp \
shadow \
shellhub-agent-config \
"
RDEPENDS:${PN}-dev += "bash"
RRECOMMENDS:${PN} += "ca-certificates"