summaryrefslogtreecommitdiff
path: root/pcr/docker-registry/PKGBUILD
blob: df9a92cc13a17d2e98c1e567c85d2ae30094204b (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
# Copyright (C) 2023 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the CC0 1.0 License.
# Maintainer: Parabola Hackers <dev@lists.parabola.nu>

pkgname=docker-registry
pkgver=2.8.1
pkgrel=2
pkgdesc="Docker registry server and associated tools"
arch=('armv7h' 'i686' 'x86_64')
url='https://github.com/docker/distribution.git'
license=('Apache')
makedepends=('go')
source=("https://github.com/distribution/distribution/archive/refs/tags/v${pkgver}.tar.gz")
sha512sums=('b9c8525051458ff4bf4592ca3ddba83c4325e88c6812ddb28c1567e331c1571f112e3b646ca970f0fe420f3b1d61d00f7151450d7b9948a08733606255731266')

prepare(){
  mkdir -p src/github.com/docker

  mv "distribution-${pkgver}" src/github.com/docker/distribution

  cd src/github.com/docker/distribution

  sed "s/^VERSION=\$(.*)/VERSION=${pkgver}/" -i Makefile
  sed "s/^REVISION=\$(.*)/REVISION=${pkgrel}/" -i Makefile
}

build(){
  export GOPATH="$GOPATH:${PWD}"
  cd src/github.com/docker/distribution

  make binaries
}

package(){
  cd src/github.com/docker/distribution

  install -d "${pkgdir}/usr/bin/"
  binaries="digest registry registry-api-descriptor-template"
  for binary in ${binaries} ; do
      install -m 755 "bin/${binary}" -t "${pkgdir}/usr/bin/"
  done

  install -d "${pkgdir}/usr/share/doc/${pkgname}/"
  files="BUILDING.md CONTRIBUTING.md LICENSE MAINTAINERS README.md ROADMAP.md"
  for file in ${files} ; do
      install -m 644 "${file}" -t "${pkgdir}/usr/share/doc/${pkgname}/"
  done

  cp -r docs "${pkgdir}/usr/share/doc/${pkgname}/"

  install -d "${pkgdir}/usr/share/doc/${pkgname}/registry-example-configs"
  files="config-cache.yml config-example.yml config-dev.yml"
  for file in ${files} ; do
      install -m 644 \
	      "cmd/registry/${file}" \
	      -t "${pkgdir}/usr/share/doc/${pkgname}/registry-example-configs"
  done
}