summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2357ea67bfd4cfb0991e9d69067375cd3547969d (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
# Maintainer: Nahuel Morata <nahuelmorata@gmail.com>
pkgname=drivesync-git
_origname="drivesync"
pkgver=1.4.0.r0.g1124fc6
pkgrel=1
pkgdesc="A command line utility that synchronizes your Google Drive files with a local folder on your machine"
arch=('any')
url="https://github.com/MStadlmeier/drivesync"
license=('MIT')
depends=("ruby")
provides=("drivesync")
install=.INSTALL
source=("$pkgname::git+https://github.com/MStadlmeier/drivesync.git")
md5sums=("SKIP")

pkgver() {
  cd "$pkgname"
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
    gem install bundler
}

build() {
	cd "$pkgname"
	~/.gem/ruby/$(ls ~/.gem/ruby | tail -n 1)/bin/bundle install
}

package() {
    if [ ! -d /opt/drivesync ]; then
        echo "alias drivesync='ruby /opt/drivesync/drivesync.rb'" >> ~/.bashrc
    fi

    mv -T $pkgname /tmp/drivesync
}