summaryrefslogtreecommitdiff
path: root/pcr/python-rospkg/PKGBUILD
blob: b2dd7fb9dfb61beb5f3c4884b55b4282b9bd693d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Maintainer : Parabola GNU / Linux-libre Aurelien Desbrieres <aurelien@cwb.io>

_pkgname=rospkg
pkgname=(python{,2}-$_pkgname)
pkgver=1.1.7
pkgrel=1
pkgdesc="ROS package library"
arch=(any)
url="http://wiki.ros.org/rospkg"
license=('BSD3')

makedepends=(python{,2}-setuptools)
source=("https://files.pythonhosted.org/packages/source/r/rospkg/rospkg-${pkgver}.tar.gz")
sha256sums=('c6e918e13a6a51b362fd07b9a298f64e4cb066ee1e6168ac95b690c0b609b2ab')

prepare() {
  cp -r "$srcdir"/$_pkgname-$pkgver "$srcdir"/$_pkgname-$pkgver-python2
  mv    "$srcdir"/$_pkgname-$pkgver "$srcdir"/$_pkgname-$pkgver-python

  cd "$srcdir"/$_pkgname-$pkgver-python2
  find -type f -print0 | xargs -0 sed -i -e 's/#!\/usr\/bin\/env python/#!\/usr\/bin\/env python2/g'
}

_package() {
  depends=($1)
  cd "$srcdir"/$_pkgname-$pkgver-$1
  $1 setup.py install --root="$pkgdir"
}

for _pkg in "${pkgname[@]}"; do
  eval "package_$_pkg () { _package ${_pkg%%-*}; }"
done