summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 75237ddecdd9dc3a438d6ff908963eaf7aa3a83d (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
# Maintainer:  tonybenoy <me@tonybenoy.com>
# Previous Maintainer:  jyantis <yantis@yantis.net>

pkgname=python-autopep8-git
pkgver=1.5r2586.fded37b
pkgrel=1
pkgdesc='Automatically formats Python code to conform to the PEP 8 style guide.'
arch=('any')
url='https://github.com/hhatto/autopep8'
license=('MIT')
depends=('python' 'python-pycodestyle')
source=('git+https://github.com/hhatto/autopep8.git')
sha256sums=('SKIP')
makedepends=('git')
provides=('python-autopep8')
conflicts=('python-autopep8')

pkgver() {
  cd autopep8

  # Pull the version tag from the file
  printf "%s" "$(grep -R "__version__ =" autopep8.py | awk -F\' '{print $2}')"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

check() {
  cd autopep8
  python test/test_autopep8.py
}

build() {
  cd autopep8
  python setup.py build
}

package() {
  cd autopep8
  python setup.py install --root="${pkgdir}" --optimize=1
  install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}