diff options
Diffstat (limited to 'abs/core/python_modules/python-docutils/PKGBUILD')
-rw-r--r-- | abs/core/python_modules/python-docutils/PKGBUILD | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/abs/core/python_modules/python-docutils/PKGBUILD b/abs/core/python_modules/python-docutils/PKGBUILD new file mode 100644 index 0000000..c0b5341 --- /dev/null +++ b/abs/core/python_modules/python-docutils/PKGBUILD @@ -0,0 +1,80 @@ +# $Id$ +# Maintainer: Sébastien Luttringer +# Contributor : Ionut Biru <ibiru@archlinux.org> +# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com> + +pkgbase=docutils +pkgname=('python2-docutils') +pkgver=0.11 +pkgrel=2 +pkgdesc='Set of tools for processing plaintext docs into formats such as HTML, XML, or LaTeX' +arch=('any') +url='http://docutils.sourceforge.net' +license=('custom') +makedepends=('python2') +source=("http://downloads.sourceforge.net/$pkgbase/$pkgbase-$pkgver.tar.gz") +md5sums=('20ac380a18b369824276864d98ec0ad6') + +build() { + cd $pkgbase-$pkgver +# for _p in "$srcdir"/*.patch; do +# msg2 "${_p##*/}" +# patch -p2 -i "$_p" +# done +# python3 setup.py build --build-lib=build/python +# find build/python -type f -exec \ +# sed -i '1s,^#! \?/usr/bin/\(env \|\)python$,#!/usr/bin/python3,' {} \; + python2 setup.py build --build-lib=build/python2 + find build/python2 -type f -exec \ + sed -i '1s,^#! \?/usr/bin/\(env \|\)python$,#!/usr/bin/python2,' {} \; +} + +check() { + cd $pkgbase-$pkgver + # we need utf locale to valid utf8 tests + export LANG=en_US.UTF-8 + # Disable python3 check + #msg2 'python checks' + #PYTHONPATH="$PWD/build/python/" python3 test3/alltests.py + msg2 'python2 checks' + PYTHONPATH="$PWD/build/python2/" python2 test/alltests.py +} + +#package_python-docutils() { +# depends=('python') +# +# cd $pkgbase-$pkgver +# python setup.py build --build-lib=build/python \ + install --root="$pkgdir" --optimize=1 + # symlink without .py +# for f in "$pkgdir"/usr/bin/*.py; do +# ln -s "$(basename $f)" "$pkgdir/usr/bin/$(basename $f .py)" +# done + # setup license +# install -D -m644 COPYING.txt "$pkgdir/usr/share/licenses/$pkgname/COPYING.txt" +# install -D -m644 licenses/python* "$pkgdir/usr/share/licenses/$pkgname/" +#} + +package_python2-docutils() { + depends=('python2') + provides=("docutils=$pkgver") + replaces=('docutils') + install=python2-docutils.install + + cd $pkgbase-$pkgver + python2 setup.py build --build-lib=build/python2 \ + install --root="$pkgdir" --optimize=1 + # fix python-docutils conflict + for _f in "$pkgdir"/usr/bin/*.py; do + mv -v "$_f" "${_f%.py}2.py" + done + # symlink without .py + for _f in "$pkgdir"/usr/bin/*.py; do + ln -s "$(basename $_f)" "$pkgdir/usr/bin/$(basename $_f .py)" + done + # setup license + install -D -m644 COPYING.txt "$pkgdir/usr/share/licenses/$pkgname/COPYING.txt" + install -D -m644 licenses/python* "$pkgdir/usr/share/licenses/$pkgname/" +} + +# vim:set ts=2 sw=2 et: |