summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 40792a98de87d5fdcf4344a57e22671edc82acbb (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
# Maintainer: Michael Duell <mail at akurei ddot me>
# Contributor: Andy Weidenbaum <archbaum@gmail.com>
# Contributor: Peter Reschenhofer <peter.reschenhofer@gmail.com>

pkgname=gocryptfs-git
pkgver=20181117
pkgrel=1
pkgdesc="Encrypted overlay filesystem written in Go"
arch=('i686' 'x86_64')
depends=('fuse')
# Go 1.6 added an optimized GCM implementation in amd64 assembly that
# uses AES-NI. This is faster than OpenSSL and is used if available. In
# all other cases OpenSSL is much faster and is used instead.
#
# https://github.com/rfjakob/gocryptfs#changelog
makedepends=('git' 'go')
url="https://github.com/rfjakob/gocryptfs"
license=('MIT')
source=(git+https://github.com/rfjakob/gocryptfs
        "gocryptfs.1")
sha256sums=('SKIP'
            '0944535a1bba09d9a56a0abfcf35d00b17338aa10078488aa20116a96bbb4fef')
provides=('gocryptfs')
conflicts=('gocryptfs')

pkgver() {
  cd ${pkgname%-git}
  git log -1 --format="%cd" --date=short --no-show-signature | sed "s|-||g"
}

prepare() {
  msg2 'Fetching dependencies...'
  export GOPATH="$PWD/GO"
  mkdir -p "$GOPATH/src/github.com/rfjakob"
  ln -sf "$PWD/gocryptfs" "$GOPATH/src/github.com/rfjakob/"
  go get -v -d github.com/rfjakob/gocryptfs
}

build() {
  msg2 'Building...'
  export GOPATH="$PWD/GO"
  "$GOPATH/src/github.com/rfjakob/gocryptfs/build.bash"
}

package() {
  pushd ${pkgname%-git}

  msg2 'Installing license...'
  install -Dm 644 LICENSE \
          -t "$pkgdir/usr/share/licenses/${pkgname%-git}"

  msg2 'Installing documentation...'
  install -Dm 644 *.md Documentation/* \
          -t "$pkgdir/usr/share/doc/${pkgname%-git}"

  msg2 'Installing man pages...'
  install -Dm 644 "$srcdir/gocryptfs.1" -t "$pkgdir/usr/share/man/man1"

  popd

  msg2 'Installing...'
  install -Dm 755 "$PWD/GO/bin/gocryptfs" -t "$pkgdir/usr/bin"
}