cd
test -f installed/pycairo-1.2.2.tar.gz &&
mv installed/pycairo-1.2.2.tar.gz .
test ! -f pycairo-1.2.2.tar.gz &&
wget http://cairographics.org/releases/pycairo-1.2.2.tar.gz
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "pycairo-*" -exec rm -r {} \;
tar xzvf ~/pycairo-1.2.2.tar.gz
cd pycairo-1.2.2
test $UID = 0 && chown -R root:root .
# Use the prefix that Python is installed under
# (run 'python -c "import sys; print sys.prefix"')
./configure --prefix=/usr
make
su -c "make install"
cd
mkdir -p -m 0700 installed
rm -f installed/pycairo-*.tar.*
mv pycairo-1.2.2.tar.gz installed/
# If you ever want to uninstall pycairo, this should do it:
cd
su
test -d src/pycairo-* && ( cd src/pycairo-* ; make uninstall )
test -d /usr/include/pycairo && rm -r /usr/include/pycairo
test -d /usr/lib/python2.4/site-packages/cairo &&
rm -r /usr/lib/python2.4/site-packages/cairo/
rm -f /usr/lib/pkgconfig/pycairo.pc
exit
find ~/src -maxdepth 1 -type d -name "pycairo-*" -exec rm -r {} \;
rm -f ~/installed/pycairo-*.tar.*