wiki:DebianInstall
Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Version 9 (modified by mgeisler, 13 years ago) (diff)

Information about python-turbogears from experimental

Debian Packaging

Unlike other Linux distributions, Debian systems use a strict package management system. This system "owns" certain directories. If a user installs files into the directories, he is likely to corrupt the system. Unfortunately, the current TurboGears install instructions for *nix systems will override filesystem permissions, deposit files ino those directories, and corrupt your Debian system (possibly quite badly!). This is listed as bug 273.

Instead of those directions, there are two solutions for installing TurboGears. You can do it through the Debian package system, by trying to create a Debian package representing the python module (method 1). Or you can set up configurations so that the python packaging system will respect the boundaries required by Debian packaging system (method 2).

The second method is recommended. The easy-deb below is not included in Debian stable, seems fairly new, and it will probably be a while before a best practice emerges for integrating the python packaging system with Debian's package management.

1) Through the Debian package system

Ian Bicking noted that there is a python tool for creating Debian packages:  http://easy-deb.sourceforge.net/

Note, that Bob Tanner, Gustavo Noronha, and Fredrik Steen are working on official TurboGears packages at  http://alioth.debian.org/projects/pkg-turbogears/ and the resulting  python-turbogears package has now entered the experimental distribution, and is expected to eventually enter unstable (Sid) and testing (Etch).

Installing TurboGears on a machine tracking testing can thus be done as follows:

  1. Make sure that the unstable and experimental distributions are available in /etc/apt/sources.list. If MIRROR is your selected  mirror, then it should look like this:
deb http://MIRROR/debian/ testing      main contrib non-free
deb http://MIRROR/debian/ unstable     main contrib non-free
deb http://MIRROR/debian/ experimental main contrib non-free
  1. Make APT prefer packages from testing over packages from unstable and experimental by setting /etc/apt/preferences:
Package: *
Pin: release a=testing
Pin-Priority: 900

Package: *
Pin: release a=unstable
Pin-Priority: 800

Package: *
Pin: release a=experimental
Pin-Priority: 700

See the apt_preferences(5) man page for information about this file.

  1. Install the python-turbogears package using apt-get, aptitude or whatever tool you prefer; this will pull in a lot of other packages from all three distributions.

That should be it! You now have a TurboGears installation which will automatically track the latest versions of all dependant packages and install them as needed. Whenever a dependant package is available from both testing and unstable, then one from testing will be preferred.

2) Debian Sarge and Sid (unstable): Non-root installs

Here $ is your prompt.

  1. Make sure you are a member of the 'staff' group. This group

has permission to write in the '/usr/local' tree. Debian packages set up some empty directories in this tree with the correct permissions so that non-root installs of supplementary modules etc can be done.

The 'id' program will show you what groups you are already a member of. If your username is 'me' and your uid is 1001 then the output of 'id' will appear as shown and you need to list all the present additional groups as well as 'staff' when running 'usermod'. If 'staff' is already listed then you can skip this step.

$ id 
uid=1001(me) gid=1001(mygroup) groups=24(cdrom),29(audio),1001(mygroup)
$ sudo usermod -G 24,29,staff me

Alternatively, a much simpler way, using the Debian 'adduser' tool:

$ sudo adduser me staff

After either method, you need to log out and in again for this to take effect.

  1. Install python2.4-dev. [example: Debian provides methods other than sudo ...]
$ sudo apt-get install python2.4-dev
  1. Create a pydistutils.cfg file in your home directory. [or use vi/emacs/...]
$ cat > ~/.pydistutils.cfg << EOF
[install]
install_lib = /usr/local/lib/python2.4/site-packages

[easy_install]
site_dirs=/usr/local/lib/python2.4/site-packages
EOF

Please notice that the easy_install section does not support the $ variables. Just write the complete path.

  1. Run ez_setup.py from the Turbogears download page.
$ python2.4 ez_setup.py -f http://www.turbogears.org/download/index.html --script-dir /usr/local/bin TurboGears

A known-good variant of these instructions is also available at bug ticket 273.