summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 423b2ff6df54699b554dd3ce2b843b66dfe9878c (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
# Maintainer: DanielNak <daniel@tee.cat>
# Contributor: Allen Wild <allenwild93@gmail.com>
# Contributor: Alireza Ayinmehr <alireza.darksun@gmail.com>
# Contributor: Abhishek Mukherjee <amukherjee@tripadvisor.com>

_pkgname=docker-credential-helpers
_author=docker
pkgname=docker-credential-secretservice-git
pkgver=0.8.1.r0.g292722b
pkgrel=1
pkgdesc="Store docker credentials using the D-Bus Secret Service"
arch=(x86_64 i686 aarch64)
url="https://github.com/docker/docker-credential-helpers"
url="https://github.com/$_author/$_pkgname"
license=('MIT')
depends=('libsecret')
makedepends=('git' 'go')
source=("git+${url}")
b2sums=('SKIP')

# If project uses github releases:
prepare() {
  cd "$_pkgname"
  git checkout $(curl -s https://api.github.com/repos/$_author/$_pkgname/releases | grep tag_name | cut -d '"' -f4 | head -n 1)
}

pkgver() {
  cd "$_pkgname"
  (set -o pipefail
    git describe --long --tags 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/v//' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}

build() {
  cd "$_pkgname"
  export CGO_CPPFLAGS="$CPPFLAGS"
  export CGO_CFLAGS="$CFLAGS"
  export CGO_CXXFLAGS="$CXXFLAGS"
  export CGO_LDFLAGS="$LDFLAGS"
  export GOFLAGS="-v -buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
  make secretservice
}

package() {
  cd "$_pkgname"
  install -Dm755 bin/build/docker-credential-secretservice "$pkgdir/usr/bin/docker-credential-secretservice"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

post_install() {
  echo "Remember to add the following to $HOME/.docker/config.json :"
  echo '
{
  "credsStore": "osxkeychain"
}
'
  echo "Refer to https://docs.docker.com/engine/reference/commandline/login/#credentials-store for more information"
}

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