summaryrefslogtreecommitdiff
path: root/libre/python-markdown2/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'libre/python-markdown2/PKGBUILD')
-rw-r--r--libre/python-markdown2/PKGBUILD66
1 files changed, 66 insertions, 0 deletions
diff --git a/libre/python-markdown2/PKGBUILD b/libre/python-markdown2/PKGBUILD
new file mode 100644
index 000000000..beebc60e3
--- /dev/null
+++ b/libre/python-markdown2/PKGBUILD
@@ -0,0 +1,66 @@
+# $Id$
+# Maintainer: Luke Shumaker <lukeshu@lukeshu.com>
+# Maintainer (Arch:python-markdown): Kyle Keen <keenerd@gmail.com>
+# Contributor (Arch:python-markdown): Angel Velasquez <angvp@archlinux.org>
+# Contributor (Arch:python-markdown): Andrew Antle <andrew dot antle at gmail dot com>
+# Contributor (Arch:python-markdown): Thomas Dziedzic < gostrc at gmail >
+# Contributor (Arch:python-markdown): Chaiwat Suttipongsakul <cwt at bashell dot com>
+
+# Rational for inclusion in [libre]:
+# - Used by libre/parabolaweb-utils
+
+pkgbase=python-markdown
+pkgname=('python-markdown' 'python2-markdown')
+pkgbase=${pkgbase}2
+pkgname=("${pkgname[@]/%/2}")
+_pkgbasename=Markdown
+pkgver=2.6.11
+pkgrel=2
+pkgrel+=.1
+pkgdesc="Python implementation of John Gruber's Markdown."
+arch=('any')
+url='http://pypi.python.org/pypi/Markdown'
+license=('BSD')
+depends=('python')
+makedepends=('python' 'python2' 'python-setuptools' 'python2-setuptools')
+source=("https://files.pythonhosted.org/packages/source/M/$_pkgbasename/$_pkgbasename-$pkgver.tar.gz")
+md5sums=('a67c1b2914f7d74eeede2ebe0fdae470')
+
+build() {
+ # bug in 2.4, some DOS line endings slipped in
+ find "$_pkgbasename-$pkgver/" -name '*py' | xargs sed -i 's|\r||g'
+
+ cp -r $_pkgbasename-$pkgver "$srcdir/python2-markdown"
+ cd "$srcdir/python2-markdown"
+ find "$srcdir/python2-markdown" -name '*py' | xargs sed -i 's|#!/usr/bin/env python$|&2|'
+}
+
+package_python-markdown2() {
+ depends=('python')
+ provides=("python-markdown=$pkgver")
+ conflicts=('python-markdown')
+ cd "$srcdir/$_pkgbasename-$pkgver"
+ python3 setup.py install --root="$pkgdir" --optimize=0
+ install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
+
+package_python2-markdown2() {
+ depends=('python2')
+ provides=("python2-markdown=$pkgver")
+ conflicts=('python2-markdown')
+ cd "$srcdir/python2-markdown"
+ python2 setup.py install --root="$pkgdir" --optimize=0
+ mv "$pkgdir/usr/bin/markdown_py" "$pkgdir/usr/bin/markdown_py2"
+ install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
+
+check_python-markdown2() {
+ [[ $(python -c "import markdown; print(markdown.version)") == "$pkgver" ]]
+ [[ $(python -c "import markdown; print(markdown.markdown('*test*'))") == "<p><em>test</em></p>" ]]
+}
+
+check_python2-markdown2() {
+ [[ $(python2 -c "import markdown; print(markdown.version)") == "$pkgver" ]]
+ [[ $(python2 -c "import markdown; print(markdown.markdown('*test*'))") == "<p><em>test</em></p>" ]]
+}
+