Switch to unified view

a/src/python/recoll/setup.py b/src/python/recoll/setup.py
1
from distutils.core import setup, Extension
1
from distutils.core import setup, Extension
2
import os
2
import os
3
import sys
3
4
4
sys = os.uname()[0]
5
sysname = os.uname()[0]
5
if sys == 'Linux':
6
if sysname == 'Linux':
6
    libs = ['rcl', 'xapian']
7
    libs = ['rcl', 'xapian']
7
else:
8
else:
8
    libs = ['rcl', 'xapian', 'iconv']
9
    libs = ['rcl', 'xapian', 'iconv']
9
10
10
if 'RECOLL_DATADIR' in os.environ:
11
if 'RECOLL_DATADIR' in os.environ:
...
...
14
datadirs = datadirs + ['/usr/share/recoll', '/usr/local/share/recoll', '/']
15
datadirs = datadirs + ['/usr/share/recoll', '/usr/local/share/recoll', '/']
15
for datadir in datadirs:
16
for datadir in datadirs:
16
    if os.path.exists(datadir):
17
    if os.path.exists(datadir):
17
        break
18
        break
18
if datadir == '/':
19
if datadir == '/':
19
    print 'You need to install Recoll first'
20
    print 'share/recoll directory not found: you need to install Recoll first'
20
    os.exit(1)
21
    sys.exit(1)
21
22
22
23
top = os.path.join('..', '..')
23
top = os.path.join('..', '..')
24
24
25
# Test for PIC library
26
localdefs = os.path.join(top, 'mk', 'localdefs')
27
try:
28
    lines = open(localdefs, 'r').readlines()
29
except:
30
    print 'You need to build recoll first. Use configure --enable-pic'
31
    sys.exit(1)
32
picok = False
33
for line in lines:
34
    if line.find('PICFLAGS') == 0:
35
        picok = True
36
        break
37
if not picok:
38
    print 'You need to rebuild recoll with PIC enabled. Use configure --enable-pic and make clean'
39
    sys.exit(1)
40
41
                               
25
module1 = Extension('recoll',
42
module1 = Extension('recoll',
26
                    define_macros = [('MAJOR_VERSION', '1'),
43
                    define_macros = [('MAJOR_VERSION', '1'),
27
                                     ('MINOR_VERSION', '0'),
44
                                     ('MINOR_VERSION', '0'),
28
                                     ('UNAC_VERSION', '"1.0.7"'),
45
                                     ('UNAC_VERSION', '"1.0.7"'),
29
                                     ('RECOLL_DATADIR', '"' + datadir + '"')
46
                                     ('RECOLL_DATADIR', '"' + datadir + '"')