From b7af8cfaad94afbe42a8fd8adc85696e4a7d0002 Mon Sep 17 00:00:00 2001 From: Britney Fransen Date: Thu, 1 Mar 2018 16:38:13 +0000 Subject: docutil: update to 0.14 split pkg with python-docutils and python2-docutils --- abs/core/docutils/PKGBUILD | 32 ---- abs/core/python_modules/docutils/PKGBUILD | 78 ++++++++ .../docutils/python2-docutils.install | 9 + .../01-python33-relative-import.patch | 196 --------------------- abs/core/python_modules/python-docutils/PKGBUILD | 80 --------- .../python_modules/python-docutils/__changelog | 1 - .../python-docutils/python2-docutils.install | 9 - 7 files changed, 87 insertions(+), 318 deletions(-) delete mode 100644 abs/core/docutils/PKGBUILD create mode 100644 abs/core/python_modules/docutils/PKGBUILD create mode 100644 abs/core/python_modules/docutils/python2-docutils.install delete mode 100644 abs/core/python_modules/python-docutils/01-python33-relative-import.patch delete mode 100644 abs/core/python_modules/python-docutils/PKGBUILD delete mode 100644 abs/core/python_modules/python-docutils/__changelog delete mode 100644 abs/core/python_modules/python-docutils/python2-docutils.install diff --git a/abs/core/docutils/PKGBUILD b/abs/core/docutils/PKGBUILD deleted file mode 100644 index 0b04dc3..0000000 --- a/abs/core/docutils/PKGBUILD +++ /dev/null @@ -1,32 +0,0 @@ -# $Id: PKGBUILD 87861 2010-08-18 14:26:28Z ibiru $ -# Maintainer : Ionut Biru -# Contributor: Sergej Pupykin - -pkgname=docutils -pkgver=0.7 -pkgrel=5 -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') -depends=('python2') -source=(http://downloads.sourceforge.net/docutils/docutils-$pkgver.tar.gz) -md5sums=('9aec716baf15d06b5aa57cf8d5591c15') - -build() { - cd ${srcdir}/${pkgname}-${pkgver} - python2 setup.py install --root=${pkgdir} --optimize=1 - - for f in ${pkgdir}/usr/bin/*.py; do - ln -s $(basename $f) $pkgdir/usr/bin/$(basename $f .py) - done - - sed -e 's|#! /usr/bin/env python|#!/usr/bin/env python2|' \ - -i ${pkgdir}/usr/lib/python2.7/site-packages/docutils/readers/python/pynodes.py - sed -e 's|#!/usr/bin/env python|#!/usr/bin/env python2|' \ - -i ${pkgdir}/usr/lib/python2.7/site-packages/docutils/_string_template_compat.py - - install -D -m644 COPYING.txt ${pkgdir}/usr/share/licenses/${pkgname}/COPYING.txt - install -D -m644 licenses/python* ${pkgdir}/usr/share/licenses/${pkgname}/ -} - diff --git a/abs/core/python_modules/docutils/PKGBUILD b/abs/core/python_modules/docutils/PKGBUILD new file mode 100644 index 0000000..1b7cbe6 --- /dev/null +++ b/abs/core/python_modules/docutils/PKGBUILD @@ -0,0 +1,78 @@ +# $Id$ +# Maintainer: Sébastien Luttringer +# Contributor : Ionut Biru +# Contributor: Sergej Pupykin + +pkgbase=docutils +pkgname=('python-docutils' 'python2-docutils') +pkgver=0.14 +pkgrel=1 +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=('python' 'python2') +source=("http://downloads.sourceforge.net/$pkgbase/$pkgbase-$pkgver.tar.gz") +md5sums=('c53768d63db3873b7d452833553469de') + +build() { + cd $pkgbase-$pkgver + msg2 python3 + python3 setup.py build --build-lib=build/python + find build/python -type f -exec \ + sed -i '1s,^#! \?/usr/bin/\(env \|\)python$,#!/usr/bin/python3,' {} \; + msg2 python2 + 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: diff --git a/abs/core/python_modules/docutils/python2-docutils.install b/abs/core/python_modules/docutils/python2-docutils.install new file mode 100644 index 0000000..3e414af --- /dev/null +++ b/abs/core/python_modules/docutils/python2-docutils.install @@ -0,0 +1,9 @@ +post_upgrade() { + [ $(vercmp '0.8.1-2' "$2") -gt 0 ] && cat < -Date: Wed, 11 Jul 2012 12:25:14 +0000 -Subject: [PATCH] Fix [3541369] Relative __import__ also with Python 3.3. - -git-svn-id: https://docutils.svn.sourceforge.net/svnroot/docutils/trunk@7486 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 ---- - docutils/HISTORY.txt | 1 + - docutils/docutils/_compat.py | 11 +++++++++++ - docutils/docutils/languages/__init__.py | 8 ++++++-- - docutils/docutils/parsers/__init__.py | 5 ++++- - .../docutils/parsers/rst/directives/__init__.py | 6 +++++- - .../docutils/parsers/rst/languages/__init__.py | 6 +++++- - docutils/docutils/readers/__init__.py | 5 ++++- - docutils/docutils/writers/__init__.py | 7 +++++-- - 8 files changed, 41 insertions(+), 8 deletions(-) - -diff --git a/docutils/docutils/_compat.py b/docutils/docutils/_compat.py -index 1450534..19654a6 100644 ---- a/docutils/docutils/_compat.py -+++ b/docutils/docutils/_compat.py -@@ -35,3 +35,14 @@ else: - # using this hack since 2to3 "fixes" the relative import - # when using ``from io import BytesIO`` - BytesIO = __import__('io').BytesIO -+ -+if sys.version_info < (2,5): -+ import __builtin__ -+ -+ def __import__(name, globals={}, locals={}, fromlist=[], level=-1): -+ """Compatibility definition for Python 2.4. -+ -+ Silently ignore the `level` argument missing in Python < 2.5. -+ """ -+ # we need the level arg because the default changed in Python 3.3 -+ return __builtin__.__import__(name, globals, locals, fromlist) -diff --git a/docutils/docutils/languages/__init__.py b/docutils/docutils/languages/__init__.py -index 675bb0e..57d3ec2 100644 ---- a/docutils/docutils/languages/__init__.py -+++ b/docutils/docutils/languages/__init__.py -@@ -11,7 +11,11 @@ This package contains modules for language-dependent features of Docutils. - - __docformat__ = 'reStructuredText' - -+import sys -+ - from docutils.utils import normalize_language_tag -+if sys.version_info < (2,5): -+ from docutils._compat import __import__ - - _languages = {} - -@@ -26,7 +30,7 @@ def get_language(language_code, reporter=None): - if tag in _languages: - return _languages[tag] - try: -- module = __import__(tag, globals(), locals()) -+ module = __import__(tag, globals(), locals(), level=1) - except ImportError: - continue - _languages[tag] = module -@@ -35,6 +39,6 @@ def get_language(language_code, reporter=None): - reporter.warning( - 'language "%s" not supported: ' % language_code + - 'Docutils-generated text will be in English.') -- module = __import__('en', globals(), locals()) -+ module = __import__('en', globals(), locals(), level=1) - _languages[tag] = module # warn only one time! - return module -diff --git a/docutils/docutils/parsers/__init__.py b/docutils/docutils/parsers/__init__.py -index 2683376..341e358 100644 ---- a/docutils/docutils/parsers/__init__.py -+++ b/docutils/docutils/parsers/__init__.py -@@ -8,7 +8,10 @@ This package contains Docutils parser modules. - - __docformat__ = 'reStructuredText' - -+import sys - from docutils import Component -+if sys.version_info < (2,5): -+ from docutils._compat import __import__ - - - class Parser(Component): -@@ -43,5 +46,5 @@ def get_parser_class(parser_name): - parser_name = parser_name.lower() - if parser_name in _parser_aliases: - parser_name = _parser_aliases[parser_name] -- module = __import__(parser_name, globals(), locals()) -+ module = __import__(parser_name, globals(), locals(), level=1) - return module.Parser -diff --git a/docutils/docutils/parsers/rst/directives/__init__.py b/docutils/docutils/parsers/rst/directives/__init__.py -index b00a676..fdc70d7 100644 ---- a/docutils/docutils/parsers/rst/directives/__init__.py -+++ b/docutils/docutils/parsers/rst/directives/__init__.py -@@ -10,8 +10,12 @@ __docformat__ = 'reStructuredText' - - import re - import codecs -+import sys -+ - from docutils import nodes - from docutils.parsers.rst.languages import en as _fallback_language_module -+if sys.version_info < (2,5): -+ from docutils._compat import __import__ - - - _directive_registry = { -@@ -109,7 +113,7 @@ def directive(directive_name, language_module, document): - # Error handling done by caller. - return None, messages - try: -- module = __import__(modulename, globals(), locals()) -+ module = __import__(modulename, globals(), locals(), level=1) - except ImportError, detail: - messages.append(document.reporter.error( - 'Error importing directive module "%s" (directive "%s"):\n%s' -diff --git a/docutils/docutils/parsers/rst/languages/__init__.py b/docutils/docutils/parsers/rst/languages/__init__.py -index 53017d7..5a151e4 100644 ---- a/docutils/docutils/parsers/rst/languages/__init__.py -+++ b/docutils/docutils/parsers/rst/languages/__init__.py -@@ -12,7 +12,11 @@ reStructuredText. - - __docformat__ = 'reStructuredText' - -+import sys -+ - from docutils.utils import normalize_language_tag -+if sys.version_info < (2,5): -+ from docutils._compat import __import__ - - _languages = {} - -@@ -21,7 +25,7 @@ def get_language(language_code): - if tag in _languages: - return _languages[tag] - try: -- module = __import__(tag, globals(), locals()) -+ module = __import__(tag, globals(), locals(), level=1) - except ImportError: - continue - _languages[tag] = module -diff --git a/docutils/docutils/readers/__init__.py b/docutils/docutils/readers/__init__.py -index a28248f..e3e6fb5 100644 ---- a/docutils/docutils/readers/__init__.py -+++ b/docutils/docutils/readers/__init__.py -@@ -8,9 +8,12 @@ This package contains Docutils Reader modules. - - __docformat__ = 'reStructuredText' - -+import sys - - from docutils import utils, parsers, Component - from docutils.transforms import universal -+if sys.version_info < (2,5): -+ from docutils._compat import __import__ - - - class Reader(Component): -@@ -103,5 +106,5 @@ def get_reader_class(reader_name): - reader_name = reader_name.lower() - if reader_name in _reader_aliases: - reader_name = _reader_aliases[reader_name] -- module = __import__(reader_name, globals(), locals()) -+ module = __import__(reader_name, globals(), locals(), level=1) - return module.Reader -diff --git a/docutils/docutils/writers/__init__.py b/docutils/docutils/writers/__init__.py -index e30dbf6..8fcee0c 100644 ---- a/docutils/docutils/writers/__init__.py -+++ b/docutils/docutils/writers/__init__.py -@@ -8,11 +8,14 @@ This package contains Docutils Writer modules. - - __docformat__ = 'reStructuredText' - -- - import os.path -+import sys -+ - import docutils - from docutils import languages, Component - from docutils.transforms import universal -+if sys.version_info < (2,5): -+ from docutils._compat import __import__ - - - class Writer(Component): -@@ -130,5 +133,5 @@ def get_writer_class(writer_name): - writer_name = writer_name.lower() - if writer_name in _writer_aliases: - writer_name = _writer_aliases[writer_name] -- module = __import__(writer_name, globals(), locals()) -+ module = __import__(writer_name, globals(), locals(), level=1) - return module.Writer --- -1.6.5.GIT - diff --git a/abs/core/python_modules/python-docutils/PKGBUILD b/abs/core/python_modules/python-docutils/PKGBUILD deleted file mode 100644 index c0b5341..0000000 --- a/abs/core/python_modules/python-docutils/PKGBUILD +++ /dev/null @@ -1,80 +0,0 @@ -# $Id$ -# Maintainer: Sébastien Luttringer -# Contributor : Ionut Biru -# Contributor: Sergej Pupykin - -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: diff --git a/abs/core/python_modules/python-docutils/__changelog b/abs/core/python_modules/python-docutils/__changelog deleted file mode 100644 index 3439597..0000000 --- a/abs/core/python_modules/python-docutils/__changelog +++ /dev/null @@ -1 +0,0 @@ -PKGBUILD: rm python 3 stuff diff --git a/abs/core/python_modules/python-docutils/python2-docutils.install b/abs/core/python_modules/python-docutils/python2-docutils.install deleted file mode 100644 index 3e414af..0000000 --- a/abs/core/python_modules/python-docutils/python2-docutils.install +++ /dev/null @@ -1,9 +0,0 @@ -post_upgrade() { - [ $(vercmp '0.8.1-2' "$2") -gt 0 ] && cat <