summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fe6304f22b27026ff46b3f2121467dd4e87fc6c6 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Maintainer:

_module="iniparse"
_pkgname="python-$_module"
pkgname="$_pkgname-git"
pkgver=0.5.1.r0.g0f3da0a
pkgrel=1
pkgdesc="Better INI parser library for Python"
url="https://github.com/candlepin/python-iniparse"
license=('MIT')
arch=('any')

depends=(
  'python'
)
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)
checkdepends=(
  'python-tests'
)

provides=("$_pkgname=${pkgver%%.r*}")
conflicts=("$_pkgname")

_pkgsrc="candlepin.python-iniparse"
source=("$_pkgsrc"::"git+$url.git")
sha256sums=('SKIP')

pkgver() {
  cd "$_pkgsrc"
  git describe --long --tags --abbrev=7 \
    | sed -E 's/^[^0-9]*//;s/([^-]*-g)/r\1/;s/-/./g'
}

build() {
  cd "$_pkgsrc"
  python -m build --no-isolation --wheel
}

check() {
  cd "$_pkgsrc"
  python runtests.py
}

package() {
  cd "$_pkgsrc"
  python -m installer --destdir="$pkgdir" "$(ls -1 dist/*.whl | sort -rV | head -1)"

  install -Dm644 "LICENSE" -t "$pkgdir/usr/share/licenses/$pkgname/"

  rm -rf "$pkgdir/usr/share/doc"
}