Downloading and building on Linux

From OregonCore Wiki
Revision as of 22:16, 19 September 2015 by Lloid Irvyng (Talk | contribs) (Added libncurses-dev and make -j. Added instructions for database creation.)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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

Tools you will need

  • gcc, g++
  • 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
  • zlib including the development includes and libraries
  • build-essential (for Debian and Ubuntu distributions)
  • Linux unzip tools
  • binutils including development includes and libraries
  • ACE including development includes and libraries
  • Some experience with Linux and common sense


Dependencies for Ubuntu:

apt-get install build-essential cmake mercurial binutils-dev libiberty-dev libbz2-dev \
openssl libssl-dev zlib1g-dev libmysqlclient15-dev libtool mysql-client unrar libace-dev

Dependencies for Debian (tested with Debian 8):

apt-get install binutils-dev build-essential bzip2 cmake g++ gcc libace-dev libbz2-dev libiberty-dev \
libmysqlclient-dev libncurses5-dev libreadline-gplv2-dev libssl-dev make mercurial mysql-client openssl patch zlib1g-dev

Dependencies for Fedora/Centos:

yum install cpp gcc gcc-c++ make cmake mercurial openssl openssl-devel \
mysql-devel mysql-server mysql mysql-libs readline readline-devel \
compat-readline5-devel compat-readline5 zlib-devel binutils-devel ace-devel

Preparing to Build

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

adduser oregon

Then su to the new oregon user.

su - oregon

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 OregonCore and OregonDB files are initially cloned from the project's Mercurial repositories. To clone the OregonCore repository (core + db) run the following:

hg clone https://bitbucket.org/oregon/oregoncore

Building OregonCore

Make sure you have su'd to your oregon user, and are in the src directory! Finally, we're ready to build oregoncore. The following will perform the build using common configuration options.

cd oregoncore
mkdir build && cd build
cmake ../ -DPREFIX=$HOME -DTOOLS=1
make -j$((`nproc`+1)) # Use multiple cpus, this will speed up the process significant. $((`nproc`+1)) may not the best value.
make install -j$((`nproc`+1))

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.

Prepare the Database

In this section we will setup the mysql server (you will need to set a password while installing), create the necessary databases and import the content. We will also create for all mysql operations the user oregon with password oregon (see create_mysql.sql).

apt-get install mysql-server gzip
cd ../sql
mysql -u root -p < create_mysql.sql # Use mysql root password here! Create user oregon with password oregon and database: realmd, characters and world.

mysql -u oregon -p -h localhost realmd < realmd.sql # For the next actions we use user oregon with password oregon. Import data for realmd
mysql -u oregon -p -h localhost characters < characters.sql # Import data for characters
gunzip < oregon_database.zip | mysql -u oregon -p world # Import data for world (this may take a while)

Congratulations!

Keeping the code up to date

OregonCore 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.

To update the core source:

1. Go to the oregoncore source directory (ex: $HOME/src/oregoncore). 2. Pull the updates with hg pull, then apply them with hg update. 3. The source is now in sync with the repo and ready for a new build.

To update the database:

1. Go to the sql/updates directory 2. Pull the updates with hg pull, then apply them with hg update. 3. The new database files are now in place.