summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d255b3b1c92a4bae2e2ab23f3915d3d5dfc0bf12 (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
# Maintainer: Mike Javorski
# Contributor: S├ębastien "Seblu" Luttringer

pkgname=docker-bin
pkgver=19.03.2
pkgrel=1
pkgdesc='Pack, ship and run any application as a lightweight container, using official binaries'
arch=('x86_64')
url='https://www.docker.com/'
license=('Apache')
provides=('docker' 'docker-ce')
conflicts=('docker' 'docker-ce' 'docker-git')
depends=('bridge-utils' 'iproute2' 'device-mapper' 'sqlite' 'systemd' 'libseccomp' 'runc' 'containerd')
makedepends=('make' 'git' 'go' 'go-md2man')
optdepends=('btrfs-progs: btrfs backend support'
            'pigz: parallel gzip compressor support')
# don't strip binaries! A sha1 is used to check binary consistency.
options=('!strip')
source=(
  "https://download.docker.com/linux/static/edge/x86_64/docker-${pkgver}.tgz"
  "https://github.com/docker/docker-ce/archive/v${pkgver}.tar.gz"
  "docker.sysusers"
)
md5sums=('7f2abbb89d0572b8e72e1efdbdf37180'
         'a5950e5ec1a41eca3b2c943e11f72f55'
         '9a8b2744db23b14ca3cd350fdf73c179')

build() {
  ### go magics
  export GOPATH="$srcdir"
  export PATH="$GOPATH/bin:$PATH"

  # mock go packages so we can generate the man pages
  mkdir -p src/github.com/docker
  ln -rsfT docker-ce-$pkgver/components/cli src/github.com/docker/cli

  msg2 'Building man pages'
  pushd src/github.com/docker/cli >/dev/null
  # disable go-md2man compilation/install as we will use the packaged version
  sed -i -e '/go install.*go-md2man/d' scripts/docs/generate-man.sh
  make manpages 2>/dev/null
  popd >/dev/null
}

package() {
  cd docker
  # docker-proxy
  install -Dm755 'docker-proxy' "$pkgdir/usr/bin/docker-proxy"
  # docker-init
  install -Dm755 'docker-init' "$pkgdir/usr/bin/docker-init"
  # docker binary
  install -Dm755 'docker' "$pkgdir/usr/bin/docker"
  install -Dm755 'dockerd' "$pkgdir/usr/bin/dockerd"

  cd $srcdir/docker-ce-$pkgver/components/cli
  # completion
  install -Dm644 'contrib/completion/bash/docker' "$pkgdir/usr/share/bash-completion/completions/docker"
  install -Dm644 'contrib/completion/zsh/_docker' "$pkgdir/usr/share/zsh/site-functions/_docker"
  install -Dm644 'contrib/completion/fish/docker.fish' "$pkgdir/usr/share/fish/vendor_completions.d/docker.fish"

  # man
  install -dm755 "$pkgdir/usr/share/man"
  cp -r man/man* "$pkgdir/usr/share/man"

  cd $srcdir/docker-ce-$pkgver/components/packaging
  # systemd
  install -Dm644 'systemd/docker.socket' "$pkgdir/usr/lib/systemd/system/docker.socket"
  install -Dm644 'systemd/docker.service' "$pkgdir/usr/lib/systemd/system/docker.service"
  install -Dm644 "$srcdir/docker.sysusers" "$pkgdir/usr/lib/sysusers.d/docker.conf"

  cd $srcdir/docker-ce-$pkgver/components/engine
  install -Dm644 'contrib/udev/80-docker.rules' "$pkgdir/usr/lib/udev/rules.d/80-docker.rules"

  # vim syntax
  install -Dm644 'contrib/syntax/vim/syntax/dockerfile.vim' "$pkgdir/usr/share/vim/vimfiles/syntax/dockerfile.vim"
  install -Dm644 'contrib/syntax/vim/ftdetect/dockerfile.vim' "$pkgdir/usr/share/vim/vimfiles/ftdetect/dockerfile.vim"

  # nano syntax
  install -Dm644 'contrib/syntax/nano/Dockerfile.nanorc' "$pkgdir/usr/share/nano/Dockerfile.nanorc"
}

# vim:set ts=2 sw=2 et: