2 ## Copyright (C) 2019 Wind River Systems, Inc.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 DESCRIPTION = "StarlingX distributedcloud packages collection"
17 HOMEPAGE = "https://opendev.org/starlingx"
19 LICENSE = "Apache-2.0"
20 LIC_FILES_CHKSUM = "file://src/registry-token-server/registry-token-server/src/LICENSE;md5=d2794c0df5b907fdace235a619d80314"
24 SRCNAME = "containers"
25 SRCREV = "1a4b803e946b488c1f3adb25ab0614d1b0c3c9b8"
26 PV = "1.0.0+git${SRCPV}"
29 SRC_URI = "git://opendev.org/starlingx/${SRCNAME}.git;protocol=${PROTOCOL};rev=${SRCREV};branch=${BRANCH}"
31 GO_IMPORT = "registry-token-server"
33 RDEPENDS_${PN}-dev_append = " \
52 inherit go goarch ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager','systemd','systemd','', d)}
56 ln -sfn ${S}/src/registry-token-server/registry-token-server/src/ ./_build/src/registry-token-server
58 # Pass the needed cflags/ldflags so that cgo
59 # can find the needed headers files and libraries
60 export GOARCH=${TARGET_GOARCH}
61 export CGO_ENABLED="1"
62 export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
63 export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
65 export GOPATH="${WORKDIR}/build/_build:${STAGING_DIR_TARGET}/${prefix}/local/go"
66 cd _build/src/${GO_IMPORT}
67 #oe_runmake registry-token-server
68 export GOROOT=${STAGING_DIR_TARGET}/${prefix}/local/go
69 go build -o ${WORKDIR}/build/bin/registry-token-server registry-token-server
72 SYSTEMD_PACKAGES = "${PN}"
73 SYSTEMD_SERVICE_${PN} = "registry-token-server.service"
74 SYSTEMD_AUTO_ENABLE = "disable"
77 SRCPATH="${S}/src/registry-token-server/registry-token-server/centos/files"
78 install -d ${D}/${bindir}
79 install -m 0755 bin/registry-token-server ${D}/${bindir}
80 install -d -m 0755 ${D}/${sysconfdir}/registry-token-server/registry
81 install -m 0644 ${SRCPATH}//token_server.conf ${D}/${sysconfdir}/registry-token-server/registry
83 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
84 install -d ${D}${systemd_unitdir}/system
85 install -m 0644 ${SRCPATH}/registry-token-server.service ${D}${systemd_unitdir}/system/