summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3389137bb5861bfce23e7258dc173aa25a528015 (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
33
34
35
36
37
38
39
40
41
42
# Maintainer: Rich Lindsley <richli.ff at gmail dot com>
pkgname=python2-bufr
_py_pkgname=python-bufr # The pypi package name
pkgver=9bce29b
_py_pkgver="0.2-5" # the official version has a hyphen
pkgrel=1
pkgdesc="Generic Python BUFR file reader based on ECMWF BUFR library"
arch=('i686' 'x86_64')
url="https://github.com/pytroll/python-bufr"
license=('GPL3')
depends=('python2')
makedepends=('git' 'python2-numpy' 'eccodes')
options=(!emptydirs)
source=(git://github.com/pytroll/python-bufr.git patch.numpy)
md5sums=('SKIP'
         '0f451c84f573da6e902bba627db1c6fc')

pkgver() {
  cd $srcdir/$_gitname
  # Use the tag of the last commit
  git describe --always | sed 's|-|.|g'
}

build() {
  cd "$srcdir/$_py_pkgname/bufr"
  patch -p2 -i $srcdir/patch.numpy

  # We enforce this to be a strictly python2 package
  sed -i -e "s|^#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \
         -e "s|^#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
         -e "s|^#![ ]*/bin/env python$|#!/usr/bin/env python2|" \
         $(find ${srcdir} -name '*.py')
  sed -i setup.py -e 's/libraries = \[\x27bufr/libraries = \[\x27eccodes/'
  python2 setup.py build
}

package() {
  cd "$srcdir/$_py_pkgname/bufr"
  python2 setup.py install --root="$pkgdir/" --optimize=1
}

# vim:set ts=2 sw=2 et: