aboutsummaryrefslogtreecommitdiffstats
path: root/community/docker-registry/APKBUILD
blob: 34b277adffbf1ac4a6faf59c838d59e2500c5a18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Maintainer: Christian Kampka <christian@kampka.net>

pkgname=docker-registry
pkgver=2.4.0
pkgrel=1
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
	mkdir -p "${DISTRIBUTION_DIR}/Godeps/_workspace/src/github.com/docker/" || return 1
	ln -s "${DISTRIBUTION_DIR}" "${DISTRIBUTION_DIR}/Godeps/_workspace/src/github.com/docker/distribution" || return 1
	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="ef3d00ecde1350caed2716b185d86660  docker-registry-2.4.0.tar.gz
eaa66ce1509f0b2f257e2919b350fc46  docker-registry.initd"
sha256sums="cfd0c6212a05c047fa6a5b9093493d2de0b438936f2d7318a902263a4a3d7b0f  docker-registry-2.4.0.tar.gz
d35bfa20956a4dbd6070799fa8a1fd34c100070672e24c9b759df23c69b5431a  docker-registry.initd"
sha512sums="668ba35adbe897f73e93e3ec8766123a70b4d2b0d57d4ec3e9f77f6d60d381184acc331b04ab0391f4c648da223dd2338a4065027e6c63aa86b1f1a039d7e300  docker-registry-2.4.0.tar.gz
338d78b6813825154673c50cd73884297ebdd8c497ec933048dc5bf0863136e7bc308860ce71835d7e48a2b950266a69e60d318e382b18f8352d6c662851ed09  docker-registry.initd"