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 HOMEPAGE = "http://github.com/docker/distribution"
17 SUMMARY = "The Docker toolset to pack, ship, store, and deliver content"
18 LICENSE = "Apache-2.0"
19 LIC_FILES_CHKSUM = "file://LICENSE;md5=d2794c0df5b907fdace235a619d80314"
21 GO_PKG_PATH = "github.com/docker/distribution"
24 SRCREV_distribution="48294d928ced5dd9b378f7fd7c6f5da3ff3f2c89"
26 git://github.com/docker/distribution.git;branch=release/2.6;name=distribution;destsuffix=git/src/${GO_PKG_PATH} \
27 file://${BPN}.service \
32 S = "${WORKDIR}/git/src/${GO_PKG_PATH}"
37 # This disables seccomp and apparmor, which are on by default in the
39 EXTRA_OEMAKE="BUILDTAGS=''"
42 export GOARCH="${TARGET_GOARCH}"
43 export GOPATH="${WORKDIR}/git/"
44 export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
45 # Pass the needed cflags/ldflags so that cgo
46 # can find the needed headers files and libraries
47 export CGO_ENABLED="1"
50 export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
52 export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
60 install -d ${D}/${bindir}
61 install ${S}/bin/registry ${D}/${bindir}
63 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
64 install -d ${D}${systemd_system_unitdir}
65 install -m 644 ${WORKDIR}/${BPN}.service ${D}/${systemd_system_unitdir}
68 install -d ${D}/${sysconfdir}/${BPN}/registry/
69 install ${WORKDIR}/config.yml ${D}/${sysconfdir}/${BPN}/registry/config.yml
71 # storage for the registry containers
72 install -d ${D}/${localstatedir}/lib/registry/
75 INSANE_SKIP_${PN} += "ldflags already-stripped"
79 ${systemd_system_unitdir}/${BPN}.service \
80 ${sysconfdir}/${BPN}/* \
81 ${localstatedir}/lib/registry/ \
84 SYSTEMD_SERVICE_${BPN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${BPN}.service','',d)}"
85 SYSTEMD_AUTO_ENABLE_${BPN} = "disable"
88 SYSROOT_PREPROCESS_FUNCS += "docker_distribution_sysroot_preprocess"
90 docker_distribution_sysroot_preprocess () {
91 install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${GO_PKG_PATH}
92 cp -r ${S} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${GO_PKG_PATH})