archrelease: copy trunk to community-any
[ArchLinux/community.git] / python-commonmark / repos / community-any / PKGBUILD
blobfb7afb1ae0b2c94660ba1413d95ef82b30305092
1 # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
2 # Maintainer: Caleb Maclennan <caleb@alerque.com>
4 pkgname=python-commonmark
5 pkgver=0.9.1
6 pkgrel=9
7 pkgdesc='Python parser for the CommonMark Markdown spec'
8 url='https://pypi.org/project/commonmark/'
9 arch=('any')
10 license=('BSD')
11 depends=('python-docutils'
12          'python-future')
13 makedepends=('python-'{build,installer,wheel}
14              'python-setuptools'
15              'python-sphinx'
16              'python-sphinx_rtd_theme')
17 checkdepends=('python-hypothesis')
18 options=('!makeflags')
19 source=(${pkgname}-${pkgver}.tar.gz::https://github.com/readthedocs/commonmark.py/archive/${pkgver}.tar.gz)
20 sha256sums=('b5d5be6af35a183c3f915d714b31b61e6918894051114419f9ac0bbb715bf4c6')
21 sha512sums=('a6de0b384247ff79fe326012bd1fc71135e6ae5bc7b6a15d5402969a94f81fdd802f1a9d557c504eb74bfb3fea68f55355a70a6e0112a620cc285cf9039892e4')
23 build() {
24   cd commonmark.py-${pkgver}
25   python -m build -wn
26   make -C docs man text SPHINXBUILD=sphinx-build
29 check() {
30   cd commonmark.py-${pkgver}
31   export PYTHONPATH=.
32   python commonmark/tests/unit_tests.py
33   python -m unittest discover
36 package() {
37   cd commonmark.py-${pkgver}
38   python -m installer -d "${pkgdir}" dist/*.whl
39   install -Dm 644 README.rst CHANGELOG.md -t "${pkgdir}/usr/share/doc/${pkgname}"
40   install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
41   install -Dm 644 docs/_build/text/* -t "${pkgdir}/usr/share/doc/${pkgname}"
42   install -Dm 644 docs/_build/man/commonmark-py.1 "${pkgdir}/usr/share/man/man1/${pkgname}.1"
43   mv "${pkgdir}/usr/bin/cmark"{,-py3}
46 # vim: ts=2 sw=2 et: