updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / godag-hg / PKGBUILD
blobd450fa2cfd3ee032577dfd1a8088a34e692ccb82
1 # Maintainer: Rémy Oudompheng <remy@archlinux.org>
2 pkgname=godag-hg
3 pkgver=370
4 pkgrel=1
5 pkgdesc="Automatic building tool for Go language"
6 arch=(i686 x86_64)
7 url="http://code.google.com/p/godag/"
8 license=('GPL3')
9 depends=('go')
10 makedepends=('mercurial')
11 provides=('godag')
12 options=('!strip')
14 _hgroot="https://code.google.com/p"
15 _hgrepo="godag"
17 build() {
18   cd "$srcdir"
19   msg "Connecting to Mercurial server...."
21   if [ -d $_hgrepo ] ; then
22     cd $_hgrepo
23     hg pull -u
24     msg "The local files are updated."
25   else
26     hg clone $_hgroot/$_hgrepo ${_hgrepo}
27   fi
29   msg "Mercurial checkout done or server timeout"
30   msg "Starting make..."
32   rm -rf "$srcdir/$_hgrepo-build"
33   cp -r "$srcdir/$_hgrepo" "$srcdir/$_hgrepo-build"
34   cd "$srcdir/$_hgrepo-build"
36   source /etc/profile.d/go.sh
37   if [[ "$CARCH" == "i686" ]]; then
38       export GOARCH=386
39   else
40       export GOARCH=amd64
41   fi
42   bash build.sh build
45 package() {
46   cd "$srcdir/$_hgrepo-build"
47   install -D -m 755 gd ${pkgdir}/usr/bin/gd
48   install -D -m 755 util/gd-completion.sh ${pkgdir}/etc/bash_completion.d/gd
49   install -D -m 755 util/gdmk-completion.sh ${pkgdir}/etc/bash_completion.d/gdmk
50   install -D -m 644 util/gd.1 ${pkgdir}/usr/share/man/man1/gd.1
51   ln -sf gd.1 ${pkgdir}/usr/share/man/man1/godag.1