Packaging ioquake3 (Loki Setup)

From ioquake3 wiki
Jump to navigation Jump to 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, make it executable, and run it using 'sudo sh'. After the script has finished change to the ioquake3 directory and run 'make installer'.

# 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/
#   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

# 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 ]
	svn export svn:// $LOKISETUP

if [ ! -d $LOKISETUPDB ]
	svn export svn:// $LOKISETUPDB

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

# Setup loki setup db
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


# Setup loki setup

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

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

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

make install