# Maintainer: Carlos José Ruiz-Henestrosa Ruiz pkgname=beancount-import-git _name=${pkgname%-git} pkgver=1.0.7.r0.0341cf8 pkgrel=1 pkgdesc="" arch=('any') url="https://beancount.github.io/fava/" license=('MIT') groups=() depends=('beancount>=2.1.3' 'python>=3.5' 'python-setuptools' 'python-tornado' 'python-scikit-learn' 'python-nltk' 'python-dateutil' 'python-atomicwrites' 'python-jsonschema') makedepends=('git') provides=("beancount-import=${pkgver%%.r*}") conflicts=("beancount-import") source=('git://github.com/jbms/beancount-import.git') md5sums=('SKIP') pkgver() { cd "$srcdir/${_name}" # The repo does not tag releases, so we have to get creative _release_commit=$(git log -L '/version=/',+1:setup.py \ --max-count=1 --pretty="format:%h" | \ head --lines=1) _ver=$(grep version setup.py | sed "s/.*'\([^']*\)'.*/\1/") printf "%s.r%s.%s" \ "${_ver}" \ "$(git rev-list --count ${_release_commit}..HEAD)" \ "$(git rev-parse --short HEAD)" } build() { cd "$srcdir/${_name}" python setup.py build } package() { cd "$srcdir/${_name}" python setup.py install --root="${pkgdir}/" --optimize=1 --skip-build }