# Maintainer: Christian Kampka pkgname=docker-registry pkgver=2.2.1 pkgrel=0 pkgdesc="An implementation of the Docker Registry HTTP API V2 for use with docker 1.6+." url="https://github.com/docker/distribution" arch="x86 x86_64" license="Apache 2.0" makedepends="git go" options="!strip" install="$pkgname.pre-install" pkguserss="docker-registry" pkggroups="docker-registry" source="$pkgname-$pkgver.tar.gz::${url}/archive/v${pkgver}.tar.gz docker-registry.initd" _builddir="$srcdir/distribution-$pkgver" prepare() { local i cd "$_builddir" for i in $source; do case $i in *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; esac done } build() { export DISTRIBUTION_DIR="${_builddir}" export GOPATH="${DISTRIBUTION_DIR}/Godeps/_workspace" cd "${DISTRIBUTION_DIR}" # GOPATH fix ln -s "${DISTRIBUTION_DIR}" "${DISTRIBUTION_DIR}/Godeps/_workspace/src/github.com/docker/distribution" make clean binaries || return 1 } package() { export DISTRIBUTION_DIR="${srcdir}/distribution-${pkgver}" install -v -D -m755 "${srcdir}/${pkgname}.initd" "${pkgdir}/etc/init.d/${pkgname}" install -v -D -m755 "${DISTRIBUTION_DIR}/bin/registry" "${pkgdir}/usr/bin/${pkgname}" install -v -D -m644 "${DISTRIBUTION_DIR}/cmd/registry/config-example.yml" "${pkgdir}/etc/${pkgname}/config.yml" install -v -D -m644 ${_builddir}/LICENSE ${pkgdir}/usr/share/licenses/${pkgname} } md5sums="bef1436940181c88c6abaa22f477e93d docker-registry-2.2.1.tar.gz eaa66ce1509f0b2f257e2919b350fc46 docker-registry.initd" sha256sums="1225e49b2b19b14a6c76c002885e8f852845a13ad79e0a4af2b943aa3c2fd0ea docker-registry-2.2.1.tar.gz d35bfa20956a4dbd6070799fa8a1fd34c100070672e24c9b759df23c69b5431a docker-registry.initd" sha512sums="5a6a14d8c7fc0f238c38b231489f83d2dd25315e525c25746af4d8f4575bbbdabaa790012aba6baff1c22aa0ce6fc24144c5060ebb6c32779b719323d9211a59 docker-registry-2.2.1.tar.gz 338d78b6813825154673c50cd73884297ebdd8c497ec933048dc5bf0863136e7bc308860ce71835d7e48a2b950266a69e60d318e382b18f8352d6c662851ed09 docker-registry.initd"