summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c13ad0ef3c8d8192186d22efcdc1c28639b8edcc (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
# Maintainer: Quentin Bourgeois <quentin+archlinux@bourgeois.eu>

pkgbase=viivakoodi
pkgname=("python2-${pkgbase}" "python-${pkgbase}")
pkgver=0.8.0
pkgrel=1
pkgdesc='Barcode generator for Python. Fork of pyBarcode project.'
arch=('any')
url="https://github.com/kxepal/${pkgbase}"
license=('MIT')
source=("${pkgbase}-${pkgver}.tar.gz::${url}/archive/${pkgver}.tar.gz")
sha256sums=('e1a17dc24975d5242202cfbb7534d69dd14eeb26bdf8a10f056c7b04904fef1e')
makedepends=('python-setuptools'
             'python2-setuptools')

check() {
    cd "${srcdir}/${pkgbase}-${pkgver}"
    
    for py_int in python3 python2; do
        msg "Testing ${pkgbase}-${pkgver} with ${py_int}"
        "${py_int}" ./test.py
    done
}

package_python-viivakoodi() {
    depends=('python-setuptools')
    optdepends=('python-pillow: render barcodes as images')
    checkdepends=('python-pytest'
                  'python-mock'
                  'python-tox')
    cd "${srcdir}/${pkgbase}-${pkgver}"
    python setup.py install --root="${pkgdir}/" --optimize=1

    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.launcher"
}

package_python2-viivakoodi() {
    depends=('python2-setuptools')
    optdepends=('python2-pillow: render barcodes as images')
    checkdepends=('python2-pytest'
                  'python2-mock'
                  'python2-tox') 

    cd "${srcdir}/${pkgbase}-${pkgver}"
    python2 setup.py install --root="${pkgdir}/" --optimize=1

    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.launcher"
}