Advertisement
Guest User

PKGBUILD-anki-git

a guest
Apr 2nd, 2013
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.49 KB | None | 0 0
  1. # $Id$
  2. # Maintainer: Tobi Fankhänel <tobi at mail dot upb dot de>
  3. # Contributor: Sergej Pupykin <pupykin.s+arch at gmail dot com>
  4. # Contributor: Timm Preetz <timm at preetz dot us>
  5. # Contributor: Michael 'manveru' Fellinger <m.fellinger at gmail dot com>
  6. # Contributor: Dave Pretty <david dot pretty at gmail dot com>
  7. # Contributor: flowerfairy <ktj-arch ατ ktrask δοτ de>
  8.  
  9. pkgname=anki-git
  10. pkgver=20130402
  11. pkgrel=1
  12. pkgdesc="Helps you remember facts efficiently. Git Version."
  13. url="https://github.com/dae/anki"
  14. license=('GPL')
  15. arch=('any')
  16. depends=('python2-pyqt' 'python2-sqlalchemy' 'python2-simplejson'
  17.      'python2-pysqlite' 'python2-beautifulsoup3')
  18. makedepends=('git')
  19. optdepends=('python2-matplotlib: show graphs'
  20.         'sox: audio recording'
  21.         'portaudio')
  22. provides=('anki')
  23. conflicts=('anki' 'ankiqt-git')
  24. install=anki-git.install
  25.  
  26. _gitroot="git://github.com/dae/anki.git"
  27. _gitname="anki"
  28.  
  29. # Uncomment first three lines and last line as soon as pacman 4.1 has been released,
  30. # and leave the pkgver above empty.
  31. # pkgver() {
  32.   # cd "${srcdir}/${_gitname}"
  33.   # echo $(git describe --always | sed 's/-/./g')
  34.   # for git, if the repo has no tags, comment out the above and uncomment the next line:
  35.   #echo "$(git shortlog | grep -c '\s\+').$(git describe --always)"
  36.   # This will give you a count of the total commits and the hash of the commit you are on.
  37.   # Useful if you're making a repository with git packages so that they can have sequential
  38.   # version numbers. (Else a pacman -Syu may not update the package)
  39. # }
  40.  
  41.  
  42. build() {
  43.   cd "$srcdir"
  44.  
  45.   msg "Connecting to GIT server..."
  46.   if [[ -d ${_gitname} ]]; then
  47.     (cd ${_gitname} && git pull origin)
  48.   else
  49.     git clone ${_gitroot} ${_gitname}
  50.   fi
  51.   msg "GIT checkout done or server timeout"
  52.   msg "Starting make..."
  53.  
  54.   rm -rf ${_gitname}-build
  55.   git clone ${_gitname} ${_gitname}-build
  56.  
  57.   cd "$srcdir"/${_gitname}-build
  58.   sed -i 's|pyuic4 $i -o $py|python2-pyuic4 $i -o $py|' tools/build_ui.sh
  59.   ./tools/build_ui.sh
  60.   sed -i 's|#!/usr/bin/env python|#!/usr/bin/env python2|' runanki
  61.   rm -f anki.bat
  62. }
  63.  
  64. package() {
  65.   cd "$srcdir"/${_gitname}-build
  66.   mkdir -p "$pkgdir"/usr/{bin,share/{anki,pixmaps,applications,man/man1}}
  67.   cp -a * "$pkgdir"/usr/share/anki/
  68.   cd "$pkgdir"/usr/share/anki && (
  69.     mv runanki ../../bin/anki
  70.     mv anki.xpm anki.png ../pixmaps/
  71.     mv anki.desktop ../applications/
  72.     mv anki.1 ../man/man1/
  73.   )
  74.   rm -f "$pkgdir"/usr/share/anki/thirdparty/py*/_portaudio.so
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement