# Maintainer: Eivind Uggedal pkgname=docker pkgver=1.13.1 _ver=${pkgver/_/-} pkgrel=0 _gitcommit=v$_ver pkgdesc="Pack, ship and run any application as a lightweight container" url="http://www.docker.io/" arch="all" license="ASL 2.0" depends="iptables git xz" depends_dev="" makedepends="go btrfs-progs-dev bash linux-headers coreutils libseccomp-dev" options="!strip" install="$pkgname.pre-install" # $ grep COMMIT hack/dockerfile/binaries-commits # TOMLV_COMMIT=9baf8a8a9f2ed20a8e54160840c492f937eeaf9a # RUNC_COMMIT=2f7393a47307a16f8cee44a37b262e8b81021e3e # CONTAINERD_COMMIT=03e5862ec0d8d3b3f750e19fca3ee367e13c090e # TINI_COMMIT=949e6facb77383876aeff8a6944dde66b3089574 # LIBNETWORK_COMMIT=0f534354b813003a754606689722fe253101bc4e # VNDR_COMMIT=f56bd4504b4fad07a357913687fb652ee54bb3b0 _runc_ver=2f7393a47307a16f8cee44a37b262e8b81021e3e _containerd_ver=03e5862ec0d8d3b3f750e19fca3ee367e13c090e _libnetwork_ver=0f534354b813003a754606689722fe253101bc4e subpackages=" $pkgname-bash-completion:bashcomp:noarch $pkgname-zsh-completion:zshcomp:noarch $pkgname-vim:vim:noarch " source=" $pkgname-$pkgver.tar.gz::https://github.com/docker/docker/archive/v$_ver.tar.gz runc-$_runc_ver.tar.gz::https://github.com/opencontainers/runc/archive/$_runc_ver.tar.gz containerd-$_containerd_ver.tar.gz::https://github.com/docker/containerd/archive/$_containerd_ver.tar.gz libnetwork-$_libnetwork_ver.tar.gz::https://github.com/docker/libnetwork/archive/$_libnetwork_ver.tar.gz docker-openrc-fixes.patch " builddir="$srcdir"/$pkgname-$_ver _buildtags="exclude_graphdriver_aufs exclude_graphdriver_devicemapper" _runc_buildtags="seccomp" _runc_builddir="$srcdir"/runc-$_runc_ver _containerd_builddir="$srcdir"/containerd-$_containerd_ver _libnetwork_builddir="$srcdir"/libnetwork-$_libnetwork_ver _apply_patches() { local _dir="$1" local _prefix="$2" local i msg "applying patches for $_prefix" cd "$_dir" for i in $source; do case $i in ${_prefix}-*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; esac done } prepare() { _apply_patches "$builddir" docker || return 1 _apply_patches "$_runc_builddir" runc || return 1 } build() { cd "$_runc_builddir" cd "$builddir" export AUTO_GOPATH=1 export DOCKER_GITCOMMIT=$_gitcommit export DOCKER_BUILDTAGS=$_buildtags unset CC # prevent possible ccache issues # containerd msg "building containerd" cd "$_containerd_builddir" || return 1 mkdir -p src/github.com/docker/ ln -s "$_containerd_builddir" src/github.com/docker/containerd GOPATH="$PWD" LDFLAGS="" make GIT_COMMIT="$_containerd_ver" || return 1 # libnetwork (docker-proxy) msg "building docker-proxy" cd "$_libnetwork_builddir" || return 1 mkdir -p src/github.com/docker/ ln -s "$_libnetwork_builddir" src/github.com/docker/libnetwork GOPATH="$PWD" go build -v -ldflags="-linkmode=external" -o docker-proxy github.com/docker/libnetwork/cmd/proxy || return 1 # runc msg "building runc" cd "$_runc_builddir" || return 1 GOPATH="$PWD" make COMMIT="$_runc_ver" || return 1 # docker msg "building docker" cd "$builddir" ./hack/make.sh dynbinary } package() { cd "$builddir" local ver=$(cat VERSION) install -Dm755 bundles/$ver/dynbinary-client/docker-$ver \ "$pkgdir"/usr/bin/docker || return 1 install -Dm755 bundles/$ver/dynbinary-daemon/dockerd-$ver \ "$pkgdir"/usr/bin/dockerd || return 1 install -Dm755 "$_libnetwork_builddir"/docker-proxy \ "$pkgdir"/usr/bin/docker-proxy || return 1 install -Dm755 "$_runc_builddir"/runc \ "$pkgdir"/usr/bin/docker-runc || return 1 install -Dm755 "$_containerd_builddir"/bin/containerd \ "$pkgdir"/usr/bin/docker-containerd || return 1 install -Dm755 "$_containerd_builddir"/bin/containerd-shim \ "$pkgdir"/usr/bin/docker-containerd-shim || return 1 install -Dm755 "$_containerd_builddir"/bin/ctr \ "$pkgdir"/usr/bin/docker-containerd-ctr || return 1 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" 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" 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" 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 } sha512sums="e480a884d7bb4f41f5c036afd5fae878e03aa740297dd3dd4df0eb8766efa6426ba636453513b423666eea21ba99f162ec27885828f8348d8746424944a3cfb4 docker-1.13.1.tar.gz 2c2c925a1274eaef16d54881bfaa3e535956b67dd10eed87096ae9e7576234ff3598d37e635d3ce88c10fa9d102e79300bd48b69b972b6082f7acbfe2d4e90ea runc-2f7393a47307a16f8cee44a37b262e8b81021e3e.tar.gz 7c320a8f8fc12ae74ccda00d0f2f45f66d7592b5d209a62553cff3463a6006d8ad0275e0ae4ef07879455a32767f1d33f8f0f34392d28be4e6c217eee0f36ca3 containerd-03e5862ec0d8d3b3f750e19fca3ee367e13c090e.tar.gz 754cf6489968f3a83392c52b9445f71e8d5faca96e23ffc3ee2c6e8644bf065b64c7497395cf8fac9cc083ce9c7668260e319d01a8f10613e67db2d8254f6b06 libnetwork-0f534354b813003a754606689722fe253101bc4e.tar.gz 8296b1bc88ef3dec4f9038c4e0bf83120ac5870860f6662eac9f9f8850ea8b7596bcd2b47932551e804ae8b6f6f26ad3bc4ce6d49600cc8eaf0a3016c15a9ccf docker-openrc-fixes.patch"