--- liblouis-2.4.1.orig/debian/watch +++ liblouis-2.4.1/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://www.abilitiessoft.com/downloads.html liblouis-(.*)\.tar\.gz --- liblouis-2.4.1.orig/debian/liblouis2.install +++ liblouis-2.4.1/debian/liblouis2.install @@ -0,0 +1 @@ +usr/lib/*/lib*.so.* --- liblouis-2.4.1.orig/debian/gbp.conf +++ liblouis-2.4.1/debian/gbp.conf @@ -0,0 +1,6 @@ +[git-import-orig] +upstream-branch = upstream-import +debian-branch = upstream + +[DEFAULT] +debian-branch = ubuntu-quantal --- liblouis-2.4.1.orig/debian/liblouis-dev.doc-base +++ liblouis-2.4.1/debian/liblouis-dev.doc-base @@ -0,0 +1,15 @@ +Document: liblouis +Title: Programmer API for the liblouis Braille translation library +Author: John J. Boyer +Abstract: This manual describes the liblouis translator library: + - for the end user + - for braille tables writers + - for developers using the API of the library +Section: Programming/C + +Format: HTML +Index: /usr/share/doc/liblouis-dev/liblouis.html +Files: /usr/share/doc/liblouis-dev/liblouis.html + +Format: text +Files: /usr/share/doc/liblouis-dev/liblouis.txt.gz --- liblouis-2.4.1.orig/debian/copyright +++ liblouis-2.4.1/debian/copyright @@ -0,0 +1,88 @@ +This package was debianized by Samuel Thibault on +Fri, 30 Jan 2009 22:41:58 +0100. + +It was downloaded from http://code.google.com/p/liblouis/ + +Upstream Author: + + John J. Boyer + + Dave Mielke and other BRLTTY team members + + Leon Ungier of ViewPlus Technologies + + John Gardner of ViewPlus Technologies + + Yuemei Sun of ViewPlus Technologies + + Eitan Isaacson + + Alastair Irving + + Christian Egli + + James Teh + + Michel Such + +Copyright: + + Copyright (C) 1999-2008 by the BRLTTY Team + Copyright (C) 2004-2009 ViewPlus Technologies, Inc. `www.viewplus.com'. + Copyright (C) 2004 Computers to Help People, Inc., www.chpi.org + Copyright (C) 2007,2008 JJB Software, Inc. `www.jjb-software.com'. + Copyright (C) 2010 Leon Ungier + Copyright (C) 2010 Mohammed R. Ramadan + Copyright (C) 2010, 2012 Samuel Thibault + Copyright (c) 2010 by DocArch + Copyright (C) 2009-2010 INIB (Iceland National Institute for the Blind) + Copyright (C) 2010 by Swiss Library for the Blind, Visually Impaired and Print Disabled + Copyright (C) 2011 by Mesar Hameed + Copyright (C) 2011 by Abdolamir Banisaeid + Copyright (C) 2011 by Bert Frees + Copyright (C) 2011 by Jan Halousek + + When not otherwise specified, files are under the LGPL version 3 or later: + +License: + + This package is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian systems, the complete text of the GNU Lesser General +Public License can be found in `/usr/share/common-licenses/LGPL'. + + The tools below the tools/ directory are under the GPL version 2 or later: + +License: + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + +The Debian packaging is © 2009, Samuel Thibault and +is licensed under the GPL, see `/usr/share/common-licenses/GPL'. --- liblouis-2.4.1.orig/debian/examples +++ liblouis-2.4.1/debian/examples @@ -0,0 +1,2 @@ +tools/lou_translate.c +tools/lou_allround.c --- liblouis-2.4.1.orig/debian/info +++ liblouis-2.4.1/debian/info @@ -0,0 +1 @@ +doc/liblouis.info --- liblouis-2.4.1.orig/debian/liblouis-bin.manpages +++ liblouis-2.4.1/debian/liblouis-bin.manpages @@ -0,0 +1 @@ +debian/tmp/usr/share/man/man1/*.1 --- liblouis-2.4.1.orig/debian/liblouis-data.install +++ liblouis-2.4.1/debian/liblouis-data.install @@ -0,0 +1 @@ +usr/share/liblouis/tables --- liblouis-2.4.1.orig/debian/python3-louis.examples +++ liblouis-2.4.1/debian/python3-louis.examples @@ -0,0 +1,2 @@ +python/examples/dtbook2brldtbook.xsl +python/examples/liblouisxslt.py --- liblouis-2.4.1.orig/debian/compat +++ liblouis-2.4.1/debian/compat @@ -0,0 +1 @@ +7 --- liblouis-2.4.1.orig/debian/liblouis-dev.install +++ liblouis-2.4.1/debian/liblouis-dev.install @@ -0,0 +1,4 @@ +usr/include/* +usr/lib/*/lib*.a +usr/lib/*/lib*.so +usr/lib/*/pkgconfig/* --- liblouis-2.4.1.orig/debian/changelog +++ liblouis-2.4.1/debian/changelog @@ -0,0 +1,195 @@ +liblouis (2.4.1-1ubuntu1) quantal-proposed; urgency=low + + * Ship python 3 bindings: + - Grab latest python bindings code from liblouis SVN which supports python + 3. + - Update packaging metadata for python 3 packaging. + - Use dh_autoreconf to rebuild autotools files. + * Tweak gbp.conf for Ubuntu quantal. + + -- Luke Yelavich Thu, 02 Aug 2012 09:04:49 +1000 + +liblouis (2.4.1-1) unstable; urgency=low + + * New upstream release. + * control: Bump Standards-Version to 3.9.3 (no changes). + + -- Samuel Thibault Sun, 26 Feb 2012 21:03:21 +0100 + +liblouis (2.4.0-1) unstable; urgency=low + + * New upstream release + - copyright: Update. + * rules: Add build-indep and build-arch targets. + * control: Depend on hardening-check. + * rules: Set DEB_BUILD_HARDENING=1 to enable hardening. + + -- Samuel Thibault Sat, 04 Feb 2012 23:51:57 +0100 + +liblouis (2.3.0-3) unstable; urgency=low + + [ Samuel Thibault ] + * debian/liblouis-dev.install: Move pkg-config file to multiarch place. + + [ Barry Warsaw ] + * Switch to dh_python2 (Closes: Bug#635442) (LP: #788514) + + -- Samuel Thibault Thu, 11 Aug 2011 03:51:30 +0200 + +liblouis (2.3.0-2) unstable; urgency=low + + * debian/rules: Set libdir to DEB_HOST_MULTIARCH. + * debian/control: Make liblouis2 pre-depend on multiarch-support. + + -- Samuel Thibault Sun, 05 Jun 2011 12:34:49 +0200 + +liblouis (2.3.0-1) unstable; urgency=low + + * New upstream release. + * Cherry-pick r448 and r449 from upstream, to fix make check timeouts and + hung processes + * debian/control: + - Set liblouis-data Multi-Arch: foreign. + - Build-depend on dpkg-dev (>= 1.16) + * Bump Standards-Version to 3.9.2 + + -- Samuel Thibault Mon, 09 May 2011 23:40:10 +0200 + +liblouis (2.2.0-1) unstable; urgency=low + + * New upstream release (Closes: Bug#614568). + * debian/copyright: Update. + + -- Samuel Thibault Sun, 30 Jan 2011 17:38:29 +0100 + +liblouis (2.0.0-2) unstable; urgency=low + + * debian/watch: Replace googlecode URL with abilitiessoft.com URL. + * debian/gbp.conf: Add git-buildpackage configuration file. + + -- Samuel Thibault Fri, 20 Aug 2010 20:04:37 +0200 + +liblouis (2.0.0-1) unstable; urgency=low + + * New upstream release. + * debian/control: Bump Standards-Version to 3.9.1 (no change needed). + * debian/rules: Do not stop build on make check error. + + -- Samuel Thibault Tue, 27 Jul 2010 02:42:36 +0200 + +liblouis (1.8.0-1) unstable; urgency=low + + * New upstream release (Closes: Bug#563673). + * debian/control: + - Drop duplicate Section: libs field. + - Add help2man Build-Depends. + - Rename liblouis0 package to liblouis2 due to soname change. + * debian/rules: + - Automatically copy config.{sub,guess} from autotools-dev + (Closes: Bug#563485). + - Remove python/build on clean. + * debian/lou_*.1: Remove manpages, upstream now have some. + * debian/copyright: Fix copyright sign. + * debian/liblouis-dev.doc-base: Add. + + -- Samuel Thibault Tue, 12 Jan 2010 23:48:47 +0100 + +liblouis (1.7.0-2) unstable; urgency=low + + * debian/control: Remove python2.4-ctypes build-depends (Closes: + Bug#562480), bump python-all-dev dependency version to >= 2.5. + + -- Samuel Thibault Sun, 27 Dec 2009 02:57:36 +0100 + +liblouis (1.7.0-1) unstable; urgency=low + + New upstream release. + + [ Loïc Minier ] + * Don't override LD_LIBRARY_PATH completely as this breaks fakeroot. + * Add ${misc:Depends}. + * Run testsuite during build by default. + * Stop installing *.la files in liblouis-dev; the only package + build-depending on liblouis-dev (recursively) is liblouisxml-dev + so that's fine. + * Cleanup rules. + * Add ${shlibs:Depends} to liblouis-dev and python-louis. + * Fix copyright to mention licensing of tools (GPLv2 or later). + + [ Cyril Brulebois ] + * Merge Loïc's patches (and tweak some of them), thanks! + + [ Samuel Thibault ] + * rules: Install libraries to /usr/lib/$(DEB_HOST_GNU_TYPE), but not the + pkgconfig file. + * control: Add Multi-Arch: foreign to liblouis-bin, same to liblouis0. + * Fix LD_LIBRARY_PATH change + * Disable the present_progressive test, as it is known upstream that it + fails. + * debian/control: Bump Standards-Version to 3.8.3 (no change needed). + * debian/lou_checkhyphens.1: New manpage. + + -- Samuel Thibault Sat, 22 Aug 2009 15:52:10 +0200 + +liblouis (1.6.2.0-2) unstable; urgency=low + + * Add texinfo to Build-Depends, fixing FTBFS with missing makeinfo + command, before it gets reported. :) + * Add myself to Uploaders. + + -- Cyril Brulebois Wed, 29 Jul 2009 06:25:24 +0200 + +liblouis (1.6.2.0-1) unstable; urgency=low + + * New upstream release. + * examples: use lou_translate.c and lou_allround.c as examples + (Closes: #535454). + * Include some python examples in pydoc louis. + + -- Samuel Thibault Wed, 29 Jul 2009 01:40:24 +0200 + +liblouis (1.6.1-3) unstable; urgency=low + + [ Samuel Thibault ] + * control: make python-louis's dependency on liblouis0 versioned in case new + functions are added. + + [ Cyril Brulebois ] + * Get rid of XB-Python-Version, useless with python-support. + * Get rid of debian/*.dirs, dh_install does the right thing. + * Fix watch file: trying to match just the basename of the tarball + fails, it looks like it's needed to consider any possible path in + front of it. + + -- Samuel Thibault Sun, 28 Jun 2009 01:28:52 +0200 + +liblouis (1.6.1-2) unstable; urgency=low + + * Load the precise library file from the python bindings (Closes: #530608). + Thanks Cyril Brulebois for the patch! + * Since the python package is called louis and not liblouis, rename package + python-liblouis into python-louis to meet the Debian Python Policy and fix + ${python:Depends} generation (no reverse dependency exist). Make it + Architecture: any instead of all as different systems may have different + liblouis library file names. + * control: Change my email, remove DM-Upload-Allowed, add Vcs-Git and + Vcs-Browser. + * pycompat: Remove, useless with python-support. + * Bump Standards-Version to 3.8.2 (no change needed). + + -- Samuel Thibault Sat, 27 Jun 2009 21:48:19 +0200 + +liblouis (1.6.1-1) unstable; urgency=low + + * New upstream bugfix release. + * Bump Standards-Version to 3.8.1, no changes needed. + * Set CFLAGS to -O2 unless noopt is given in DEB_BUILD_OPTIONS. + * Build liblouis-data in binary-indep instead of binary-arch. + + -- Samuel Thibault Tue, 21 Apr 2009 00:00:00 +0200 + +liblouis (1.6.0-1) unstable; urgency=low + + * Initial release (Closes: #513632). + + -- Samuel Thibault Sat, 07 Mar 2009 23:03:22 +0100 --- liblouis-2.4.1.orig/debian/liblouis-bin.install +++ liblouis-2.4.1/debian/liblouis-bin.install @@ -0,0 +1 @@ +usr/bin/* --- liblouis-2.4.1.orig/debian/rules +++ liblouis-2.4.1/debian/rules @@ -0,0 +1,118 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) +CROSS := --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) +else +CROSS := --build $(DEB_BUILD_GNU_TYPE) +endif + +ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) +CFLAGS += -O0 +else +CFLAGS += -O2 +endif + +export DEB_BUILD_HARDENING=1 + +maybe_check = $(if $(findstring nocheck,$(DEB_BUILD_OPTIONS)),,check) + +PYVERS := $(shell py3versions -r) + +config.status: configure + dh_testdir + dh_quilt_patch + dh_autoreconf + ./configure $(CROSS) --prefix=/usr --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs" --enable-ucs4 + + +build: build-indep build-arch +build-indep: build-stamp +build-arch: build-stamp +build-stamp: config.status + dh_testdir + $(MAKE) + cd python; \ + for py in $(PYVERS); do \ + LD_LIBRARY_PATH=../liblouis/.libs$${LD_LIBRARY_PATH+:$$LD_LIBRARY_PATH} $$py setup.py build; \ + done + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp check-stamp + [ ! -f Makefile ] || $(MAKE) distclean + -cd python; \ + for py in $(PYVERS); do \ + LD_LIBRARY_PATH=../liblouis/.libs$${LD_LIBRARY_PATH+:$$LD_LIBRARY_PATH} $$py setup.py clean --all; \ + done; \ + rm -f louis/__init__.pyc + rm -f doc/liblouis.info doc/stamp-vti doc/version.texi + rm -f build-aux/config.sub + rm -f build-aux/config.guess + rm -fr python/build + dh_autoreconf_clean + dh_quilt_unpatch + dh_clean + +install: build + dh_testdir + dh_testroot + dh_prep + dh_installdirs + $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install + cd python; \ + for py in $(PYVERS); do \ + LD_LIBRARY_PATH=../liblouis/.libs$${LD_LIBRARY_PATH+:$$LD_LIBRARY_PATH} $$py setup.py install --root=$(CURDIR)/debian/python3-louis; \ + done + +check: check-stamp +check-stamp: + -$(MAKE) check + touch $@ + +binary-arch: export DH_OPTIONS=-s +binary-arch: build install $(maybe_check) + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs + dh_installexamples + dh_install + dh_installman + dh_installinfo + dh_python3 + dh_link + dh_strip + dh_compress + dh_fixperms + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary-indep: export DH_OPTIONS=-i +binary-indep: build install $(maybe_check) + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs + dh_install + dh_compress + dh_fixperms + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +get-orig-source: + uscan --verbose --rename --repack --force-download + +binary: binary-indep binary-arch +.PHONY: build build-indep build-arch clean binary-indep binary-arch binary install --- liblouis-2.4.1.orig/debian/control +++ liblouis-2.4.1/debian/control @@ -0,0 +1,80 @@ +Source: liblouis +Priority: extra +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Debian Accessibility Team +Uploaders: Samuel Thibault , Cyril Brulebois +Build-Depends: debhelper (>= 7), autotools-dev, pkg-config, python3-dev, texinfo, help2man, dpkg-dev (>= 1.16), hardening-wrapper, quilt, dh-autoreconf +Standards-Version: 3.9.3 +Section: libs +Vcs-Git: git://git.debian.org/git/pkg-a11y/liblouis +Vcs-Browser: http://git.debian.org/?p=pkg-a11y/liblouis.git +Homepage: http://code.google.com/p/liblouis/ +X-Python3-Version: >= 3.2 + +Package: liblouis-dev +Section: libdevel +Architecture: any +Depends: liblouis2 (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends} +Description: Braille translation library - static libs and headers + Liblouis is a braille translator and back-translator. It features support for + computer and literary braille, supports contracted and uncontracted translation + for many languages and has support for hyphenation. Liblouis also supports + math braille (Nemeth and Marburg). + . + This package contains static libraries and development headers. + +Package: liblouis2 +Architecture: any +Multi-Arch: same +Pre-Depends: multiarch-support +Depends: ${shlibs:Depends}, liblouis-data, ${misc:Depends} +Description: Braille translation library - shared libs + Liblouis is a braille translator and back-translator. It features support for + computer and literary braille, supports contracted and uncontracted translation + for many languages and has support for hyphenation. Liblouis also supports + math braille (Nemeth and Marburg). + . + This package contains shared libraries. + +Package: liblouis-data +Section: text +Architecture: all +Multi-Arch: foreign +Depends: ${misc:Depends} +Description: Braille translation library - data + Liblouis is a braille translator and back-translator. It features support for + computer and literary braille, supports contracted and uncontracted translation + for many languages and has support for hyphenation. Liblouis also supports + math braille (Nemeth and Marburg). New languages can easily be added through + tables that support a rule- or dictionary based approach. Included are also + tools for testing and debugging tables. + . + This package contains runtime data. + +Package: liblouis-bin +Section: text +Architecture: any +Multi-Arch: foreign +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Braille translation library - utilities + Liblouis is a braille translator and back-translator. It features support for + computer and literary braille, supports contracted and uncontracted translation + for many languages and has support for hyphenation. Liblouis also supports + math braille (Nemeth and Marburg). New languages can easily be added through + tables that support a rule- or dictionary based approach. Included are also + tools for testing and debugging tables. + . + This package contains a few tools to test tables and translate text. + +Package: python3-louis +Section: python +Architecture: any +Depends: ${python3:Depends}, liblouis2 (>= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends} +Provides: ${python3:Provides} +Description: Python bindings for liblouis + Liblouis is a braille translator and back-translator. It features support for + computer and literary braille, supports contracted and uncontracted translation + for many languages and has support for hyphenation. Liblouis also supports + math braille (Nemeth and Marburg). + . + This package contains Python bindings. --- liblouis-2.4.1.orig/debian/docs +++ liblouis-2.4.1/debian/docs @@ -0,0 +1,4 @@ +NEWS +README +doc/liblouis.html +doc/liblouis.txt --- liblouis-2.4.1.orig/debian/patches/python3.patch +++ liblouis-2.4.1/debian/patches/python3.patch @@ -0,0 +1,345 @@ +Index: liblouis/python/examples/dtbook2brldtbook.xsl +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ liblouis/python/examples/dtbook2brldtbook.xsl 2012-08-01 16:07:40.259380734 +1000 +@@ -0,0 +1,42 @@ ++ ++ ++ ++ ++ ++ ++ de-ch-g2.ctb ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +Index: liblouis/python/examples/liblouisxslt.py +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ liblouis/python/examples/liblouisxslt.py 2012-08-01 16:07:40.259380734 +1000 +@@ -0,0 +1,61 @@ ++#! /usr/bin/python -u ++# ++# This is a very simple example on how to extend libxslt to be able to ++# invoke liblouis from xslt. See also the accompanying ++# dtbook2brldtbook.xsl in the same directory which simpy copies a dtbook ++# xml and translates all the text node into Braille. ++ ++import louis ++import libxml2 ++import libxslt ++import sys ++import getopt ++from optparse import OptionParser ++ ++nodeName = None ++ ++emphasisMap = { ++ 'plain_text' : louis.plain_text, ++ 'italic' : louis.italic, ++ 'underline' : louis.underline, ++ 'bold' : louis.bold, ++ 'computer_braille' : louis.computer_braille} ++ ++def translate(ctx, str, translation_table, emphasis=None): ++ global nodeName ++ ++ try: ++ pctxt = libxslt.xpathParserContext(_obj=ctx) ++ ctxt = pctxt.context() ++ tctxt = ctxt.transformContext() ++ nodeName = tctxt.insertNode().name ++ except: ++ pass ++ ++ typeform = len(str)*[emphasisMap[emphasis]] if emphasis else None ++ braille = louis.translate([translation_table], str.decode('utf-8'), typeform=typeform)[0] ++ return braille.encode('utf-8') ++ ++def xsltProcess(styleFile, inputFile, outputFile): ++ """Transform an xml inputFile to an outputFile using the given styleFile""" ++ styledoc = libxml2.parseFile(styleFile) ++ style = libxslt.parseStylesheetDoc(styledoc) ++ doc = libxml2.parseFile(inputFile) ++ result = style.applyStylesheet(doc, None) ++ style.saveResultToFilename(outputFile, result, 0) ++ style.freeStylesheet() ++ doc.freeDoc() ++ result.freeDoc() ++ ++libxslt.registerExtModuleFunction("translate", "http://liblouis.org/liblouis", translate) ++ ++def main(): ++ usage = "Usage: %prog [options] styleFile inputFile outputFile" ++ parser = OptionParser(usage) ++ (options, args) = parser.parse_args() ++ if len(args) != 3: ++ parser.error("incorrect number of arguments") ++ xsltProcess(args[0], args[1], args[2]) ++ ++if __name__ == "__main__": ++ main() +Index: liblouis/python/louis/Makefile.am +=================================================================== +--- liblouis.orig/python/louis/Makefile.am 2012-08-01 16:04:46.807375299 +1000 ++++ liblouis/python/louis/Makefile.am 2012-08-01 16:07:40.259380734 +1000 +@@ -1,5 +1,5 @@ + EXTRA_DIST = __init__.py.in +-CLEANFILES = __init__.py ++CLEANFILES = __init__.py __init__.pyc + + all: + source ../../liblouis/liblouis.la ; \ +Index: liblouis/python/louis/__init__.py.in +=================================================================== +--- liblouis.orig/python/louis/__init__.py.in 2012-08-01 16:04:46.807375299 +1000 ++++ liblouis/python/louis/__init__.py.in 2012-08-01 16:07:40.259380734 +1000 +@@ -29,28 +29,23 @@ + @author: James Teh + @author: Eitan Isaacson + @author: Michael Whapples +- +->>> import louis +- +-Show a US grade2 translation of a unicode string with no typeform +-information: +->>> louis.translateString(['en-us-g2.ctb'], u'Hello world', None, 0) +-u',hello _w' +- +-Now do a translation using bold for the string: +->>> louis.translateString(['en-us-g2.ctb'], u'Hello world', +-[louis.bold]*11, 0) +-u',hello __w' +- +-Now do a translation using cursor position: +->>> louis.translate(['en-us-g2.ctb'], u'Hello world', None, 5, 0) +-(u',hello _w', [0, 0, 1, 2, 3, 4, 5, 6, 6], [1, 2, 3, 4, 5, 6, 7, 7, 7, +-7, 7], 6) + """ + + from ctypes import * + import struct + import atexit ++import sys ++ ++# Some general utility functions ++def _createTablesString(tablesList): ++ """Creates a tables string for liblouis calls""" ++ return b",".join([x.encode("ASCII") if isinstance(x, str) else bytes(x) for x in tablesList]) ++ ++createStr = None ++if sys.version_info[0] == 2: ++ createStr = lambda x: unicode(x) ++else: ++ createStr = lambda x: str(x) + + #{ Module Configuration + #: Specifies the number by which the input length should be multiplied +@@ -102,14 +97,14 @@ + the release date and perhaps notable changes. + @rtype: str + """ +- return liblouis.lou_version() ++ return liblouis.lou_version().decode("ASCII") + + def translate(tableList, inbuf, typeform=None,cursorPos=0, mode=0): + """Translate a string of characters, providing position information. + @param tableList: A list of translation tables. + @type tableList: list of str + @param inbuf: The string to translate. +- @type inbuf: unicode ++ @type inbuf: str + @param typeform: A list of typeform constants indicating the typeform for each position in inbuf, + C{None} for no typeform information. + @type typeform: list of int +@@ -121,12 +116,12 @@ + a list of input positions for each position in the output, + a list of output positions for each position in the input, and + the position of the cursor in the output. +- @rtype: (unicode, list of int, list of int, int) ++ @rtype: (str, list of int, list of int, int) + @raise RuntimeError: If a complete translation could not be done. + @see: lou_translate in the liblouis documentation + """ +- tablesString = ",".join([str(x) for x in tableList]) +- inbuf = unicode(inbuf) ++ tablesString = _createTablesString(tableList) ++ inbuf = createStr(inbuf) + inlen = c_int(len(inbuf)) + outlen = c_int(inlen.value*outlenMultiplier) + outbuf = create_unicode_buffer(outlen.value) +@@ -149,19 +144,19 @@ + @param tableList: A list of translation tables. + @type tableList: list of str + @param inbuf: The string to translate. +- @type inbuf: unicode ++ @type inbuf: str + @param typeform: A list of typeform constants indicating the typeform for each position in inbuf, + C{None} for no typeform information. + @type typeform: list of int + @param mode: The translation mode; add multiple values for a combined mode. + @type mode: int + @return: The translated string. +- @rtype: unicode ++ @rtype: str + @raise RuntimeError: If a complete translation could not be done. + @see: lou_translateString in the liblouis documentation + """ +- tablesString = ",".join([str(x) for x in tableList]) +- inbuf = unicode(inbuf) ++ tablesString = _createTablesString(tableList) ++ inbuf = createStr(inbuf) + inlen = c_int(len(inbuf)) + outlen = c_int(inlen.value*outlenMultiplier) + outbuf = create_unicode_buffer(outlen.value) +@@ -181,7 +176,7 @@ + @param tableList: A list of translation tables. + @type tableList: list of str + @param inbuf: Braille to back translate. +- @type inbuf: unicode ++ @type inbuf: str + @param typeform: List where typeform constants will be placed. + @type typeform: list + @param cursorPos: Position of cursor. +@@ -192,12 +187,12 @@ + a list of input positions for each position in the output, + a list of the output positions for each position in the input and + the position of the cursor in the output. +- @rtype: (unicode, list of int, list of int, int) ++ @rtype: (str, list of int, list of int, int) + @raises RuntimeError: If back translation could not be completed. + @see: lou_backTranslate in the liblouis documentation. + """ +- tablestring = ','.join([str(x) for x in tableList]) +- inbuf = unicode(inbuf) ++ tablestring = _createTablesString(tableList) ++ inbuf = createStr(inbuf) + inlen = c_int(len(inbuf)) + outlen = c_int(inlen.value * outlenMultiplier) + outbuf = create_unicode_buffer(outlen.value) +@@ -220,19 +215,19 @@ + @param tableList: A list of translation tables. + @type tableList: list of str + @param inbuf: The Braille to back translate. +- @type inbuf: unicode ++ @type inbuf: str + @param typeform: List for typeform constants to be put in. + If you don't want typeform data then give None + @type typeform: list + @param mode: The translation mode + @type mode: int + @return: The back translation of inbuf. +- @rtype: unicode ++ @rtype: str + @raises RuntimeError: If a full back translation could not be done. + @see: lou_backTranslateString in the liblouis documentation. + """ +- tablestring = ','.join([str(x) for x in tableList]) +- inbuf = unicode(inbuf) ++ tablestring = _createTablesString(tableList) ++ inbuf = createStr(inbuf) + inlen = c_int(len(inbuf)) + outlen = c_int(inlen.value * outlenMultiplier) + outbuf = create_unicode_buffer(outlen.value) +@@ -254,7 +249,7 @@ + @param inbuf: The text to get hyphenation information about. + This should be a single word and leading/trailing whitespace + and punctuation is ignored. +- @type inbuf: unicode ++ @type inbuf: str + @param mode: Lets liblouis know if inbuf is plain text or Braille. + Set to 0 for text and anyother value for Braille. + @type mode: int +@@ -264,13 +259,13 @@ + @raises RuntimeError: If hyphenation data could not be produced. + @see: lou_hyphenate in the liblouis documentation. + """ +- tablestring = ','.join([str(x) for x in tableList]) +- inbuf = unicode(inbuf) ++ tablesString = _createTablesString(tableList) ++ inbuf = createStr(inbuf) + inlen = c_int(len(inbuf)) +- hyphen_string = create_string_buffer(inlen.value) +- if not liblouis.lou_hyphenate(tablestring, inbuf, inlen, hyphen_string, mode): +- raise RuntimeError("Can't hyphenate tables %s, inbuf %s, mode %d" %(tablestring, inbuf, mode)) +- return hyphen_string.value ++ hyphen_string = create_string_buffer(inlen.value + 1) ++ if not liblouis.lou_hyphenate(tablesString, inbuf, inlen, hyphen_string, mode): ++ raise RuntimeError("Can't hyphenate tables %s, inbuf %s, mode %d" %(tablesString, inbuf, mode)) ++ return hyphen_string.value.decode("ASCII") + + def compileString(tableList, inString): + """Compile a table entry on the fly at run-time. +@@ -281,7 +276,8 @@ + @raise RuntimeError: If compilation of the entry failed. + @see: lou_compileString in the liblouis documentation + """ +- tablesString = ",".join([str(x) for x in tableList]) ++ tablesString = _createTablesString(tableList) ++ inBytes = inString.encode("ASCII") if isinstance(inString, str) else bytes(inString) + if not liblouis.lou_compileString(tablesString, inString): + raise RuntimeError("Can't compile entry: tables %s, inString %s" % (tableList, inString)) + +@@ -299,9 +295,13 @@ + comp8Dots = 8 + pass1Only = 16 + compbrlLeftCursor = 32 ++otherTrans = 64 ++ucBrl = 128 + #} + + if __name__ == '__main__': + # Just some common tests. +- print version() +- print translate(['../tables/en-us-g2.ctb'], u'Hello world!', cursorPos=5) ++ print(version()) ++ print(translate([b'../tables/en-us-g2.ctb'], 'Hello world!', cursorPos=5)) ++ ++ +Index: liblouis/configure.ac +=================================================================== +--- liblouis.orig/configure.ac 2012-06-27 14:52:30.169880108 +1000 ++++ liblouis/configure.ac 2012-08-01 16:07:53.003381135 +1000 +@@ -79,6 +79,10 @@ + fi + AM_CONDITIONAL([HAVE_HELP2MAN], [test x$HELP2MAN = xhelp2man]) + ++# Check if we have Python installed ++AM_PATH_PYTHON([2.6],, [:]) ++AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :]) ++ + AC_PATH_PROG(PKG_CONFIG, pkg-config) + + AC_ARG_ENABLE(ucs4, --- liblouis-2.4.1.orig/debian/patches/series +++ liblouis-2.4.1/debian/patches/series @@ -0,0 +1 @@ +python3.patch --- liblouis-2.4.1.orig/python/louis/__init__.py.in +++ liblouis-2.4.1/python/louis/__init__.py.in @@ -29,6 +29,23 @@ @author: James Teh @author: Eitan Isaacson @author: Michael Whapples + +>>> import louis + +Show a US grade2 translation of a unicode string with no typeform +information: +>>> louis.translateString(['en-us-g2.ctb'], u'Hello world', None, 0) +u',hello _w' + +Now do a translation using bold for the string: +>>> louis.translateString(['en-us-g2.ctb'], u'Hello world', +[louis.bold]*11, 0) +u',hello __w' + +Now do a translation using cursor position: +>>> louis.translate(['en-us-g2.ctb'], u'Hello world', None, 5, 0) +(u',hello _w', [0, 0, 1, 2, 3, 4, 5, 6, 6], [1, 2, 3, 4, 5, 6, 7, 7, 7, +7, 7], 6) """ from ctypes import *