Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame^] | 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 | SRCREV_distribution="0810eba2adf048b77621472991211924d9ec31c5" |
| 7 | SRC_URI = "git://github.com/docker/distribution.git;branch=master;name=distribution;destsuffix=git/src/github.com/docker/distribution \ |
| 8 | file://docker-registry.service \ |
| 9 | " |
| 10 | |
| 11 | PACKAGES =+ "docker-registry" |
| 12 | |
| 13 | PV = "v2.6.0-rc+git${SRCPV}" |
| 14 | S = "${WORKDIR}/git/src/github.com/docker/distribution" |
| 15 | |
| 16 | inherit goarch |
| 17 | inherit go |
| 18 | |
| 19 | # This disables seccomp and apparmor, which are on by default in the |
| 20 | # go package. |
| 21 | EXTRA_OEMAKE="BUILDTAGS=''" |
| 22 | |
| 23 | do_compile() { |
| 24 | export GOARCH="${TARGET_GOARCH}" |
| 25 | export GOPATH="${WORKDIR}/git/" |
| 26 | export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go" |
| 27 | # Pass the needed cflags/ldflags so that cgo |
| 28 | # can find the needed headers files and libraries |
| 29 | export CGO_ENABLED="1" |
| 30 | export CFLAGS="" |
| 31 | export LDFLAGS="" |
| 32 | export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}" |
| 33 | export GO_GCFLAGS="" |
| 34 | export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" |
| 35 | |
| 36 | oe_runmake binaries |
| 37 | } |
| 38 | |
| 39 | do_install() { |
| 40 | install -d ${D}/${sbindir} |
| 41 | install ${S}/bin/registry ${D}/${sbindir} |
| 42 | |
| 43 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 44 | install -d ${D}${systemd_unitdir}/system |
| 45 | install -m 644 ${WORKDIR}/docker-registry.service ${D}/${systemd_unitdir}/system |
| 46 | fi |
| 47 | |
| 48 | install -d ${D}/${sysconfdir}/docker-distribution/registry/ |
| 49 | install ${S}/cmd/registry/config-example.yml ${D}/${sysconfdir}/docker-distribution/registry/config.yml |
| 50 | |
| 51 | # storage for the registry containers |
| 52 | install -d ${D}/${localstatedir}/lib/registry/ |
| 53 | } |
| 54 | |
| 55 | INSANE_SKIP_${PN} += "ldflags already-stripped" |
| 56 | INSANE_SKIP_docker-registry += "ldflags already-stripped" |
| 57 | |
| 58 | FILES_docker-registry = "${sbindir}/*" |
| 59 | FILES_docker-registry += "${systemd_unitdir}/system/docker-registry.service" |
| 60 | FILES_docker-registry += "${sysconfdir}/docker-distribution/*" |
| 61 | FILES_docker-registry += "${localstatedir}/lib/registry/" |
| 62 | |
| 63 | SYSTEMD_SERVICE_docker-registry = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker-registry.service','',d)}" |
| 64 | SYSTEMD_AUTO_ENABLE_docker-registry = "enable" |