git » python-configobj.git » main » tree

[main] / PKGBUILD

# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Angel Velasquez <angvp@archlinux.com.ve>
# Contributor: Stefan Husmann  <stefan-husmann@t-online.de>
# Contributor: Manuel C.

pkgname=python-configobj
pkgver=5.0.8
pkgrel=5
pkgdesc='Simple config file reader and writer'
arch=(any)
url='https://github.com/DiffSK/configobj'
license=(BSD)
depends=(python-six)
makedepends=(git python-setuptools)
source=("git+$url#commit=a58c2f4de0e9e854daa67fec630506e5a461eea9") # tag: v5.0.8
b2sums=('02df6ff081dc22d639314532dfc496400048f3fde36e782159132f3351f7e3a9b15a31cd4846b2a6c6c2b54bddad4b8128f6ba533c68664da06b0274a993a223')

prepare() {
  cd configobj
  # Avoid the need for a local configobj install just for VERSION
  local _version=$(grep -oP "__version__ = '\K[^']+" src/configobj/_version.py)
  sed -i "/from validate/d;s/VERSION/\"$_version\"/" setup_validate.py
}

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