From fa715d1912f0c1f121a8f0cc0a3d32f33f3832c3 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Sat, 24 Mar 2012 09:20:08 +0100 Subject: [PATCH] Python: let configure setup datadir (removed whacky python code) --- src/python/recoll/Makefile | 10 ++++++++++ src/python/recoll/{setup.py => setup.py.in} | 15 ++------------- 2 files changed, 12 insertions(+), 13 deletions(-) create mode 100644 src/python/recoll/Makefile rename src/python/recoll/{setup.py => setup.py.in} (79%) diff --git a/src/python/recoll/Makefile b/src/python/recoll/Makefile new file mode 100644 index 00000000..14c913a6 --- /dev/null +++ b/src/python/recoll/Makefile @@ -0,0 +1,10 @@ +all: + python setup.py build + +clean: + rm -rf build + +distclean: clean + +install: + python setup.py install diff --git a/src/python/recoll/setup.py b/src/python/recoll/setup.py.in similarity index 79% rename from src/python/recoll/setup.py rename to src/python/recoll/setup.py.in index 4f53960c..2f35d33c 100644 --- a/src/python/recoll/setup.py +++ b/src/python/recoll/setup.py.in @@ -8,21 +8,10 @@ if sysname == 'Linux': else: libs = ['rcl', 'xapian', 'iconv'] -if 'RECOLL_DATADIR' in os.environ: - datadirs = [os.environ['RECOLL_DATADIR']] -else: - datadirs = [] -datadirs = datadirs + ['/usr/share/recoll', '/usr/local/share/recoll', '/'] -for datadir in datadirs: - if os.path.exists(datadir): - break -if datadir == '/': - print 'share/recoll directory not found: you need to install Recoll first' - sys.exit(1) top = os.path.join('..', '..') -# Test for PIC library +# Verify that the Recoll library was compiled with the PIC options localdefs = os.path.join(top, 'mk', 'localdefs') try: lines = open(localdefs, 'r').readlines() @@ -43,7 +32,7 @@ module1 = Extension('recoll', define_macros = [('MAJOR_VERSION', '1'), ('MINOR_VERSION', '0'), ('UNAC_VERSION', '"1.0.7"'), - ('RECOLL_DATADIR', '"' + datadir + '"') + ('RECOLL_DATADIR', '"@QTRECOLL_DATADIR@"') ], include_dirs = ['/usr/local/include', os.path.join(top, 'utils'),