void-packages/srcpkgs/docker/template
2019-02-19 02:01:00 -03:00

56 lines
1.9 KiB
Bash

# Template file for 'docker'
pkgname=docker
version=18.09.2
revision=1
wrksrc="${pkgname}-ce-${version}"
hostmakedepends="git go pkg-config curl cmake"
makedepends="libbtrfs-devel sqlite-devel device-mapper-devel libseccomp-devel libapparmor-devel libltdl-devel"
short_desc="Pack, ship and run any application as a lightweight container"
maintainer="Andrea Brancaleoni <abc@pompel.me>"
license="Apache-2.0"
homepage="http://www.docker.io"
distfiles="https://github.com/docker/docker-ce/archive/v${version}.tar.gz"
checksum=f370a899ffc1a81028167697130fd1888d97753b1fb5b8fe1f2b12b71c3ebfc0
# These are required at run-time.
depends="iptables xz git"
nopie=yes
nostrip=yes
nocross=yes
archs="x86_64* ppc64le*"
system_groups="docker"
_docker_components="runc containerd tini proxy dockercli"
do_build() {
cd components/cli
# AUTO_GOPATH=1 doesn't seem to work for CLI
rm -rf .gopath
mkdir -p .gopath/src/github.com/docker
ln -sf $wrksrc/components/cli .gopath/src/github.com/docker/
GOPATH=$wrksrc/components/cli/.gopath LDFLAGS='' \
make VERSION=${version} dynbinary
rm -rf .gopath
cd ../../components/engine
AUTO_GOPATH=1 DOCKER_BUILDTAGS='seccomp apparmor' VERSION=${version} DOCKER_GITCOMMIT=v${version} \
hack/make.sh dynbinary
}
pre_build() {
cd components/engine
vmkdir usr/bin
sed -i "s|/usr/local|$DESTDIR/usr|g" hack/dockerfile/install/install.sh
for COMPONENT in $_docker_components; do
AUTO_GOPATH=1 LDFLAGS='' DOCKER_BUILDTAGS='seccomp apparmor' DOCKER_GITCOMMIT=v${version} \
hack/dockerfile/install/install.sh $COMPONENT
done
}
do_install() {
vbin ${wrksrc}/components/engine/bundles/dynbinary-daemon/dockerd dockerd
vbin ${wrksrc}/components/cli/build/docker docker
vinstall ${wrksrc}/components/cli/contrib/completion/bash/docker 644 usr/share/bash-completion/completions
vinstall ${wrksrc}/components/cli/contrib/completion/zsh/_docker 644 usr/share/zsh/site-functions
vsv docker
}