Packaging ioquake3 (Loki Setup)

From ioquake3 wiki
Jump to: navigation, search

To build the ioquake3 loki setup for Linux, you need to first install loki_setupdb and loki_setup. After loki_setup is installed, run 'make installer' from the main ioquak3 directory, output file will be in misc/setup/.

Loki Setup Install Script

Tested on Ubuntu 10.10 i386 and amd64. Save script as loki-setup.sh, make it executable, and run it using 'sudo sh loki-setup.sh'. After the script has finished change to the ioquake3 directory and run 'make installer'.

#!/bin/sh
# Author: Zack "ZTurtleMan" Middleton (Dec 28 2010)
# Description: Installs loki-setup to allow Turtle Arena and ioquake3 loki
#		installers to be built.
#
# If you have a x86_64 computer you should also run this script on a x86 computer.
# After it has been run on both, copy /usr/share/loki-setup/image/setup.data/bin
#   from the x86 computer to the x86_64 computer. You can use a virual machine.
# It seems like there should be a way to compile loki-setup for x86 on x86_64,
#   but I don't know how.
#

LOKISETUP=/usr/share/loki-setup # Value wanted by ioquake3 loki setup packaging
LOKISETUPDB=/usr/share/loki_setupdb

# Install needed packages
apt-get install subversion libxml2-dev libglade2-dev autoconf ncurses-dev libgpm-dev

# Download loki setup and loki setupdb, if not already done.
if [ ! -d $LOKISETUP ]
then
	svn export svn://svn.icculus.org/loki_setup/trunk $LOKISETUP
fi

if [ ! -d $LOKISETUPDB ]
then
	svn export svn://svn.icculus.org/loki_setupdb/trunk $LOKISETUPDB
fi

# Create link so loki setup db will compile
if [ ! -d /usr/include/libxml ]
then
	ln -s /usr/include/libxml2/libxml /usr/include/libxml
fi

# Setup loki setup db
cd $LOKISETUPDB
sh autogen.sh
sh configure

# Fix uninstalling on x86_64
# Internally setupdb.c uses x86_64, but the uninstall scripts it makes use amd64.
#	Causes script not to find uninstall executable.
# (Doesn't fix loki installers already made, to have old installers work add syslink
#	~/.loki/installed/bin/Linux/amd64 to ~/.loki/installed/bin/Linux/x86_64)
sed -i -e 's/amd64/x86_64/g' setupdb.c
# Now revert the one spot we want to be amd64
sed -i -e 's/x86_64 | x86_64)/amd64 | x86_64)/g' setupdb.c

make

# Setup loki setup
cd $LOKISETUP
sh autogen.sh

# Fix link error on x86_64
sed -i -e 's/-ltinfo//g' configure.in

sh configure --with-setupdb=$LOKISETUPDB --with-libxml2 --enable-gtk2

# Fix link error
sed -i -e 's/-lutil/-lutil -lgpm/g' Makefile

make
make install