From c8f3765bde570ac0d00ea6573a6025d040ae3050 Mon Sep 17 00:00:00 2001 From: Manuel Date: Wed, 28 Nov 2012 23:28:39 +0000 Subject: [PATCH] Add KSVNUpdater alongside it's depends --- epydoc/PKGBUILD | 44 +++++++++++++++++++++ epydoc/handle-docutils-0.6.patch | 47 +++++++++++++++++++++++ epydoc/python26-tokenizer.patch | 65 ++++++++++++++++++++++++++++++++ epydoc/string-exceptions.patch | 18 +++++++++ ksvnupdater/PKGBUILD | 28 ++++++++++++++ ksvnupdater/ksvnupdater.install | 11 ++++++ pology/PKGBUILD | 44 +++++++++++++++++++++ 7 files changed, 257 insertions(+) create mode 100644 epydoc/PKGBUILD create mode 100644 epydoc/handle-docutils-0.6.patch create mode 100644 epydoc/python26-tokenizer.patch create mode 100644 epydoc/string-exceptions.patch create mode 100644 ksvnupdater/PKGBUILD create mode 100644 ksvnupdater/ksvnupdater.install create mode 100644 pology/PKGBUILD diff --git a/epydoc/PKGBUILD b/epydoc/PKGBUILD new file mode 100644 index 000000000..827dfe4bb --- /dev/null +++ b/epydoc/PKGBUILD @@ -0,0 +1,44 @@ +# Apps packages for Chakra + +pkgname=epydoc +pkgver=3.0.1 +pkgrel=1 +pkgdesc="A tool for generating API documentation for Python modules, based on their docstrings" +arch=('x86_64') +license=('MIT') +url="http://epydoc.sourceforge.net/" +depends=('python2' 'docutils') +optdepends=('tk: needed for epydocgui' 'texlive-bin: needed for PDF conversion' 'graphviz: needed for graph generation') +source=("http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz" + "handle-docutils-0.6.patch" + "python26-tokenizer.patch" + "string-exceptions.patch") +md5sums=('cdd6f6c76dd8bab5e653a343a0544294' + 'cff5c98976a9768e0ce53561dc816bf0' + 'f0fec671b1c9a01c4452ae9c00926787' + 'c942d7bf218d62d5913bd186762093c1') + +build() { + cd "$srcdir/$pkgname-$pkgver" + + # python2 fixes + sed -i "s|env python|&2|" `grep -Erl "env python" .` + + # patches + patch -p1 -i ../${source[1]} + patch -p1 -i ../${source[2]} + patch -p1 -i ../${source[3]} + + python2 setup.py build +} + +package() { + cd "$srcdir/$pkgname-$pkgver" + + python2 setup.py install --root="$pkgdir" --prefix=/usr --optimize=1 + + # Man and license + install -d "$pkgdir/usr/share/man/man1" + install -m644 man/*.1 "$pkgdir/usr/share/man/man1" + install -Dm644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" +} diff --git a/epydoc/handle-docutils-0.6.patch b/epydoc/handle-docutils-0.6.patch new file mode 100644 index 000000000..53f941c98 --- /dev/null +++ b/epydoc/handle-docutils-0.6.patch @@ -0,0 +1,47 @@ +# Description: Handle problems encountered with docutils 0.6. +# The problem here is that the child.data element does not always exist any +# more. Apparently, the child element is sometimes a string instead. So, we +# work around it by only executing the code in question if child.data can be +# referenced. Thanks to Thomas Hille for research and the initial patch. +# Bug-Debian: http://bugs.debian.org/561793 +# Author: Kenneth J. Pronovici +--- a/epydoc/markup/restructuredtext.py ++++ b/epydoc/markup/restructuredtext.py +@@ -304,13 +304,14 @@ class _SummaryExtractor(NodeVisitor): + # Extract the first sentence. + for child in node: + if isinstance(child, docutils.nodes.Text): +- m = self._SUMMARY_RE.match(child.data) +- if m: +- summary_pieces.append(docutils.nodes.Text(m.group(1))) +- other = child.data[m.end():] +- if other and not other.isspace(): +- self.other_docs = True +- break ++ if hasattr(child, 'data'): ++ m = self._SUMMARY_RE.match(child.data) ++ if m: ++ summary_pieces.append(docutils.nodes.Text(m.group(1))) ++ other = child.data[m.end():] ++ if other and not other.isspace(): ++ self.other_docs = True ++ break + summary_pieces.append(child) + + summary_doc = self.document.copy() # shallow copy +@@ -489,10 +490,11 @@ class _SplitFieldsTranslator(NodeVisitor + if (len(fbody[0]) > 0 and + isinstance(fbody[0][0], docutils.nodes.Text)): + child = fbody[0][0] +- if child.data[:1] in ':-': +- child.data = child.data[1:].lstrip() +- elif child.data[:2] in (' -', ' :'): +- child.data = child.data[2:].lstrip() ++ if hasattr(child, 'data'): ++ if child.data[:1] in ':-': ++ child.data = child.data[1:].lstrip() ++ elif child.data[:2] in (' -', ' :'): ++ child.data = child.data[2:].lstrip() + + # Wrap the field body, and add a new field + self._add_field(tagname, arg, fbody) diff --git a/epydoc/python26-tokenizer.patch b/epydoc/python26-tokenizer.patch new file mode 100644 index 000000000..c4956adc5 --- /dev/null +++ b/epydoc/python26-tokenizer.patch @@ -0,0 +1,65 @@ +# Description: Fix the tokenizer so comment docstrings work with Python 2.6. +# Bug: https://sourceforge.net/tracker/index.php?func=detail&aid=2585292&group_id=32455&atid=405618 +# Bug-Debian: http://bugs.debian.org/590112 +# Origin: https://sourceforge.net/tracker/?func=detail&aid=2872545&group_id=32455&atid=405620 +# Author: Andre Malo (ndparker) +# Reviewed-by: Kenneth J. Pronovici +--- a/epydoc/docparser.py ++++ b/epydoc/docparser.py +@@ -72,6 +72,26 @@ + from epydoc.compat import * + + ###################################################################### ++## Tokenizer change in 2.6 ++###################################################################### ++ ++def comment_includes_nl(): ++ """ Determine whether comments are parsed as one or two tokens... """ ++ readline = iter(u'\n#\n\n'.splitlines(True)).next ++ tokens = [ ++ token.tok_name[tup[0]] for tup in tokenize.generate_tokens(readline) ++ ] ++ if tokens == ['NL', 'COMMENT', 'NL', 'ENDMARKER']: ++ return True ++ elif tokens == ['NL', 'COMMENT', 'NL', 'NL', 'ENDMARKER']: ++ return False ++ raise AssertionError( ++ "Tokenizer returns unexexpected tokens: %r" % tokens ++ ) ++ ++comment_includes_nl = comment_includes_nl() ++ ++###################################################################### + ## Doc Parser + ###################################################################### + +@@ -520,6 +540,10 @@ + # inside that block, not outside it. + start_group = None + ++ # If the comment tokens do not include the NL, every comment token ++ # sets this to True in order to swallow the next NL token unprocessed. ++ comment_nl_waiting = False ++ + # Check if the source file declares an encoding. + encoding = get_module_encoding(module_doc.filename) + +@@ -570,7 +594,9 @@ + # then discard them: blank lines are not allowed between a + # comment block and the thing it describes. + elif toktype == tokenize.NL: +- if comments and not line_toks: ++ if comment_nl_waiting: ++ comment_nl_waiting = False ++ elif comments and not line_toks: + log.warning('Ignoring docstring comment block followed by ' + 'a blank line in %r on line %r' % + (module_doc.filename, srow-1)) +@@ -578,6 +604,7 @@ + + # Comment token: add to comments if appropriate. + elif toktype == tokenize.COMMENT: ++ comment_nl_waiting = not comment_includes_nl + if toktext.startswith(COMMENT_DOCSTRING_MARKER): + comment_line = toktext[len(COMMENT_DOCSTRING_MARKER):].rstrip() + if comment_line.startswith(" "): diff --git a/epydoc/string-exceptions.patch b/epydoc/string-exceptions.patch new file mode 100644 index 000000000..eca9793f5 --- /dev/null +++ b/epydoc/string-exceptions.patch @@ -0,0 +1,18 @@ +# Description: Get rid of string exceptions. +# One of the changes brought by Python 2.6 is the removal of string +# exceptions. A mass bug filing identified Epydoc as having potential +# problems. I later spot-checked all of the exceptions in the code, and I +# believe this is the only one that we have to worry about. +# Bug-Debian: http://bugs.debian.org/585290 +# Author: Kenneth J. Pronovici +--- a/epydoc/apidoc.py ++++ b/epydoc/apidoc.py +@@ -1352,7 +1352,7 @@ class ClassDoc(NamespaceDoc): + nothead=[s for s in nonemptyseqs if cand in s[1:]] + if nothead: cand=None #reject candidate + else: break +- if not cand: raise "Inconsistent hierarchy" ++ if not cand: raise TypeError("Inconsistent hierarchy") + res.append(cand) + for seq in nonemptyseqs: # remove cand + if seq[0] == cand: del seq[0] diff --git a/ksvnupdater/PKGBUILD b/ksvnupdater/PKGBUILD new file mode 100644 index 000000000..905fe2ab9 --- /dev/null +++ b/ksvnupdater/PKGBUILD @@ -0,0 +1,28 @@ +# Apps packages for Chakra + +pkgname=ksvnupdater +pkgver=1.2.4 +pkgrel=1 +pkgdesc="ksvnupdater is a utility oriented to KDE translation teams." +url="http://www.eloihr.net/ksvnupdater" +license=('GPL') +arch=('x86_64') +depends=('qt' 'kdelibs') +makedepends=('cmake' 'automoc4' 'pology' 'docbook-xsl') +install=${pkgname}.install +source=(http://www.eloihr.net/ksvnupdater/files/ksvnupdater-$pkgver.tar.bz2) +md5sums=('f4230f8bc02ac1b16782f50ed3717e1e') + +build() { + cd ${srcdir} + + mkdir build && cd build + + cmake -DCMAKE_INSTALL_PREFIX=/usr ${srcdir}/${pkgname}-${pkgver} + make +} + +package() { + cd ${srcdir}/build + make DESTDIR=${pkgdir} install +} diff --git a/ksvnupdater/ksvnupdater.install b/ksvnupdater/ksvnupdater.install new file mode 100644 index 000000000..309ea10a5 --- /dev/null +++ b/ksvnupdater/ksvnupdater.install @@ -0,0 +1,11 @@ +post_install() { + xdg-icon-resource forceupdate --theme hicolor &> /dev/null +} + +post_upgrade() { + post_install +} + +post_remove() { + post_install +} diff --git a/pology/PKGBUILD b/pology/PKGBUILD new file mode 100644 index 000000000..b6efdf1e1 --- /dev/null +++ b/pology/PKGBUILD @@ -0,0 +1,44 @@ +# Apps packages for Chakra + +pkgname=pology +pkgver=0.11 +pkgrel=1 +pkgdesc='A framework for custom processing of PO files.' +arch=('x86_64') +license=('GPL3') +url='http://techbase.kde.org/Localization/Tools/Pology' +depends=('python2' 'gettext') +makedepends=('cmake' 'docbook-xsl' 'docbook-xml' 'epydoc') +optdepends=('python2-pyenchant: to spell check' + 'aspell-lang: a dictionary in your language' + 'hunspell-lang: a dictionary in your language' + 'languagetool: used by the check-grammar sieve' + 'dbus-python: for communication with Lokalize' + 'apertium: used by the pomtrans script' + 'git: for processing files under version control' + 'subversion: for processing files under version control') +conflicts=('pology-svn') +source=(http://pology.nedohodnik.net/release/${pkgname}-${pkgver}.tar.bz2) +md5sums=('508855b119beb1bf5cc4ad9e49e7625c') +options=(!makeflags) + +build() { + cd ${srcdir}/${pkgname}-${pkgver} + + sed -i -e 's|^#!/usr/bin/env python$|#!/usr/bin/env python2|' $(find ${srcdir} -name '*.py') + + mkdir -p build && cd build + cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DDOCBOOK_XSL_DIR=/usr/share/xml/docbook/xsl-stylesheets-1.77.1/ + make PREFIX=/usr +} + +package() { + cd ${srcdir}/${pkgname}-${pkgver}/build + make PREFIX=/usr DESTDIR="${pkgdir}" install + + install -d ${pkgdir}/usr/share/apps/katepart/syntax + ln -s /usr/share/pology/syntax/kate/synder.xml ${pkgdir}/usr/share/apps/katepart/syntax/synder.xml + + install -d ${pkgdir}/etc/bash_completion.d + ln -s /usr/share/pology/completion/bash/pology ${pkgdir}/etc/bash_completion.d/pology +}