Installation Notes for Python Desktop Server
--------------------------------------------

This installation document will install a local copy of python for this
application only. If you have installed a current version of Python, you can
skip the installation of python and use your local copy.

If you run windows, have a look at the following URL:

http://www.pycs.net/users/0000077/stories/1.html

This gives you a short rundown of how to get all this up and running under Windows. Additionally you can look here:

http://simon.bofh.ms/~louis/

for a binary installer for Windows and a beginning of a Users Guide.

IMPORTANT NOTE: there are installations of non-thread-enabled versions of
python 2.2 (for example NetBSD has this in some versions). Since PyDS needs
threads, you need to have a thread-enabled version!

You need to have the libjpeg62 in either a or b version installed for the
PictureTool in PyDS. Usually you can just use the development library that
is deployed with your system, but if you don't have one (or if you use
MacOS X), you can just do the following:

wget http://www.ijg.org/files/jpegsrc.v6b.tar.gz
tar xvfz jpegsrc.v6b.tar.gz
cd jpeg-6b
./configure
make
sudo make install-lib
sudo ranlib /usr/local/lib/libjpeg.a

If the install-lib barfs about not being able to access header files, you
may need to create the local directories and do the install-lib again:

mkdir -p /usr/local/include
mkdir -p /usr/local/lib
sudo make install-lib
sudo ranlib /usr/local/lib/libjpeg.a

To install a version of zlib do the following:

wget http://www.gzip.org/zlib.tar.gz
tar xvzf zlib.tar.gz
cd zlib-1.1.4/
./configure
make
sudo make install

This installes a local copy of libjpeg.a and zlib.a. Other preliminaries are
those that are needed by Python 2.2.2 - go and read their documentation on what
you have to have installed.

Create a Project directory somewhere:

cd ~/
mkdir PyDS
cd PyDS
mkdir Archives
mkdir Source

Fetch the following packages (newer Versions might be ok, but are not tested):

cd ~/PyDS/Archives
wget http://www.python.org/ftp/python/2.2.2/Python-2.2.2.tgz
wget http://simon.bofh.ms/~gb/medusa-0.5.4.tar.gz
wget http://www.equi4.com/pub/mk/metakit-2.4.9.2.tar.gz
wget http://telia.dl.sourceforge.net/sourceforge/cheetahtemplate/Cheetah-0.9.15a3.tar.gz
wget http://telia.dl.sourceforge.net/sourceforge/pyxml/PyXML-0.8.2.tar.gz
wget http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/Pyrex-0.5.tar.gz
wget http://telia.dl.sourceforge.net/sourceforge/docutils/docutils-0.3.tar.gz
wget http://www.pythonware.net/storage/Imaging-1.1.4.tar.gz
wget http://www.analytics.washington.edu/Zope/projects/fpconst/fpconst-0.6.0.tar.gz
wget http://osdn.dl.sourceforge.net/sourceforge/pywebsvcs/SOAPpy-0.11.1.tar.gz
wget http://telia.dl.sourceforge.net/sourceforge/silvercity/SilverCity-0.9.5.tar.gz
wget http://simon.bofh.ms/~gb/PyDS-latest.tar.gz

(PyRex is currently not necessary, but I install it nonetheless to have some
means of improving performance available. It's platform neutral, so it should
work on other systems, too).

The real download link for medusa is actually this one:

http://www.amk.ca/files/python/medusa-0.5.4.tar.gz

But the webmaster restricted wget from fetching the file. curl -O actually
still works. But since I don't know how long, I copied the file over to my own
server. Which version you use is unimportant, both are the same.

A general notice: if download links don't work, you should browse the server
where the files are hosted, most often there just is a newer version available
and the authors dropped the older version I am linking. If you have problems
getting your hands on one of the files, all of them are available under

http://simon.bofh.ms/~gb/

so you can always fall back to my local copies!

Unpack the source packages:

cd ~/PyDS/Source

tar xvfz ../Archives/Python-2.2.2.tgz
tar xvfz ../Archives/PyXML-0.8.2.tar.gz
tar xvfz ../Archives/Cheetah-0.9.15a3.tar.gz
tar xvfz ../Archives/medusa-0.5.4.tar.gz
tar xvfz ../Archives/metakit-2.4.9.2.tar.gz
tar xvfz ../Archives/Pyrex-0.5.tar.gz
tar xvfz ../Archives/docutils-0.3.tar.gz
tar xvfz ../Archives/Imaging-1.1.4.tar.gz
tar xvfz ../Archives/fpconst-0.6.0.tar.gz
tar xvfz ../Archives/SOAPpy-0.11.1.tar.gz
tar xvfz ../Archives/SilverCity-0.9.5.tar.gz
tar xvfz ../Archives/PyDS-latest.tar.gz

If you compile on Mac OS X, you will have to patch the Makefile for the
python extension, as the standard unix makefile doesn't produce a bundle.
ATTENTION: This is only needed for Mac OS X!

cd ~/PyDS/Source/metakit-2.4.9.2/unix
cp ~/PyDS/PyDS-0.7.3/metakit-Makefile.in .

Now build the whole bunch into a application-private directory (the sample is
for MacOS X, you mide decide on a different path on other systems):

cd ~/PyDS/Source/Python-2.2.2
./configure --prefix=/opt/pyds
make
sudo make install

cd ~/PyDS/Source/Pyrex-0.5
sudo /opt/pyds/bin/python setup.py install

You have to patch /opt/pyds/bin/pyrexc to use the local
python, the installed binary uses the (possibly installed) global version.
Change the first line from

#!/usr/bin/env python2.2

to read:

#!/opt/pyds/bin/python2.2

Now install the rest:

IMPORTANT NOTE: If you install SilverCity under Mac OS X 10.2, you need to take some steps
to get it going. Please read INSTALL-SILVERCITY-ON-JAGUAR before trying to install it!

cd ~/PyDS/Source/PyXML-0.8.2
sudo /opt/pyds/bin/python setup.py install

cd ~/PyDS/Source/Cheetah-0.9.15a3
sudo /opt/pyds/bin/python setup.py install

cd ~/PyDS/Source/medusa-0.5.4
sudo /opt/pyds/bin/python setup.py install

cd ~/PyDS/Source/docutils-0.3
sudo /opt/pyds/bin/python setup.py install

cd ~/PyDS/Source/fpconst-0.6.0
sudo /opt/pyds/bin/python setup.py install

cd ~/PyDS/Source/SOAPpy-0.11.1
sudo /opt/pyds/bin/python setup.py install

cd ~/PyDS/Source/SilverCity-0.9.5
sudo /opt/pyds/bin/python setup.py install

cd ~/PyDS/Source/metakit-2.4.9.2/unix
./configure --prefix=/opt/pyds --with-python=/opt/pyds
make
sudo make install

cd ~/PyDS/Source/Imaging-1.1.4
cd libImaging
./configure
make
cd ..
sudo /opt/pyds/bin/python setup.py install

That's all, now you have your development environment up and running!

Now you have to install the Python Desktop Server itself.

This is as easy as it is to install the other stuff. Just follow the
following simple steps from the nightly build (actually you should replace
the current version number, as this document is bound to be outdated from
time to time when I put out new versions and forget to update this doc ;-) ):

cd ~/PyDS/Source/PyDS-0.7.3
sudo /opt/pyds/bin/python setup.py install

After this you can start the server with the following command:

/opt/pyds/bin/pyds-start

And you can stop the server with the following command:

/opt/pyds/bin/pyds-stop

You can acces the desktop server with netscape with the following URL:

/opt/pyds/bin/pyds-browse netscape | sh

pyds-browse takes at least parameter, the executable of the browser. You
can make one of those parameters have %s in it, the URL will be inserted
at that place. Or you can leave %s out, then the URL will be appended.

You will have to set up some mandatory preferences before you can use the
desktop server. This includes personal data and registration at one of
the available community servers. You can use muensterland.org or pycs.net,
and it might run with radio.userland.com or rcs.salon.com, but I only test
against Python Community Server.

PyDS supports several languages for the user interface. Look for the *.msgs
files in the installation package. The message files are used automatically,
depending on the setting of your language in your local configuration. To
change your configuration, just start the PyDS once. Stop it again. Now
go to your home directory. There is a .PyDS subdirectory that has several
other subdirectories. One is named etc. Go into that directory and create
a file named PyDSConfig.py. You can put config variables in there. For example
to change to French language, you add the following line:

language = 'fr'

To change to German language, you just put 'de' in that statement. If you want
to use the japanese language file, you need to switch the language to Japanese
and set the documentEncoding to utf-8 (because Japanese has a multiybyte
charset):

language = 'ja'
documentEncoding = 'utf-8'

Note for MacOS X users: due to the nature of the python interpreter the
applications can't be moved after installation, because absolute pathnames
are encoded in the directory. So you should choose your path wisely.

General note: all data for a running instance of PyDS are kept in the .PyDS
subdirectory of the pyds-running users $HOME. So multiple instances of
PyDS can be running on the same machine.

There might one day be a simple one-click installer, but for now the above
installation notes should be sufficient. This system is actually targeted to
hackers, and those know what they do (or should know at least).

