Installation & Distutils support

Chapter 2. Installation & Distutils support

C++ projects on KDE traditionally use autoconf, automake and libtool to handle the building and installation. These tools and difficult to use, even for experianced developers.

Fortunately Python has a its own system for building and installing modules and software. Distutils is a standard Python package and comes with every Python installation. PyKDE Extensions builds on Distutils with extensions tailored for handling KDE programs.

A typical KDE program comes not only with the program itself but also extra files such as a manual written in Docbook format, translation files, icons, images and other auxiliary data files. PyKDE Extensions provides support for handling all these other files types.

Using Distutils with KDE programs

It is advised that you first read the standard Distutils documentation to learn about how it works. PyKDE Extensions adds some KDE specific extensions which are documented below.

Distutils is based around writing a file which then uses the distutils package To use the KDE extensions, the first thing you need to do in your file is include the kdedistutils package.

#!/usr/bin/env python
# file for MyKDEApplication

import kdedistutils
You need to call the setup() function from kdedistutils with all of the configuration information about your application, much like the standard setup() from distutils.
    author="Simon Edwards",
    min_kde_version = "3.0.0",
    min_qt_version = "3.0.0",
    license = "LGPL" )
min_kde_version and min_qt_version specify the minimum versions of the Qt library and KDE needed to install and run the software. These requirements are checked during install.

The other arguments shown here are standard distutils.setup() arguments.