PKGBUILD 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # $Id$
  2. # Maintainer: Luke Shumaker <lukeshu@lukeshu.com>
  3. # Maintainer (Arch:python-markdown): Kyle Keen <keenerd@gmail.com>
  4. # Contributor (Arch:python-markdown): Angel Velasquez <angvp@archlinux.org>
  5. # Contributor (Arch:python-markdown): Andrew Antle <andrew dot antle at gmail dot com>
  6. # Contributor (Arch:python-markdown): Thomas Dziedzic < gostrc at gmail >
  7. # Contributor (Arch:python-markdown): Chaiwat Suttipongsakul <cwt at bashell dot com>
  8. # Rational for inclusion in [libre]:
  9. # - Used by libre/parabolaweb-utils
  10. pkgbase=python-markdown
  11. pkgname=('python-markdown' 'python2-markdown')
  12. pkgbase=${pkgbase}2
  13. pkgname=("${pkgname[@]/%/2}")
  14. _pkgbasename=Markdown
  15. pkgver=2.6.11
  16. pkgrel=2
  17. pkgrel+=.1
  18. pkgdesc="Python implementation of John Gruber's Markdown."
  19. arch=('any')
  20. url='http://pypi.python.org/pypi/Markdown'
  21. license=('BSD')
  22. depends=('python')
  23. makedepends=('python' 'python2' 'python-setuptools' 'python2-setuptools')
  24. source=("https://files.pythonhosted.org/packages/source/M/$_pkgbasename/$_pkgbasename-$pkgver.tar.gz")
  25. md5sums=('a67c1b2914f7d74eeede2ebe0fdae470')
  26. build() {
  27. # bug in 2.4, some DOS line endings slipped in
  28. find "$_pkgbasename-$pkgver/" -name '*py' | xargs sed -i 's|\r||g'
  29. cp -r $_pkgbasename-$pkgver "$srcdir/python2-markdown"
  30. cd "$srcdir/python2-markdown"
  31. find "$srcdir/python2-markdown" -name '*py' | xargs sed -i 's|#!/usr/bin/env python$|&2|'
  32. }
  33. package_python-markdown2() {
  34. depends=('python')
  35. provides=("python-markdown=$pkgver")
  36. conflicts=('python-markdown')
  37. cd "$srcdir/$_pkgbasename-$pkgver"
  38. python3 setup.py install --root="$pkgdir" --optimize=0
  39. install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  40. }
  41. package_python2-markdown2() {
  42. depends=('python2')
  43. provides=("python2-markdown=$pkgver")
  44. conflicts=('python2-markdown')
  45. cd "$srcdir/python2-markdown"
  46. python2 setup.py install --root="$pkgdir" --optimize=0
  47. mv "$pkgdir/usr/bin/markdown_py" "$pkgdir/usr/bin/markdown_py2"
  48. install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  49. }
  50. check_python-markdown2() {
  51. [[ $(python -c "import markdown; print(markdown.version)") == "$pkgver" ]]
  52. [[ $(python -c "import markdown; print(markdown.markdown('*test*'))") == "<p><em>test</em></p>" ]]
  53. }
  54. check_python2-markdown2() {
  55. [[ $(python2 -c "import markdown; print(markdown.version)") == "$pkgver" ]]
  56. [[ $(python2 -c "import markdown; print(markdown.markdown('*test*'))") == "<p><em>test</em></p>" ]]
  57. }