summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e74d50567ff83be4ff2884b3dfd7555ddedee258 (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
# Maintainer:  jyantis <yantis@yantis.net>

pkgname=autoenv-git
pkgver=0.2.0.r187.7eb70ec
pkgrel=1
pkgdesc='Directory based enviroments'
arch=('any')
url='https://github.com/kennethreitz/autoenv'
license=('custom')
source=("$pkgname"::'git+https://github.com/kennethreitz/autoenv.git')
sha256sums=('SKIP')
depends=('bash')
optdepends=('zsh: if you prefer zsh over bash')
install='autoenv.install'
makedepends=('git')
conflicts=('autoenv')

pkgver() {
  cd "$pkgname"
  set -o pipefail
  # git describe --tags --long | sed -r 's/([^-]*-g)/r\1/;s/-/./g' ||

  # If there is a setup.py then pull the version tag from the file
  if [ -f "setup.py" ]; then
    printf "%s." "$(grep -R "version=" setup.py | awk -F\' '{print $2}')"
  fi

  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package() {
  cd "$pkgname"

  install -D -m755 activate.sh "${pkgdir}/usr/share/${pkgname}/activate.sh"
  install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

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