aboutsummaryrefslogtreecommitdiffstats
path: root/community/docker-registry/APKBUILD
blob: 76fe18da623c9327b077067fc56e42f933f7b066 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
# Maintainer: Christian Kampka <christian@kampka.net>

pkgname=docker-registry
pkgver=2.6.1
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="ASL-2.0"
makedepends="git go"
install="$pkgname.pre-install"
pkguserss="docker-registry"
pkggroups="docker-registry"
subpackages="$pkgname-dbg"
source="$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz
	docker-registry.initd"
builddir="$srcdir/distribution-$pkgver"

prepare() {
	default_prepare || return 1

	cd "$builddir"
	sed -i '/^VERSION\s*=/d' Makefile
	sed -Ei "s/^(var Version\s*=\s*).*/\1\"$pkgver\"/" version/version.go
}

build() {
	cd "$builddir"

	# GOPATH fix
	mkdir -p Godeps/_workspace/src/github.com/docker
	ln -s "$builddir" Godeps/_workspace/src/github.com/docker/distribution || return 1

	make clean binaries \
		DISTRIBUTION_DIR="$builddir" \
		GOPATH="$builddir/Godeps/_workspace" \
		VERSION="$pkgver" \
		|| return 1
}

check() {
	cd "$builddir"

	./bin/registry --version
}

package() {
	cd "$builddir"

	install -D -m 755 bin/registry \
		"$pkgdir"/usr/bin/$pkgname || return 1

	install -D -m 644 cmd/registry/config-example.yml \
		"$pkgdir"/etc/$pkgname/config.yml || return 1

	install -D -m 644 LICENSE \
		"$pkgdir"/usr/share/licenses/$pkgname || return 1

	install -D -m 755 "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname
}

sha512sums="a2175cb5ab049599e1bdae7026dc84e14b79883eca3ceaafda54497a1743103f125f65fa3922c003363dd86aa1422f539aff8b17746b9768968fef757e931c36  docker-registry-2.6.1.tar.gz
96100a4de311afa19d293a3b8a63105e1fcdf49258aa8b1752befd389e6b4a2b1f70711341ea011b450d4468bd37dbd07a393ffab3b9aa1b2213cf0fdd915904  docker-registry.initd"