Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-virt / recipes-containers / docker-distribution / docker-distribution_git.bb
1 HOMEPAGE = "http://github.com/docker/distribution"
2 SUMMARY = "The Docker toolset to pack, ship, store, and deliver content"
3 LICENSE = "Apache-2.0"
4 LIC_FILES_CHKSUM = "file://LICENSE;md5=d2794c0df5b907fdace235a619d80314"
5
6 GO_PKG_PATH = "github.com/docker/distribution"
7 GO_IMPORT = "import"
8
9 SRCREV_distribution="48294d928ced5dd9b378f7fd7c6f5da3ff3f2c89"
10 SRC_URI = " \
11         git://github.com/docker/distribution.git;branch=release/2.6;name=distribution;destsuffix=git/src/${GO_PKG_PATH} \
12         file://${BPN}.service \
13         file://config.yml \
14         "
15
16 PV = "v2.6.2"
17 S = "${WORKDIR}/git/src/${GO_PKG_PATH}"
18
19 inherit goarch
20 inherit go
21
22 # This disables seccomp and apparmor, which are on by default in the
23 # go package. 
24 EXTRA_OEMAKE="BUILDTAGS=''"
25
26 do_compile() {
27         export GOARCH="${TARGET_GOARCH}"
28         export GOPATH="${WORKDIR}/git/"
29         export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
30         # Pass the needed cflags/ldflags so that cgo
31         # can find the needed headers files and libraries
32         export CGO_ENABLED="1"
33         export CFLAGS=""
34         export LDFLAGS=""
35         export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
36         export GO_GCFLAGS=""
37         export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
38
39         cd ${S}
40
41         oe_runmake binaries
42 }
43
44 do_install() {
45         install -d ${D}/${bindir}
46         install ${S}/bin/registry ${D}/${bindir}
47
48         if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
49             install -d ${D}${systemd_system_unitdir}
50             install -m 644 ${WORKDIR}/${BPN}.service ${D}/${systemd_system_unitdir}
51         fi
52
53         install -d ${D}/${sysconfdir}/${BPN}/registry/
54         install ${WORKDIR}/config.yml ${D}/${sysconfdir}/${BPN}/registry/config.yml
55
56         # storage for the registry containers
57         install -d ${D}/${localstatedir}/lib/registry/
58 }
59
60 FILES_${PN} = "\
61         ${bindir}/* \
62         ${systemd_system_unitdir}/${BPN}.service \
63         ${sysconfdir}/${BPN}/* \
64         ${localstatedir}/lib/registry/ \
65         "
66
67 SYSTEMD_SERVICE_${BPN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${BPN}.service','',d)}"
68 SYSTEMD_AUTO_ENABLE_${BPN} = "disable"
69
70
71 SYSROOT_PREPROCESS_FUNCS += "docker_distribution_sysroot_preprocess"
72
73 docker_distribution_sysroot_preprocess () {
74     install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${GO_PKG_PATH}
75     cp -r ${S} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${GO_PKG_PATH})
76 }