aboutsummaryrefslogtreecommitdiffstats
path: root/community/py-configobj/APKBUILD
blob: 165ca8942d23a648641212d09d96317201dc1ae8 (plain) (blame)
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
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=py-configobj
_realname=configobj
pkgver=5.0.6
pkgrel=2
pkgdesc="Python library for reading and writing of configuration files (ini)"
url="https://github.com/DiffSK/configobj"
arch="noarch"
license="BSD"
makedepends="$depends_dev python-dev python3-dev py-setuptools"
install=
subpackages="py3-$_realname:_py3 py2-$_realname:_py2"
source="$pkgname-$pkgver.tar.gz::https://github.com/DiffSK/configobj/archive/v$pkgver.tar.gz"

builddir="$srcdir"/$_realname-$pkgver


build() {
    cd "$builddir"
    python setup.py build || return 1
    python3 setup.py build || return 1
}

package() {
    cd "$builddir"
    python setup.py install --root=$pkgdir/ --optimize=1 || return 1
    python3 setup.py install --root=$pkgdir/ --optimize=1 || return 1
}

_py() {
    local python=$1
    pkgdesc="$pkgdesc - $python"
    install_if="$pkgname=$pkgver-r$pkgrel $python"
    local dir=$($python -c 'import sysconfig; print(sysconfig.get_path("stdlib"))')

    mkdir -p "$subpkgdir"${dir}
    mv "$pkgdir"${dir}/* "$subpkgdir"${dir}
}

_py2() {
    _py python2
    replaces="$pkgname"
}

_py3() {
    _py python3
}

md5sums="3ba0a72b09225a09c80b571ad60c3f54  py-configobj-5.0.6.tar.gz"
sha256sums="2e140354efcca6f558ff9ee941b435ae09a617bc071797bef62c8d6ed2033d5e  py-configobj-5.0.6.tar.gz"
sha512sums="326eb86e362f281ebf07abcb1cf7616abb270c482eafe842371cda8708245ca5e8262f1644b7164664ecc10e9004ed061c9de18cd233a657d4697dbc3ba3c59d  py-configobj-5.0.6.tar.gz"