PKGBUILD 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # Maintainer: Thomas Gubler <thomasgubler@gmail.com>
  2. pkgname=python2-mavlink-git
  3. pkgver=20140119
  4. pkgrel=1
  5. pkgdesc="Python implementation of the MAVLink protocol"
  6. arch=(any)
  7. url="http://qgroundcontrol.org/mavlink/pymavlink"
  8. license=('LGPL3')
  9. depends=('python2')
  10. makedepends=('git' 'python2' 'python2-setuptools')
  11. optdepends=()
  12. provides=('python2-mavlink-git')
  13. conflicts=()
  14. options=(!emptydirs)
  15. _gitroot="https://github.com/mavlink/mavlink/"
  16. _gitname="mavlink"
  17. _subfoldername="pymavlink"
  18. build() {
  19. cd "$srcdir"
  20. msg "Connecting to GIT server..."
  21. if [ -d $_gitname ] ; then
  22. cd $_gitname && git pull origin
  23. msg "The local files are updated."
  24. else
  25. git clone $_gitroot $_gitname
  26. fi
  27. msg "GIT checkout done or server timeout"
  28. cd "$srcdir/$_gitname/$_subfoldername"
  29. git clean -fdx
  30. msg "Starting make..."
  31. python2 setup.py build
  32. }
  33. package() {
  34. cd "$srcdir/$_gitname/$_subfoldername"
  35. python2 setup.py install --prefix=/usr --root=$pkgdir/ --optimize=1
  36. install -Dm644 "$srcdir/$_gitname/$_subfoldername/README.txt" "$pkgdir/usr/share/licenses/$pkgname/README.txt"
  37. }
  38. pkgver() {
  39. cd "$pkgname"
  40. printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  41. }
  42. # vim:set ts=2 sw=2 et: