2. Installation

This chapter covers the installation of ecromedos from source and binary packages. You should be able to run ecromedos on any system on which the dependencies listed below are available.

2.1. Obtaining the Latest Version

The latest version of the software can be obtained from the project's website at http://www.ecromedos.net. You will find a tarball for manual installation and binary packages for selected platforms.

2.2. Dependencies

For proper operation, ecromedos depends on the following third-party software offerings:

Python

A powerful scripting language. Python is available for all popular operating systems and can be obtained from the website of the Python Software Foundation at http://www.python.org. You will need version 2.4 or later to run ecromedos. Please note that ecromedos is not yet ready for Python 3.

libxml and libxslt

Two super fast and stable libraries for processing XML, developed by Daniel Veillard for the GNOME project. Both libraries offer bindings to Python. The project homepage is at http://www.xmlsoft.org.

Imagemagick

A set of tools for image manipulation. ecromedos uses Imagemagick for resizing bitmap images and to do format conversions. You can download the software from http://www.imagemagick.org.

TeX

If you want to produce Postscript or PDF, you need an installation of the TeX typesetting system. It is recommended that you use TeX Live 2009 or later, available from http://www.tug.org/texlive/.

dvipng

A utility to convert DVI files to PNG or GIF graphics. ecromedos needs this to convert mathematic formulas to bitmap graphics when generating XHTML output. dvipng is available from http://www.nongnu.org/dvipng/, it may also be included in your TeX distribution.

Pygments

Pygments is a powerful syntax highlighter that can lex a vast amount of programming languages and scripts. ecromedos uses Pygments for automatic syntax highlighting of code samples. Find out more about Pygments at http://pygments.org.

2.3. Installation from Source

First, double check that you have installed the dependencies listed in section 2.2.

Step 1: Unpacking the Tarball

ecromedos can be installed anywhere in the file system. It is recommended, however, that you place it in /opt. In order to do so, open a shell and become superuser root by typing

#> su -

Then change your working directory to /opt

#> cd /opt

and unpack the tarball. The following example assumes that the tarball resides in the home directory of system user tobias:

#> tar -xvzf /home/tobias/ecromeds-x.y.z.tar.gz
Step 2: Adding the Executable to the System Path

Now change to /usr/local/bin and create a symbolic link to the main executable:

#> cd /usr/local/bin
#> ln -s /opt/ecromedos-x.y.z/bin/ecromedos

By placing this link in the system path, you will be able to call ecromedos by name without having to enter the canonical path to the executable.

Step 3: Pre-compiling the Source Files

Since you would typically install ecromedos in a location, to which normal system users don't have write access, you should pre-compile the Python source files to bytecode, so that users can benefit from much-improved application start-up times. To do so, change into the installation directory and issue the following command:

#> find . -name "*.py" -exec \
    python -c "import py_compile; py_compile.compile('{}')" \;
Step 4: Adapting the Configuration

Having completed the installation procedure described above, you may now edit the configuration file ecmds.conf, which is located in the subdirectory etc below the installation folder. ecromedos is designed to be relocatable, so in many cases it should just work out of the box. However, the configuration variables holding pointers to third-party software that ecromedos relies on may have to be corrected. In particular, check all variables ending in _bin or _dir.

The value of a configuration variable can be reused in arguments to other variables by prefexing the name of the variable to be referenced with a dollar sign. For instance, if base_dir is set to /opt/ecromedos-x.y.z/, then you can set lib_dir to /opt/ecromedos-x.y.z/lib by simply writing lib_dir = $base_dir/lib.

ecromedos 2 introduces the automatic variable $install_dir, which is set implicitely and points to the installation directory.

2.4. Installing Binary Packages

Packages for Debian, Ubuntu and OpenSUSE are provided. Since ecromedos is written in Python, and thus does not need to be compiled or linked against system libraries, it should run on any version of these distros, as long as the dependencies listed in section 2.2 are available.

2.4.1. Debian/GNU and Ubuntu Linux

If you are running Debian/GNU or Ubuntu Linux, you can install ecromedos via apt. Just insert the following entry into /etc/apt/sources.list:

deb http://ecromedos.net/packages/debian debian contrib

Then update the package cache and install ecromedos by saying

#> apt-get update
#> apt-get install ecromedos

The documentation is contained in a separate package ecromedos-doc.

2.4.2. OpenSUSE Linux

To comfortably install ecromedos on OpenSUSE, add the following repository URL to your repository sources:

http://ecromedos.net/packages/opensuse

You can either do this from YaST or on the command line using zypper like this:

#> zypper addrepo -c -f http://ecromedos.net/packages/opensuse/ ecromedos2
#> zypper install ecromedos

And if you also want to install the documentation:

#> zypper install ecromedos-doc