updated on Tue Jan 10 12:02:00 UTC 2012
[aur-mirror.git] / ocaml-binary-git / PKGBUILD
blobcf25a400cfa227f2a5bb1bed0825600e2eebb286
1 # Maintainer: Sergei Lebedev <superbobry@gmail.com>
2 pkgname=ocaml-binary-git
3 pkgver=20110810
4 pkgrel=1
5 pkgdesc="Binary serialization of OCaml numeric types to and from strings."
6 arch=('i686' 'x86_64')
7 url="https://github.com/superbobry/ocaml-binary"
8 license='LGPL'
9 depends=('ocaml' 'ocaml-findlib')
10 makedepends=('git')
11 provides=('ocaml-binary')
12 conflicts=('ocaml-binary')
14 _gitroot="https://github.com/superbobry/ocaml-binary.git"
15 _gitname=${pkgname/-git/}
18 build () {
19   OCAMLFIND_DESTDIR="${pkgdir}$(ocamlfind printconf destdir)"
21   cd "$srcdir"
23   msg "Connecting to GIT server..."
25   if [ -d "$srcdir/$_gitname" ]; then
26     cd $_gitname && git pull origin
27     msg "The local files are updated."
28   else
29     git clone $_gitroot
30   fi
32   msg "GIT checkout done or server timeout"
33   msg "Starting make..."
35   cp -rf "$srcdir/$_gitname" "$srcdir/$_gitname-build"
36   cd "$srcdir/$_gitname-build"
38   ocaml setup.ml -configure --prefix /usr --destdir ${pkgdir} --disable-tests
39   ocaml setup.ml -build
42 package () {
43   OCAMLFIND_DESTDIR="${pkgdir}$(ocamlfind printconf destdir)"
45   cd "$srcdir/$_gitname-build"
47   mkdir -p "${OCAMLFIND_DESTDIR}/stublibs"
48   OCAMLFIND_DESTDIR="${OCAMLFIND_DESTDIR}" ocaml setup.ml -install || return 1