[Linux] Automatically building Mangos and producing Fedora RPMS menu

Shout-Out

User Tag List

Results 1 to 2 of 2
  1. #1
    Ryns's Avatar Member
    Reputation
    19
    Join Date
    Oct 2009
    Posts
    24
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Linux] Automatically building Mangos and producing Fedora RPMS

    Fed up of manually rebuilding Mangos? Look no further, follow these simple steps and you will have your very own Mangos-RPM-Producing-Machine!

    First, we need to make sure we have the necessary environment to build everything, as root run the following:

    Code:
    yum install gcc gcc-c++ autoconf automake bin-utils make rpmbuild libtool git zlib-devel mysql-devel
    Next, we need to create our "build_mangos.sh" build script, if you place this in "$HOME/bin" or "~/bin" then it will already be in your PATH for added convenience. This script will initially create, and later update the source tree from GIT, extract the revision number and feed that into the rpmbuild process. Such that Mangos revision 9406 will produce an RPM like e.g. mangos-9406-0.fc11.x86_64.rpm

    ~/bin/build_mangos.sh
    Code:
    #!/bin/bash
    
    echo "Checking if git has updated..."
    if [ ! -d mangos ]; then
       git clone git://github.com/mangos/mangos.git mangos
    fi
    cd mangos
    git pull
    REV=`grep 'REVISION_NR \"[0-9]*\"' src/shared/revision_nr.h | tr -d '"' | awk '{print $3}'`
    cd ..
    if [ -f mangos-${REV}.tar.gz ]; then
       echo " - no change!"
       exit
    fi
    
    echo "Preparing the source tarball..."
    cd mangos
    if [ -d build ]; then
       echo " - cleaning..."
       cd build
       make clean
       cd ..
       rm -Rf build
    fi
    echo " - configuring..."
    autoreconf --install --force
    mkdir build
    cd ..
    echo " - compressing..."
    tar -czf mangos-${REV}.tar.gz mangos
    
    # Prepare a dummy rpmbuild tree
    mkdir -p rpmbuild/SOURCES
    cp mangos-${REV}.tar.gz rpmbuild/SOURCES
    
    # Build
    rpmbuild -ba rpmbuild/SPECS/mangos.spec --define "REVISION $REV"
    You can manually call this script at any time, set it up as a daily cronjob, or integrate with something like Hudson.

    Now, we just need our RPM spec file.

    ~/rpmbuild/SPECS/mangos.spec
    Code:
    Name:           mangos
    Summary:        MaNGOS is a free, Open Source implementation of a game server compatible with the original World of Warcraft client.
    Version:        %REVISION
    Release:        0%{?dist}
    License:        GPLv2
    Group:          Games
    Source0:        %{name}-%{version}.tar.gz
    BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
    
    %description
    The MaNGOS project is a full featured World of Warcraft server suite, including servers for authentication, client updates, world content serving, and battlegrounds.  Additional features include tools to build and develop game content.  MaNGOS is an educational project.  This means, our primary interest is to learn and teach us and our users more about C++ project development in a large scale.  Our software is not intended for running public servers, and we do not support that.
    
    %prep
    %setup -q -n %{name}
    
    %build
    cd build
    ln -s ../configure configure
    %configure --with-mysql
    make %{?_smp_mflags}
    
    %install
    rm -rf %{buildroot}
    cd build
    make install DESTDIR=%{buildroot}
    
    %clean
    rm -rf %{buildroot}
    
    %files
    %defattr(-,root,root,-)
    %exclude %_bindir/genrevision
    %config %_sysconfdir/mangosd.conf.dist
    %config %_sysconfdir/realmd.conf.dist
    %_bindir/mangos-realmd
    %_bindir/mangos-worldd
    %_libdir/*
    %_datadir/mangos/*
    
    %changelog
    Run a test build "build_mangos.sh" and make sure everything succeeds, I have just tested this on two of my Fedora 11 machines and can confirm it works on i686 & x86_64 architectures just fine. Your successful RPM builds will appear in the ~/rpmbuild/RPMS subdirectories.

    [Linux] Automatically building Mangos and producing Fedora RPMS
  2. #2
    Le Froid's Avatar Contributor
    Reputation
    172
    Join Date
    Mar 2007
    Posts
    1,327
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Very impressive Ryns
    Btw for anyone on the latest fedora release DO NOT install libtoolize from the package manager. You have to download an old version like 1.5 ish and install it yourself to be able to compile mangos

Similar Threads

  1. Replies: 0
    Last Post: 01-09-2008, 10:41 PM
  2. Starter/Restarter for Mangos and Ascent
    By Sonic Waffle in forum WoW EMU Guides & Tutorials
    Replies: 0
    Last Post: 12-24-2007, 06:32 PM
  3. [World Building] 1st and 2nd Malkura island
    By Squabert in forum World of Warcraft Model Editing
    Replies: 19
    Last Post: 11-04-2007, 03:47 PM
  4. I need help with Building Mangos Acount Site
    By Veendijk in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 09-09-2007, 10:54 AM
  5. Mangos and Hamachi
    By Morlok in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 08-29-2007, 08:24 PM
All times are GMT -5. The time now is 06:23 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search