# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=setuptools-scm
pkgbase="python-${_realname}"
pkgname=("python-${_realname}")
pkgver=6.0.1
pkgrel=1
pkgdesc="Handles managing your python package versions in scm metadata"
arch=('any')
license=('MIT')
url='https://github.com/pypa/setuptools_scm'
depends=('python')
makedepends=('python-setuptools')
provides=("python3-${_realname}")
replaces=("python3-${_realname}")
conflicts=("python3-${_realname}")
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname/-/_}-${pkgver}.tar.gz")
sha256sums=('d1925a69cb07e9b29416a275b9fadb009a23c148ace905b2fb220649a6c18e92')

prepare() {
  cd "${srcdir}/${_realname/-/_}-${pkgver}"
}

build() {
  cd "${srcdir}/${_realname/-/_}-${pkgver}"
  /usr/bin/python setup.py build
}

package() {
  cd "${srcdir}/${_realname/-/_}-${pkgver}"
  /usr/bin/python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1
  install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
