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

pkgname=autoenv-git
pkgver=0.2.1.r45.g1389885
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;s/v//' ||

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

}

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: