Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save asyncee/6387841 to your computer and use it in GitHub Desktop.
Save asyncee/6387841 to your computer and use it in GitHub Desktop.
#/bin/bash
echo "Packages needed for installation:"
echo "zlib1g-dev g++"
echo
echo "You can install it on debian-based distros with command:"
echo "apt-get install zlib1g-dev g++"
echo
if [ -z "$VIRTUAL_ENV" ]; then
echo "This script must be run inside a virtualenv"
echo "To activate virtualenv, run:"
echo "source env/bin/activate"
exit;
fi
VER="1.2.10"
echo "Installing xapian $VER"
export VENV=$VIRTUAL_ENV
mkdir -p $VENV/packages && cd $VENV/packages
curl -O http://oligarchy.co.uk/xapian/$VER/xapian-core-$VER.tar.gz
curl -O http://oligarchy.co.uk/xapian/$VER/xapian-bindings-$VER.tar.gz
tar xzvf xapian-core-$VER.tar.gz
tar xzvf xapian-bindings-$VER.tar.gz
cd $VENV/packages/xapian-core-$VER
./configure --prefix=$VENV && make && make install
export LD_LIBRARY_PATH=$VENV/lib
cd $VENV/packages/xapian-bindings-$VER
./configure --prefix=$VENV --with-python && make && make install
echo "Checking xapian installation:"
echo
python -c "import xapian"
if [ $? -eq 0 ]; then
echo "ok"
else
echo
echo "failed"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment