summaryrefslogtreecommitdiff
path: root/libre/python-reportlab/PKGBUILD
blob: 3b8374959a5151859f47ff1998b09916a8059329 (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
58
59
60
61
62
63
64
65
66
67
68
69
# $Id: PKGBUILD 155234 2016-01-03 19:23:59Z jelle $
# Maintainer (Arch):
# Contributor (Arch): Angel 'angvp' Velasquez <angvp[at]archlinux.com.ve>
# Contributor (Arch): William Rea <sillywilly@gmail.com>
# Maintainer: fauno <fauno@kiwwwi.com.ar>
# Contributor: borgo <nomail>
# Contributor: André Silva <emulatorman@hyperbola.info>

pkgbase=python-reportlab
pkgname=(python2-reportlab python-reportlab)
_origname=reportlab
pkgver=3.4.0
pkgrel=1.parabola1
pkgdesc="A proven industry-strength PDF generating solution, without nonfree Adobe T1 fonts support"
arch=('i686' 'x86_64' 'armv7h')
url="http://www.reportlab.org/rl_toolkit.html"
depends=('freetype2')
conflicts=('python-reportlab<=2.5-2')
makedepends+=('python' 'python2' 'freetype2' 'python2-pillow' 'python-pillow')
replaces=('python-reportlab<=2.5-2')
license=('custom')
source=("https://pypi.python.org/packages/87/f9/53b34c58d3735a6df7d5c542bf4de60d699cfa6035e113ca08b3ecdcca3f/reportlab-3.4.0.tar.gz"
        'free-fonts.patch')
md5sums=('3f2522cf3b69cd84426c216619bbff53'
         'eb3ac47734efb05b939fb88026aff8ed')

prepare() {
    cd $srcdir
    cp -rf ${_origname}-$pkgver "${_origname}2-$pkgver"

    _reportlab_source=("${_origname}-$pkgver" "${_origname}2-$pkgver")

    for x in ${_reportlab_source[@]}; do
      cd $srcdir/$x

      # remove nonfree Adobe T1 fonts support
      patch -p1 -i $srcdir/free-fonts.patch

      # Parabola contains those fonts from the ttf-bitstream-vera package
      rm -fv src/reportlab/fonts/{bitstream-vera-license.txt,Vera*}
    done
}

package_python2-reportlab() {
    conflicts+=('python2-reportlab-libre')
    replaces+=('python2-reportlab-libre')
    depends+=('python2' 'python2-pip' 'python2-pillow')

    cd "$srcdir/${_origname}2-$pkgver"
    python2 setup.py install --root=$pkgdir --optimize=1
    install -D -m644 LICENSE.txt $pkgdir/usr/share/licenses/$pkgname/license.txt
}

package_python-reportlab() {
    conflicts+=('python-reportlab-libre')
    replaces+=('python-reportlab-libre')
    depends+=('python3' 'python-pip' 'python-pillow')

    cd "$srcdir/${_origname}-$pkgver"
    python3 setup.py install --root=$pkgdir --optimize=1
    install -D -m644 LICENSE.txt $pkgdir/usr/share/licenses/$pkgname/license.txt
}


check() {
    cd ${srcdir}/${_origname}-${pkgver}
    python2 setup.py tests
    python setup.py tests
}