PKGBUILD 1.29 KB
Newer Older
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
# Contributions from Arch:
# Maintainer: Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
# Contributor: Felix Yan <felixonmars@archlinux>

pkgbase=python-html2text
pkgname=('python3-html2text' 'python2-html2text')
pkgver=2018.1.9
pkgrel=1
pkgdesc="A HTML to markdown-structured text converter"
arch=('any')
url="https://pypi.python.org/pypi/html2text/"
license=('GPL3')
makedepends=('python3-setuptools' 'python2-setuptools' 'python3-coverage' 'python2-coverage')
provides=('html2text')
replaces=('html2text')
source=($pkgname-$pkgver.tar.gz::https://github.com/Alir3z4/html2text/archive/$pkgver.tar.gz)
sha256sums=('9ad585bb7fda536ce231349e5046aefec7ccc2d111d11b859c9040edab94416b')

prepare() {
  cp -a html2text-$pkgver{,-py2}
}

build() {
  cd "${srcdir}"/html2text-$pkgver
  python3 setup.py build
  
  cd "${srcdir}"/html2text-$pkgver-py2
  python2 setup.py build
}

package_python3-html2text() {
  depends=('python3-setuptools')

  cd "${srcdir}"/html2text-$pkgver
  python3 setup.py install --root="${pkgdir}"
}

package_python2-html2text() {
  depends=('python2-setuptools')

  cd "${srcdir}"/html2text-$pkgver-py2
  python2 setup.py install --root="${pkgdir}"
  mv "$pkgdir/usr/bin/html2text"{,2}
}