This tutorial will walk you through everything you need to build EOSERV on Linux. It assumes you have no development tools installed, and you are familiar with the command line.
Only the latest releases of Debian, Ubuntu and Linux Mint are officially supported distributions. Older releases (e.g. 12.04 LTS) may require newer versions of packages be installed via backports.
== Installing build tools and dependencies ==
The following
* G++ 4.8 or later (g++) '''or''' Clang 3.4 or later (clang)
* CMake Qt GUI (<tt>cmake-qt-gui</tt>) '''or''' CMake Curses GUI (<tt>ccmake</tt>) - 2.6 or later
* Optional: MariaDB client development libraries (<tt>libmariadb-client-lgpl-dev</tt>)
* Optional: SQLite3 development libraries (<tt>libsqlite3-dev</tt>)
* Optional: Subversion
If you are using Debian or a Debian-based distro (e.g. Ubuntu or Linux Mint) you can use the following commands to install the required tools and dependencies (or install the packages via your system's GUI package manager):
<pre>sudo apt-get install g++ make libsqlite3-dev libmariadb-client-lgpl-dev ccmake cmake-qt-gui subversion</pre>
If <tt>sudo</tt> is missing, use the <tt>su</tt> command to switch to root and repeat the command without <tt>sudo</tt>. If building in a non-graphical environment (e.g. on a server over SSH) leave out <tt>cmake-qt-gui</tt>.
If you wish to build with Clang instead of G++, replace <tt>g++</tt> with <tt>clang</tt>. If you wish to download a snapshot, subversion is not required. At least one of SQLite3 or MariaDB is required.
'''Note that package names may be different on non-Debian distros!'''
== Obtaining the Source Code ==
There are two options for getting the EOSERV source:
# '''RECOMMENDED''': Use Subversion to obtain the source code from <tt>svn://eoserv.net/eoserv/trunk</tt>
# Follow the instructions on [[EOSERV_SVN]] for instructions on obtaining the source code and keeping it up to date.
Alternatively,
# Visit [[http://files.eoserv.net/snaps/]] and download the latest snapshot. Any GUI archive tool should be able to extract them, or you can use the following command on the command line: <pre>tar -xf eoserv-trunk-rXXX.tar.gz</pre>
Snapshots are not recommended for serious work as it is difficult to update the code without destroying any of your own alternations.
== Configuring ==
The most user-friendly way to configure EOSERV is to use the CMake GUI:
Use CMake's GUI (<tt>cmake-gui</tt>) to select a source directory (the directory EOSERV has been extracted to), and a build directory (a directory you want to build EOSERV in). To avoid problems, make sure the build directory is not the same as the source directory.
Click "Configure", and select your toolchain (GCC and Clang should be automatically detected, or compiler paths can be specified manually), and output format (Unix Makefiles). Various build options can be changed using the GUI (such as toggling MySQL/SQLite support) before clicking "Generate".
It is highly recommended to change the <tt>CMAKE_BUILD_TYPE</tt> option to either '''Debug''' (for development) or '''Release''' (for production).
If you get any errors about missing libraries, make sure the required packages are installed for those libraries.
To create and configure a build directory using the text-only CMake GUI (ccmake), use the following commands:
<pre>mkdir /path/to/eoserv/build/
cd /path/to/eoserv/build/
ccmake -G "Unix Makefiles" /path/to/eoserv/source/</pre>
Once the GUI is opened, press '''c''' to configure, arrows keys and enter to edit configuration fields, '''c''' to configure again, then '''g''' to generate the makefiles and close the GUI.
== Building ==
Assuming CMake worked successfully, simply typing <tt>make</tt> in the build directory should compile and build EOSERV.
Using <tt>make install</tt> will copy only the EOSERV files elsewhere, but make sure you configure a sensible <tt>CMAKE_INSTALL_PREFIX</tt> in CMake. Installing to the default <tt>/usr/local</tt> is a very bad idea. The preferred install path is <tt>/opt/eoserv</tt>.
|