summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9771d8a0cc639e756aeaa8d7abce1ef919cd20ee (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: Chris Nixon <chris.nixon@sigma.me.uk>
pkgname=pyenv-virtualenv-git
pkgver=v1.0.0.0.ra3bc42c
pkgrel=1
pkgdesc='Pyenv plugin to manage virtualenv (a.k.a. python-virtualenv)'
arch=('any')
url='https://github.com/yyuu/pyenv-virtualenv'
license=('MIT')
conflicts=("pyenv-virtualenv")
provides=("pyenv-virtualenv")
depends=()
source=("$pkgname::git+https://github.com/yyuu/pyenv-virtualenv")
md5sums=('SKIP')

pkgver() {
  cd "$pkgname"
  # Get the first part of the latest tag and append the current revision
  echo "$(git describe --long --tags | sed 's/\(^.*\)-.*.*/\1/;s/-/./g').r$(git log --pretty=format:'%h' -n 1)"
}

package() {
    cd "$pkgname"
    git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
    cd ..
    mkdir -p "${pkgdir?}"/{opt/pyenv/plugins/pyenv-virtualenv,usr/bin}
    cd "${srcdir?}/$pkgname"
    cp -a -- * "$pkgdir"/opt/pyenv/plugins/pyenv-virtualenv

    for bin in $pkgdir/opt/pyenv/plugins/pyenv-virtualenv/bin/*; do
        ln -s /opt/pyenv/plugins/pyenv-virtualenv/bin/"$(basename $bin)" "$pkgdir/usr/bin/$(basename $bin)"
    done
}