Renamed bundled pychm to recollchm to ease cohexistence with possible system version

This commit is contained in:
Jean-Francois Dockes 2018-06-12 19:29:37 +02:00
parent fd246d6744
commit 9bb50ccdd5
8 changed files with 12 additions and 16 deletions

View File

@ -36,16 +36,11 @@ try:
# First try the system version if any # First try the system version if any
from chm import chm,chmlib from chm import chm,chmlib
except: except:
for d in ('sys.path[0]', '/usr/lib/recoll', '/usr/local/lib/recoll'): try:
p = os.path.join(d, chmpackname) from recollchm import chm,chmlib
if os.path.exists(p): except:
sys.path.append(p) print("RECFILTERROR HELPERNOTFOUND python:chm")
break sys.exit(1);
try:
from chm import chm,chmlib
except:
print("RECFILTERROR HELPERNOTFOUND python:chm")
sys.exit(1);
# Small helper routines # Small helper routines
def getfile(chmfile, path): def getfile(chmfile, path):

View File

@ -1,6 +1,7 @@
from setuptools import setup, Extension from setuptools import setup, Extension
long_description = ''' long_description = '''
Version of the chm package modified to support Python 3 and bundled with Recoll.
The chm package provides three modules, chm, chmlib and extra, which provide The chm package provides three modules, chm, chmlib and extra, which provide
access to the API implemented by the C library chmlib and some additional access to the API implemented by the C library chmlib and some additional
classes and functions. They are used to access MS-ITSS encoded files - classes and functions. They are used to access MS-ITSS encoded files -
@ -12,7 +13,7 @@ import os
top = os.path.join('@srcdir@', '..', '..') top = os.path.join('@srcdir@', '..', '..')
pytop = '@srcdir@' pytop = '@srcdir@'
setup(name="pychm", setup(name="recollchm",
version="0.8.4.1+git", version="0.8.4.1+git",
description="Python package to handle CHM files", description="Python package to handle CHM files",
author="Rubens Ramos", author="Rubens Ramos",
@ -23,13 +24,13 @@ setup(name="pychm",
license="GPL", license="GPL",
long_description=long_description, long_description=long_description,
package_dir = {'' : os.path.join(top, 'python', 'pychm')}, package_dir = {'' : os.path.join(top, 'python', 'pychm')},
py_modules=["chm.chm", "chm.chmlib"], py_modules=["recollchm.chm", "recollchm.chmlib"],
ext_modules=[Extension("chm._chmlib", ext_modules=[Extension("recollchm._chmlib",
[os.path.join(pytop, "chm/swig_chm.c")], [os.path.join(pytop, "recollchm/swig_chm.c")],
libraries=["chm"], libraries=["chm"],
extra_compile_args=["-DSWIG_COBJECT_TYPES"]), extra_compile_args=["-DSWIG_COBJECT_TYPES"]),
Extension("chm.extra", Extension("recollchm.extra",
[os.path.join(pytop, "chm/extra.c")], [os.path.join(pytop, "recollchm/extra.c")],
extra_compile_args=["-D__PYTHON__"], extra_compile_args=["-D__PYTHON__"],
libraries=["chm"])] libraries=["chm"])]
) )