summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 88307e8f26c204e4d2de46b6c183f8c56d428fb6 (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
# Maintainer: John Jenkins <twodopeshaggy@gmail.com>
# Contributor: Timofey Titovets <nefelim4ag@gmail.com>

pkgname=drive-git
pkgver=r745.7222324
pkgrel=1
pkgdesc="Drive is a tiny program to pull or push Google Drive files. You need go1.2 installed in order to build the program."
arch=('any')
url="https://github.com/odeke-em/drive"
license=('Apache')
depends=('hicolor-icon-theme' 'gtk-update-icon-cache')
makedepends=('go' 'git')
conflicts=('drive')
options=('!strip' '!emptydirs')
install=$pkgname.install
source=($pkgname::git+https://github.com/odeke-em/drive.git)
md5sums=('SKIP')
_gourl=github.com/odeke-em/drive/drive-gen
pkgver() {
  cd $srcdir/$pkgname
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  export GOPATH=$srcdir
  go get google.golang.org/api/drive/v2
  go get $_gourl
  cd $srcdir/bin/
  ./drive-gen
  go get github.com/odeke-em/rsc/qr
  go get github.com/martini-contrib/binding
  cd $srcdir/$pkgname/drive-server
  go build -o drive-server
}

package() {
  mkdir -p "$pkgdir/usr/bin"
  install -p -m755 $srcdir/bin/drive "$pkgdir/usr/bin"
  install -p -m755 $srcdir/$pkgname/drive-server/drive-server "$pkgdir/usr/bin"
  
  cd "$srcdir/$pkgname"
  mkdir -p $pkgdir/usr/share/licenses/$pkgname
  install -m 0644 LICENSE $pkgdir/usr/share/licenses/$pkgname/
  mkdir -p "$pkgdir/usr/share/icons/hicolor/128x128/mimetypes"
  cp $srcdir/$pkgname/icons/*.png $pkgdir/usr/share/icons/hicolor/128x128/mimetypes
  mkdir -p "$pkgdir/usr/share/icons/hicolor/scalable/mimetypes"
  cp $srcdir/$pkgname/icons/*.svg $pkgdir/usr/share/icons/hicolor/scalable/mimetypes

}