aboutsummaryrefslogtreecommitdiffstats
path: root/community/docker/APKBUILD
blob: 9ee52c5672e4da0a6e62f5b124d2d306275a5ea5 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Maintainer: Eivind Uggedal <eivind@uggedal.com>
pkgname=docker
pkgver=1.8.2
pkgrel=3
_gitcommit=0a8c2e3
pkgdesc="Pack, ship and run any application as a lightweight container"
url="http://www.docker.io/"
arch="x86_64"
license="ASL 2.0"
depends="iptables git xz"
depends_dev=""
makedepends="go sqlite-dev btrfs-progs-dev bash linux-headers"
options="!strip"
install="$pkgname.pre-install"
subpackages="
	$pkgname-bash-completion:bashcomp
	$pkgname-zsh-completion:zshcomp
	$pkgname-vim:vim
	"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/docker/docker/archive/v$pkgver.tar.gz
	openrc-fixes.patch
	"

_builddir="$srcdir"/$pkgname-$pkgver
_buildtags="exclude_graphdriver_aufs exclude_graphdriver_devicemapper"

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() {
	cd "$_builddir"

	export AUTO_GOPATH=1
	export DOCKER_GITCOMMIT=$_gitcommit
	export DOCKER_BUILDTAGS=$_buildtags
	unset CC # prevent possible ccache issues

	./hack/make.sh dynbinary
}

package() {
	cd "$_builddir"
	local ver=$(cat VERSION)

	install -Dm755 bundles/$ver/dynbinary/docker-$ver \
		"$pkgdir"/usr/bin/docker
	install -Dm755 bundles/$ver/dynbinary/dockerinit-$ver \
		"$pkgdir"/usr/lib/docker/dockerinit

	install -Dm755 contrib/init/openrc/docker.initd \
		"$pkgdir"/etc/init.d/docker
	install -Dm644 contrib/init/openrc/docker.confd \
		"$pkgdir"/etc/conf.d/docker
}

bashcomp() {
	pkgdesc="Bash completion for Docker"
	arch="noarch"
	depends=""
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	install -Dm644 "$_builddir"/contrib/completion/bash/$pkgname \
		"$subpkgdir"/usr/share/bash-completion/completions/$pkgname
}

zshcomp() {
	pkgdesc="Zsh completion for $pkgname"
	arch="noarch"
	depends=""
	install_if="$pkgname=$pkgver-r$pkgrel zsh"

	install -Dm644 "$_builddir"/contrib/completion/zsh/_$pkgname \
		"$subpkgdir"/usr/share/zsh/site-functions/_$pkgname || return 1
}

vim() {
	depends=""
	pkgdesc="Vim syntax for Docker"
	arch="noarch"

	local f=
	for f in ftdetect/dockerfile.vim syntax/dockerfile.vim; do
		install -Dm644 "$_builddir"/contrib/syntax/vim/$f \
			"$subpkgdir"/usr/share/vim/vimfiles/$f
	done
}

md5sums="4faf25b356900f3e7599783ad4565e69  docker-1.8.2.tar.gz
2c31dfb597ded751e566602611ddb6ae  openrc-fixes.patch"
sha256sums="457569ca8edd70293132789bfe51636f86cd8a46a60c6d02d5ee8600cf79f74b  docker-1.8.2.tar.gz
ae9c3c780ef5e9ffb5666cbe343b0ecb9f498f1ab5d68373b39eea76b68a0f7c  openrc-fixes.patch"
sha512sums="c44f3cc0e0b7db463730620c0ec4b1aa1ea4a42f6528c891914318cb945aaa906e8eeaf91d32fb2d87a11ea1be428d1cf0de7d3ce4681c7db37390e4e1f79c67  docker-1.8.2.tar.gz
79e78eed7eb1bfc468103fd4b171f66eabbffd3e504bfe1b8bdb40441292f316f6584fae415b93f0630d6975f888f1db4fb702886e78b6adc3a9a156a80de9b3  openrc-fixes.patch"