Skip to content

Instantly share code, notes, and snippets.

@tingletech
Created July 22, 2011 00:06
Show Gist options
  • Select an option

  • Save tingletech/1098543 to your computer and use it in GitHub Desktop.

Select an option

Save tingletech/1098543 to your computer and use it in GitHub Desktop.
bash script to build a local copy of lxml so that cdlcommon does not require an out of phase upgrade
#!/usr/bin/env bash
# stop on udefined variables(u) or non-zero exit codes (e); trace (x)
set -uex
# prefix for build
PREFIX=${PREFIX:-$HOME/python-lib-test}
mkdir -p $PREFIX/src
cd $PREFIX/src
if [ ! -e lxml-2.3.tar.gz ]; then
wget "http://pypi.python.org/packages/source/l/lxml/lxml-2.3.tar.gz#md5=a245a015fd59b63e220005f263e1682a"
fi
if [ ! "`md5sum lxml-2.3.tar.gz`" == 'a245a015fd59b63e220005f263e1682a lxml-2.3.tar.gz' ]; then
exit 1
fi
/opt/csw/bin/tar zxf lxml-2.3.tar.gz
export CFLAGS="-I/opt/csw/include -I/opt/csw/include/libxml2 -I/opt/csw/include/python2.6"
export PYTHONPATH=$PREFIX/lib/python/site-packages
cd lxml-2.3
python setup.py install --prefix=$PREFIX
# test
python -c "import lxml"
python -c "from lxml import etree"
python -c "from lxml import objectify"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment