Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

gocode build script for Arch Linux

By: a guest on May 6th, 2012  |  syntax: Bash  |  size: 1.44 KB  |  hits: 51  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # Maintainer: Daniel Micay <danielmicay@gmail.com>
  2. # Contributor: Dave Reisner <d@falconindy.com>
  3.  
  4. pkgname=gocode
  5. _tagname=go1
  6. # the pkgver will match the gocode tag release(_tagname)
  7. pkgver=20120506
  8. pkgrel=1
  9. #epoch=1
  10. pkgdesc="An autocompletion/refactoring daemon for the Go programming language"
  11. arch=(i686 x86_64)
  12. url="https://github.com/nsf/gocode"
  13. license=('GPL')
  14. depends=('go')
  15. provides=('gocode')
  16. conflicts=('gocode')
  17. makedepends=('git')
  18. optdepends=('auto-complete: emacs autocompletion')
  19.  
  20. _gitroot="https://github.com/nsf/gocode.git"
  21. _gitname="gocode"
  22.  
  23. build() {
  24.   cd "$srcdir"
  25.   msg "Connecting to GIT server...."
  26.   if [[ -d "$_gitname.git" ]]; then
  27.     cd "$_gitname.git" && git pull origin
  28.     msg "The local files are updated."
  29.   else
  30.     git clone "$_gitroot" "$_gitname.git"
  31.   fi
  32.   msg "GIT checkout done or server timeout"
  33.   msg "Starting build..."
  34.  
  35.   rm -rf $srcdir/src
  36.   mkdir -p $srcdir/src # let 'go' tool happy
  37.   git clone "$srcdir/$_gitname.git" "$srcdir/src/$_gitname"
  38.   cd "$srcdir/src/$_gitname"
  39.   git checkout $_tagname
  40.  
  41.   GOPATH=$srcdir go build -o $pkgdir/usr/bin/gocode
  42. }
  43.  
  44. package() {
  45.   cd "$srcdir/src/gocode"
  46.   install -Dm644 vim/autoload/gocomplete.vim "$pkgdir/usr/share/vim/vimfiles/autoload/gocomplete.vim"
  47.   install -Dm644 vim/ftplugin/go.vim "$pkgdir/usr/share/vim/vimfiles/ftplugin/go.vim"
  48.   install -Dm644 emacs/go-autocomplete.el "$pkgdir/usr/share/emacs/site-lisp/go-autocomplete.el"
  49. }