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