# Installing BibleTime Sources

This chapter describes how sources are compiled. These steps apply for both the development version and the released version of &bibletime; and &sword;.

## Installation of &sword; and the &sword; Modules

&sword; and &sword; modules are the book library for BibleTime. Please see the page download for further information about downloading BibleTime.

Have a look at the requirements page to obtain &sword;. See page links to obtain &sword;'s modules.

### Installation of SWORD

This page shows &sword; 1.5.1a. For other versions of &sword;, the file names will be different.

First you have to unpack the downloaded .tar.gz file (if you are using the CVS version, your sources will already be unpacked, so skip this step) to a temporary directory. Do something like this:

    mkdir /tmp
    cd /tmp
    tar -xzf sword-1.5.1a.tar.gz
    cd /tmp/sword-1.5.1a

(the tar file will have unpacked into a directory named something similar to sword-1.5.1a)

Before you try to compile &sword;, you may need to modify `Makefile.cfg` (it is located in the top directory of the unpacked sources). The customized section of `Makefile.cfg` is marked, do not try to change parts of the file outside of the area marked ##### Customizable stuff. Set it how you like it ##### unless you really know what you are doing.

For many installations the defaults will work. When the defaults don't work, these switches may be set.

#### Sword Makefile.cfg switches

Switch | Description
--- | ---
# compiler | If you have gcc leave this alone, otherwise enter the compiler you will be using.
# shared library- | Set to 'yes'. this causes the shared library `libsord.so` to be generated. An entry must be placed into the file `/etc/ld.so.conf` that points to libsword. `/usr/local/sword/lib` is typical. The shared library is necessary for BibleTime to work, but Sword will compile without errors if you don't do this. Be careful here.
# VCL library- | Use the default 'no' unless you are using the Sword install manager, then use 'yes'.
# Debugging options etc... | The defaults should work.
# endian, etc. support for other hardware | Use the default if compiling on an Intel. If you have other hardware, select the correct entry.
# zLib support | Use the default 'yes'
# paths | The defaults are OK for most distributions, don't change them unless you know what you are doing.

Now start compiling.

    make
    su
    make install
    make configure

In the event that make command reports an error on completion, it probably indicates that you are missing a package. For example:

    bash-2.03# make
    make just-pre nodeps=yes
    make[1]: Entering directory `/bible/sword-1.5.1a'
    make -C src just-pre
    .
    .
    .
    make[1]: Entering directory `/bible/sword-1.5.1a/include'
    make[1]: Nothing to be done for `just-targets'.
    make[1]: Leaving directory `/bible/sword-1.5.1a/include'
    make -C apps/X11/VCL just-targets
    make[1]: Entering directory `/bible/sword-1.5.1a/apps/X11/VCL'
    gcc -I../../../include/ -D_GNU_SOURCE -I. `gtk-config --cflags` -static -pipe -Wall -Wno-format
    -fomit-frame-pointer -ggdb -O0 -m486 -c -o TWinControl.o TWinControl.cpp
    /bin/sh: gtk-config: command not found
    In file included from TWinControl.cpp:1:
    TWinControl.h:6: gtk/gtkwidget.h: No such file or directory
    TWinControl.cpp:3: gtk/gtkwidget.h: No such file or directory
    In file included from TWinControl.cpp:1:
    TWinControl.h:281: syntax error before `*'
    TWinControl.h:284: parse error before `*'
    TWinControl.cpp:10: parse error before `*'
    make[1]: *** [TWinControl.o] Error 1
    make[1]: Leaving directory `/bible/sword-1.5.1a/apps/X11/VCL'
    make: *** [apps/X11/VCL/targets] Error 2
    bash-2.03#

The italic lines above indicate that a gtk application was missing. A review of the available packages showed that one of the gtk packages supplied with SuSE is gtkdev. This turns out to be the application required to allow make to run to completion without errors. Often missing packages will be found on your installation disks, or on your distribution's website. Once `make` runs to completion without errors, then `make install`. If it still doesn't work, edit the file `Makefile.cfg` in the top directory of the SWORD sources and change the line `buildvcl := yes` to `buildvcl := no` and try again.

### Installation of modules

&sword; currently supports 3 types of modules: Bibles, dictionaries and commentaries. In order for &sword; and &bibletime; to be useful these modules must be installed.

&sword; modules can be installed manually or with &swordInstmgr;. &swordInstmgr; is provided as part of the &sword; package. The directions for compiling and installing &swordInstmgr; can be found in the section How to install and use &swordInstmgr; or in the &sword; source at `/sword/apps/X11/InstallMgr/INSTALL`.

#### Choose a &sword; directory

&sword; currently supports 3 types of modules: Bibles, dictionaries and commentaries. You have to install the files of the modules their own directory. You must decide which directory will be your &sword; directory. If you installed the libs and includes in an extra directory use that directory as your &sword; directory (e.g. `/usr/local/sword/`). If you installed the library and include files in a common place like `/usr/local/` please select another location for your &sword; directory.

#### Unpack the downloaded package

First you have to unpack the downloaded package. On the download page of &sword; you can choose if you want to get a &Windows; or RAW package. If you have a "&Linux; only" box please get the RAW packages. But if you accidentally get a &Windows; self extracting executable try using WINE to extract the files. Perhaps you have to change the filename of `_INSTALL.1` to `_install.1` to get the setup running.

#### Integrating modules

Create the directory `mods.d` inside of your &sword; directory. Please copy the file `[modulename].conf` into the `mods.d` directory. the `.conf` file is normally inside the unpacked module files. Now move the whole dir `/modules` which contains your unpacked module data files to the &sword; directory. In the example `/usr/local/sword/share` is the SWORD directory.

Directory Structure looks like this:

    /usr/local/sword/share/ -|- mods.d/ -|- module_1_name.conf
                             |           |- module_2_name.conf
                             |
                             |- texts/rawtext/ -|-module_1_name/files
                                                |-module_2_name/files