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

pkgname=google-drive-ocamlfuse-opam
_pkgname=google-drive-ocamlfuse
pkgver=0.7.22
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=()

pkgver() {
    cd "${srcdir}"
    opam init -a --disable-sandboxing 1>/dev/null 2>/dev/null && opam update 1>/dev/null 2>/dev/null
    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"
}