summaryrefslogtreecommitdiff
path: root/extra/python-lxml/PKGBUILD
blob: 81595fd0b3821d06b77015d1c61376ac95913f21 (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 208846 2014-03-27 14:43:31Z fyan $
# Maintainer: Angel Velasquez <angvp@archlinux.org> 
pkgbase=python-lxml
pkgname=('python-lxml' 'python2-lxml' 'python-lxml-docs')
pkgver=3.3.3
pkgrel=2
arch=('i686' 'x86_64')
license=('BSD' 'custom')
url="http://lxml.de/"
makedepends=('python2' 'python' 'libxslt' 'python-cssselect' 'python2-cssselect')
source=(http://pypi.python.org/packages/source/l/lxml/lxml-${pkgver}.tar.gz{,.asc})
md5sums=('f2675837b4358a5ecab5fd9a783fd0e5'
         'SKIP')

check() {
  cd lxml-$pkgver
  # Workaround encoding issue
  LANG=en_US.UTF-8 make PYTHON=python2 test
  LANG=en_US.UTF-8 make PYTHON=python test
}

package_python2-lxml() {
  pkgdesc="Python2 binding for the libxml2 and libxslt libraries"
  depends=('python2' 'libxslt')
  optdepends=('python2-beautifulsoup3: support for parsing not well formed HTML'
              'python-lxml-docs: offline docs')

  cd lxml-$pkgver
  python2 setup.py install --root="${pkgdir}" --optimize=1
 
  install -Dm644 LICENSES.txt \
    "${pkgdir}"/usr/share/licenses/$pkgname/LICENSE
  install -Dm644 doc/licenses/BSD.txt \
    "${pkgdir}"/usr/share/licenses/$pkgname/BSD.txt
  install -Dm644 doc/licenses/elementtree.txt \
    "${pkgdir}"/usr/share/licenses/$pkgname/elementtree.txt
}

package_python-lxml() {
  pkgdesc="Python3 binding for the libxml2 and libxslt libraries"
  depends=('python' 'libxslt')
  optdepends=('python-lxml-docs: offline docs')

  cd lxml-$pkgver
  python setup.py install --root="${pkgdir}" --optimize=1
  
  install -Dm644 LICENSES.txt \
    "${pkgdir}"/usr/share/licenses/$pkgname/LICENSE
  install -Dm644 doc/licenses/BSD.txt \
    "${pkgdir}"/usr/share/licenses/$pkgname/BSD.txt
  install -Dm644 doc/licenses/elementtree.txt \
    "${pkgdir}"/usr/share/licenses/$pkgname/elementtree.txt
}

package_python-lxml-docs() {
  pkgdesc="Python binding for the libxml2 and libxslt libraries (docs)"
  options=('docs')

  cd lxml-$pkgver
  install -d "${pkgdir}"/usr/share/doc/${pkgbase}
  cp -r doc/html "${pkgdir}"/usr/share/doc/${pkgbase}

  install -Dm644 LICENSES.txt \
    "${pkgdir}"/usr/share/licenses/$pkgname/LICENSE
  install -Dm644 doc/licenses/BSD.txt \
    "${pkgdir}"/usr/share/licenses/$pkgname/BSD.txt
  install -Dm644 doc/licenses/elementtree.txt \
    "${pkgdir}"/usr/share/licenses/$pkgname/elementtree.txt
}