User:KurtStephens

From DreamHost

Jump to: navigation, search

I've attempted to follow the directions for installing Trac on dreamhost by following the directions listed at Python, Clearsilver, SQLite, PySQLite, SWIG, Subversion Installation. I decided that a complete installation script is in order:

This script will install into $HOME/local, rather than $HOME, as I like to keep my home directory root clean from 3rd-party software. You can run the script with prefix="$HOME/wee-hoo-haa-here" before the script on the same command line, if you want it to install somewhere else:

> prefix="$HOME/wee-hoo-haa-here" sh build.trac.sh

Enjoy!

BTW: I will keep the http://kurtstephens.com/pub/dreamhost/trac files up to date, I cannot guarantee the accuracy of this page.

--KurtStephens 23:39, 5 Apr 2006 (PDT)


http://kurtstephens.com/pub/dreamhost/trac/bashrc:

# This script has NO WARRANTY, swim at your own risk.

PATH="$HOME/bin:$PATH"
prefix="$HOME/local"
PATH="$prefix/bin:$PATH"; export PATH
LD_LIBRARY_PATH="$prefix/lib/:$LD_LIBRARY_PATH"; export LD_LIBRARY_PATH
LD_RUN_PATH="$prefix/lib/:$LD_RUN_PATH"; export LD_RUN_PATH
PYTHONPATH="$prefix/lib/svn-python:$prefix/lib/python2.3/site-packages:$PYTHONPATH"; export PYTHONPATH

http://kurtstephens.com/pub/dreamhost/trac/bin/build.trac.sh:

#!/bin/bash
# This script has NO WARRANTY, swim at your own risk.
set -x

prefix="${prefix:-$HOME/local}"

mkdir -p "$prefix"/{archive,src,bin,lib,include}

PATH="$prefix/bin:$PATH"; export PATH
LD_LIBRARY_PATH="$prefix/lib/:$LD_LIBRARY_PATH"; export LD_LIBRARY_PATH
LD_RUN_PATH="$prefix/lib/:$LD_RUN_PATH"; export LD_RUN_PATH

cd "$prefix"/src

(set -e
cd ../archive
# Python 2.3.5
wget http://python.org/ftp/python/2.3.5/Python-2.3.5.tgz
# Clearsilver 0.10.2
wget http://www.clearsilver.net/downloads/clearsilver-0.10.2.tar.gz
# SQLite 3.3.4
wget http://www.sqlite.org/sqlite-3.3.4.tar.gz
# PySQLite 2.0.7
wget http://initd.org/pub/software/pysqlite/releases/2.0/2.0.7/pysqlite-2.0.7.ta
r.gz
# Swig 1.3.29
wget http://umn.dl.sourceforge.net/sourceforge/swig/swig-1.3.29.tar.gz
# Subversion 1.3.1
wget http://subversion.tigris.org/downloads/subversion-1.3.1.tar.gz
# Trac 0.9.4
wget http://ftp.edgewall.com/pub/trac/trac-0.9.4.tar.gz
) || exit $?

# Python 2.3.5
tar -zxf ../archive/Python-*.tgz
(
cd Python-*/
./configure --prefix="$prefix"
make
make install
)

# Clearsilver 0.10.2
tar -zxf ../archive/clearsilver-*.tar.gz
(
cd clearsilver-*/
# Trac fixes
sed -i "s@/usr/local/bin/python@/usr/bin/env python@g" scripts/document.py
PYTHON_SITE=`$prefix/bin/python -c "import sys; print [path for path in sys.path
 if path.find('site-packages') != -1][0]"` \
./configure --with-python="$prefix/bin/python" --prefix="$prefix" --disable-ruby
 --disable-java --disable-apache --disable-csharp --disable-perl
make
make install
)

# SQLite 3.3.4
tar -zxf ../archive/sqlite-*.tar.gz
(
cd sqlite-*/
./configure --prefix="$prefix" --enable-threadsafe
make
make install
)
ln -s sqlite3 ../bin/sqlite

# PySQLite 2.0.7
tar -zxf ../archive/pysqlite-*.tar.gz
(
cd pysqlite-*/
sed -i "s@^include_dirs =.*@include_dirs = ['$prefix/include']@" setup.py
sed -i "s@^library_dirs =.*@library_dirs = ['$prefix/lib']@" setup.py
$prefix/bin/python setup.py build
$prefix/bin/python setup.py install
)

# Swig 1.3.29
tar -zxf ../archive/swig-*.tar.gz
(
cd swig-*/
./configure --prefix="$prefix" --with-python="$prefix/bin/python"
make
make install
)

# Subversion 1.3.1
tar -zxf ../archive/subversion-*.tar.gz
(
cd subversion-*/
#cd $HOME/lib/python2.3/site-packages
#mv libsvn libsvn.b0rk
#ln -s /usr/lib/python2.3/site-packages/libsvn
#ln -s /usr/lib/python2.3/site-packages/svn
./configure PYTHON=$prefix/bin/python --prefix=$prefix --with-swig=$prefix/bin/s
wig --without-berkeley-db --with-ssl --with-zlib
(cd apr/ && make && make install)
(cd apr-util/ && make && make install)
(cd neon/ && make && make install)
make
make swig-py
make install-swig-py
make install
make install-swig-py # 2 times a charm
echo $prefix/lib/svn-python > $prefix/lib/python2.3/site-packages/subversion.pth
$prefix/bin/python -c "from svn import client"
)

# Trac 0.9.4
tar -zxf ../archive/trac-*.tar.gz
(
cd trac-*/
$prefix/bin/python setup.py install --prefix="$prefix"
(cd $prefix/bin && sed -i 's,/usr/bin/python,/usr/bin/env python,' trac-admin tr
acd tracdb2env)
)


http://kurtstephens.com/pub/dreamhost/trac/cm.how2vid.com:

#!/bin/bash
HOME="${HOME:-/home/how2vidcm}"
. $HOME/.bashrc

export TRAC_ENV="$HOME/trac.how2vid.com"

exec "$prefix/share/trac/cgi-bin/trac.fcgi"
Personal tools