summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: aa9448000c9711cff41a9d01ef4af26d4608d7e6 (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
# Maintainer: Jianfeng Zhang <swordfeng123@gmail.com>

pkgname=google-drive-ocamlfuse-opam
_pkgname=google-drive-ocamlfuse
pkgver=0.7.4
pkgrel=1
pkgdesc="FUSE-based file system backed by Google Drive, written in OCaml (installed from opam)"
arch=('x86_64')
url='https://astrada.github.io/google-drive-ocamlfuse/'
license=('MIT')
depends=('curl' 'fuse2' 'sqlite')
makedepends=('opam')
provides=("${_pkgname}")
conflicts=("${_pkgname}")
source=()
sha256sums=()
options=()

prepare() {
    cd ${srcdir}
    opam init -a --disable-sandboxing && opam update
}

pkgver() {
    cd "${srcdir}"
    opam list ${_pkgname} --columns=version | awk '/^[^#]/{print}' | sort -V | tail -n 1
}

build() {
    cd "${srcdir}"
    opam switch create .
    eval $(opam env --switch=. --set-switch)
    opam install -y ${_pkgname}.${pkgver}
    cp "_opam/bin/${_pkgname}" "${_pkgname}"
    cp "_opam/doc/${_pkgname}/LICENSE" "LICENSE"
    opam switch -y remove .
}

package() {
    install -Dm755 "${srcdir}/${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}"
    install -Dm644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}