-
Notifications
You must be signed in to change notification settings - Fork 31
/
install-xapian.sh
executable file
·53 lines (41 loc) · 1.16 KB
/
install-xapian.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env bash
set -ev
# Install xapian support
# expects a virtualenv
if [ -z "$VIRTUAL_ENV" ]
then
echo "Must be in a virtualenv..."
echo "Execute:"
echo "\$ source sherlock_env/bin/activate"
exit
fi
VERSION=1.4.8 # or 1.2.24
echo "Installing xapian core"
# xapian support
curl -o xapian.tar.xz https://oligarchy.co.uk/xapian/$VERSION/xapian-core-$VERSION.tar.xz
tar -xf xapian.tar.xz
cd xapian-core*/
./configure --prefix=$VIRTUAL_ENV --disable-dependency-tracking --disable-assertions
make && make install
cd ..
echo "Installing xapian python bindings"
PYV=`python -c "import sys;t='{v[0]}'.format(v=list(sys.version_info[:1]));sys.stdout.write(t)";`
if [ $PYV = "2" ]; then
PYTHON_FLAG=--with-python
else
PYTHON_FLAG=--with-python3
fi
# bindings
curl -o xapian-bindings.tar.xz https://oligarchy.co.uk/xapian/$VERSION/xapian-bindings-$VERSION.tar.xz
tar -xf xapian-bindings.tar.xz
cd xapian-bindings*/
./configure --prefix=$VIRTUAL_ENV $PYTHON_FLAG --disable-dependency-tracking
make && make install
cd ..
# clean up
echo "Clean up xapian install files"
rm -rf xapian*
# test
echo "Testing Xapian..."
python -c "import xapian"
echo "Done."