enikulenkov

coursera-dl PKGBUILD

Jul 6th, 2013
71
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pkgname=coursera-dl-git
  2. _gitname=coursera
  3. pkgver=431.7b5916b
  4. pkgrel=1
  5. pkgdesc="Script for downloading Coursera.org videos and naming them"
  6. arch=('any')
  7. url="https://github.com/jplehmann/coursera/"
  8. license=('GPL')
  9. depends=('python2-beautifulsoup3' 'python2-distribute' 'python2-requests')
  10. makedepends=('git')
  11. source=("git://github.com/jplehmann/$_gitname.git")
  12. sha256sums=('SKIP')
  13.  
  14. pkgver() {
  15.   cd "$srcdir/$_gitname"
  16.   echo "$(git shortlog | grep -c '\s\+').$(git describe --always)"
  17. }
  18.  
  19. change_app_data_dir() {
  20.   cd "$srcdir/$_gitname"
  21.   sed -i "s/^ROOT =.*$/ROOT = os.path.join(os.path.expanduser(\"~\"), '.coursera_dl')/" $_gitname/define.py
  22. }
  23.  
  24. package() {
  25.   change_app_data_dir
  26.  
  27.   cd "$srcdir"
  28.   exe_name=$_gitname-dl
  29.   echo "python2 /usr/lib/python2.7/site-packages/$_gitname/coursera_dl.py \$@" >> $srcdir/$exe_name
  30.   install -Dm755 $exe_name "$pkgdir/usr/bin/$exe_name"
  31.  
  32.   cd "$srcdir/$_gitname"
  33.   install -dm755 $_gitname "$pkgdir/usr/lib/python2.7/site-packages/$_gitname"
  34.   install -cm644 $_gitname/*.py "$pkgdir/usr/lib/python2.7/site-packages/$_gitname/"
  35. }
  36.  
  37. # vim:set ts=2 sw=2 et:
RAW Paste Data