Installation: Build on Linux

This guide will walk through what tools are needed for building UnityCore on most modern linux systems. You are responsible for getting the needed software downloaded and configured.
Tools you will need

  •     G++
  •     GCC
  •     make
  •     cmake version 2.6.x or greater
  •     MySQL Server and Client and the development includes and libraries
  •     Mercurial (for checking out the source)
  •     OpenSSL
  •     zlib1g and the development includes and libraries
  •     libtool
  •     patch
  •     build-essential (for Debian and Ubuntu distributions)
  •     libreadline and the development includes and libraries
  •     Linux unrar tools
  •     Some experience with Linux and common sense

To fetch the components for Ubuntu :

    apt-get install build-essential cmake libmysql++-dev subversion mercurial \
    openssl libssl-dev zlib1g-dev libmysqlclient15-dev libtool mysql-client unrar

To fetch the components for Debian :

    apt-get install g++ gcc make cmake libmysql++-dev subversion mercurial openssl \
    libssl-dev zlib1g-dev libtool libmysqlclient15-dev patch build-essential \
    mysql-client libreadline5-dev libbz2-dev bzip2

Preparing to Build

First step is to setup a user account to run UnityCore (NEVER RUN IT AS ROOT!)

adduser unity

Then su to the new unity user.

su - unity

Setting up your Build Environment

If you are new to Linux, this is an opportunity for you to form good development habits. There are some accepted best-practices on Unix and Linux systems that we will employ in our build.

First, we'll create the basic directory structure in our home directory.

    mkdir src
    mkdir data
    mkdir log

The src directory is where we'll put our source files. The data directory will contain the dbc, map, and vmap files that we'll extract from the WoW client. The log directory will have all of our run-time logs, as well as the server pid files. As we build the software, the installation stages will create more directories for us.

Now cd to the src (cd src) directory, and we'll fetch the source files.

Mercurial Checkout

The UnityCore files are initially cloned from the project's Mercurial repositories.

To clone the UnityCore repository (repo) run the following:

hg clone http://bitbucket.org/Unity/unity

Prerequisite Libraries

UnityCore is particularly sensitive to having the proper versions of OpenSSL and ACE. In order to make sure that we can build successfully, we're going to compile local versions of these specifically for the core.

Building a local version of OpenSSL

These steps will download and compile OpenSSL for the core. We'll start here, because we want our local version of ACE to be built using the local SSL libraries.

Make sure you have su'd to your unity user, and are in the src directory!

**** TODO ****

You must have a successful build before you can continue.

Building UnityCore

Make sure you have su'd to your unity user, and are in the src directory!

Finally, we're ready to build UnityCore. The following will perform the build using common configuration options.

**** TODO ****

As with the other compiles, you cannot continue unless these steps executed successfully.

Once you have completed a successful build, the server programs will be installed in the $HOME/bin directory.


Congratulations!


Keeping the code up to date

UnityCore Developers are always at work fixing and adding new features to the core. You can always check them here.

To update the source and database, we use the Mercurial pull and update commands.

1. Go to the UnityCore source directory (ex: $HOME/src/unitycore).

2. Delete your old build directory with rm -rf build.

3. Pull the updates with hg pull, then apply them with hg update.

4. The source is now in sync with the repo and ready for a new build.

 

Published on  October 25th, 2011