aboutsummaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authoralepulver <alepulver@FreeBSD.org>2006-06-08 06:42:16 +0800
committeralepulver <alepulver@FreeBSD.org>2006-06-08 06:42:16 +0800
commit3ffd5716742746af8f055b2609cd1aee8debb118 (patch)
tree457b52964584fa1b92323a5db7cd2a89b7097153 /games
parentddae2fccef5de88b9d39a75cf38581a9890fc304 (diff)
downloadfreebsd-ports-graphics-3ffd5716742746af8f055b2609cd1aee8debb118.tar.gz
freebsd-ports-graphics-3ffd5716742746af8f055b2609cd1aee8debb118.tar.zst
freebsd-ports-graphics-3ffd5716742746af8f055b2609cd1aee8debb118.zip
This project, icculus.org/quake3 (sometimes referred to ioquake3, or ioq3 for
short) aims to build upon id Software's Quake 3 source code release. The source code was released on August 20, 2005 under the GPL. Since then, we have been cleaning up, fixing bugs, and adding features. Our permanent goal is to create the open source Quake 3 distribution upon which people base their games and projects. We also seek to have the perfect version of the engine for playing Quake 3: Arena, Team Arena, and all popular mods. This distribution of the engine has been ported to many new platforms and has had a slew of new features added, along with massive bug extermination. WWW: http://icculus.org/quake3/
Diffstat (limited to 'games')
-rw-r--r--games/Makefile1
-rw-r--r--games/ioquake3/Makefile158
-rw-r--r--games/ioquake3/distinfo3
-rw-r--r--games/ioquake3/files/extra-patch-code__unix__unix_shared.c24
-rw-r--r--games/ioquake3/files/patch-Makefile316
-rw-r--r--games/ioquake3/files/patch-code__botlib__be_interface.c11
-rw-r--r--games/ioquake3/files/patch-code__qcommon__common.c10
-rw-r--r--games/ioquake3/files/patch-code__qcommon__q_platform.h15
-rw-r--r--games/ioquake3/files/patch-code__unix__linux_glimp.c19
-rw-r--r--games/ioquake3/files/patch-code__unix__unix_main.c31
-rw-r--r--games/ioquake3/pkg-descr11
-rw-r--r--games/ioquake3/pkg-plist12
-rw-r--r--games/iourbanterror/Makefile158
-rw-r--r--games/iourbanterror/distinfo3
-rw-r--r--games/iourbanterror/files/extra-patch-code__unix__unix_shared.c24
-rw-r--r--games/iourbanterror/files/patch-Makefile316
-rw-r--r--games/iourbanterror/files/patch-code__botlib__be_interface.c11
-rw-r--r--games/iourbanterror/files/patch-code__qcommon__common.c10
-rw-r--r--games/iourbanterror/files/patch-code__qcommon__q_platform.h15
-rw-r--r--games/iourbanterror/files/patch-code__unix__linux_glimp.c19
-rw-r--r--games/iourbanterror/files/patch-code__unix__unix_main.c31
-rw-r--r--games/iourbanterror/pkg-descr11
-rw-r--r--games/iourbanterror/pkg-plist12
23 files changed, 1221 insertions, 0 deletions
diff --git a/games/Makefile b/games/Makefile
index ef06f09c59f..67c73d4a237 100644
--- a/games/Makefile
+++ b/games/Makefile
@@ -315,6 +315,7 @@
SUBDIR += imaze
SUBDIR += inform
SUBDIR += interlogic
+ SUBDIR += ioquake3
SUBDIR += ishido
SUBDIR += ivan
SUBDIR += jchessboard
diff --git a/games/ioquake3/Makefile b/games/ioquake3/Makefile
new file mode 100644
index 00000000000..a89be3f852a
--- /dev/null
+++ b/games/ioquake3/Makefile
@@ -0,0 +1,158 @@
+# New ports collection makefile for: ioquake3
+# Date created: 3 Jun 2006
+# Whom: alepulver
+#
+# $FreeBSD$
+#
+
+PORTNAME= ioquake3
+PORTVERSION= 1.33
+CATEGORIES= games
+MASTER_SITES= ${MASTER_SITE_LOCAL}
+MASTER_SITE_SUBDIR= alepulver
+
+MAINTAINER= alepulver@FreeBSD.org
+COMMENT= Cleaned-up and enhaced version of Quake 3
+
+USE_BZIP2= yes
+USE_GCC= 3.2+
+USE_GMAKE= yes
+WRKSRC= ${WRKDIR}/quake3
+
+OPTIONS= CLIENT "Build client" on \
+ GAMELIBS "Build game libraries (when not mandatory)" off \
+ DEDICATED "Build dedicated server" on \
+ OPENAL "Enable OpenAL (3D sound) support" off \
+ OPENAL_DLOPEN "Enable dynamic loading of OpenAL" off \
+ OPTIMIZED_CFLAGS "Enable compilation optimizations" on \
+ SDL_AUDIO "Use SDL for audio" off \
+ SDL_VIDEO "Use SDL for video" off \
+ SMP "Build SMP (threaded) client" on \
+ VORBIS "Enable Ogg Vorbis codec support" off
+
+MAKE_ENV+= DEFAULT_BASEDIR="${Q3DIR}" LIBDIR="${LIBDIR}" \
+ PTHREAD_LIBS="${PTHREAD_LIBS}"
+PLIST_SUB= LIBDIR="${LIBDIR:S/${PREFIX}\///}"
+
+LIBDIR= ${PREFIX}/lib/${PORTNAME}
+SVN_REV= 777
+VM_ARCHS= amd64 i386 powerpc
+
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} < 500000
+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-code__unix__unix_shared.c
+.endif
+
+.if defined(WITHOUT_CLIENT) && defined(WITHOUT_DEDICATED) && \
+ defined(WITHOUT_SMP)
+IGNORE= needs at least one of CLIENT, DEDICATED and SMP options
+.endif
+
+.for i in ${ARCH}
+. if ${VM_ARCHS:M${i}} != ""
+HAVE_VM_COMPILED= yes
+. endif
+.endfor
+
+.if defined(HAVE_VM_COMPILED)
+MAKE_ENV+= HAVE_VM_COMPILED=true
+.endif
+
+.if !defined(WITHOUT_CLIENT) || !defined(WITHOUT_SMP)
+# OpenAL
+. if defined(WITH_OPENAL)
+LIB_DEPENDS+= openal.0:${PORTSDIR}/audio/openal
+MAKE_ENV+= USE_OPENAL=1
+. if defined(WITH_OPENAL_DLOPEN)
+MAKE_ENV+= USE_OPENAL_DLOPEN=1
+. endif
+. endif
+# SDL
+. if defined(WITH_SDL_AUDIO)
+USE_SDL= sdl
+MAKE_ENV+= USE_SDL_AUDIO=1
+. endif
+. if defined(WITH_SDL_VIDEO)
+USE_SDL= sdl
+MAKE_ENV+= USE_SDL_VIDEO=1
+. else
+USE_GL= yes
+. endif
+# Vorbis
+. if defined(WITH_VORBIS)
+LIB_DEPENDS+= vorbis.3:${PORTSDIR}/audio/libvorbis
+MAKE_ENV+= USE_CODEC_VORBIS=1
+. endif
+.endif
+
+.if !defined(WITHOUT_CLIENT)
+MAKE_ENV+= BUILD_CLIENT=1
+PLIST_SUB+= CLIENT=""
+Q3BIN+= ioquake3
+.else
+PLIST_SUB+= CLIENT="@comment "
+.endif
+
+.if !defined(WITHOUT_DEDICATED)
+MAKE_ENV+= BUILD_SERVER=1
+PLIST_SUB+= DEDICATED=""
+Q3BIN+= ioq3ded
+.else
+PLIST_SUB+= DEDICATED="@comment "
+.endif
+
+.if defined(WITH_GAMELIBS) || !defined(HAVE_VM_COMPILED)
+MAKE_ENV+= BUILD_GAME_SO=1
+PLIST_SUB+= GAMELIBS=""
+.else
+PLIST_SUB+= GAMELIBS="@comment "
+.endif
+
+.if !defined(WITHOUT_OPTIMIZED_CFLAGS)
+MAKE_ENV+= USE_OPTIMIZED_CFLAGS=1
+.endif
+
+.if !defined(WITHOUT_SMP)
+MAKE_ENV+= BUILD_CLIENT_SMP=1
+PLIST_SUB+= SMP=""
+Q3BIN+= ioquake3-smp
+.else
+PLIST_SUB+= SMP="@comment "
+.endif
+
+.if ${OSVERSION} < 500000
+post-patch:
+ @${REINPLACE_CMD} -e 's|stdint\.h|inttypes.h|' \
+ ${BUILD_WRKSRC}/code/qcommon/q_shared.h
+.endif
+
+do-install:
+.for bin in ${Q3BIN}
+ ${INSTALL_PROGRAM} ${WRKSRC}/build/release/${bin} ${PREFIX}/bin
+.endfor
+.if defined(WITH_GAMELIBS) || !defined(HAVE_VM_COMPILED)
+.for dir in baseq3 missionpack
+ ${MKDIR} ${LIBDIR}/${dir}
+ ${INSTALL_PROGRAM} ${WRKSRC}/build/release/${dir}/*.so ${LIBDIR}/${dir}
+.endfor
+.endif
+
+post-install:
+.if defined(WITH_SDL_AUDIO) || defined(WITH_OPENAL)
+ @${ECHO_CMD}
+ @${ECHO_CMD} "WARNING: if you have sound problems try recompiling without SDL_AUDIO and OPENAL options." | ${FMT}
+ @${ECHO_CMD}
+.endif
+
+maint-gen-distfile:
+ @if [ -f ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX} ]; then \
+ ${ECHO_CMD} "ERROR: the distfile already exists."; \
+ ${FALSE}; \
+ fi
+ svn export -r${SVN_REV} svn://svn.icculus.org/quake3/trunk quake3
+ ${TAR} jcf ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX} quake3
+ ${RM} -rf quake3
+
+.include "${.CURDIR}/../quake3-data/Makefile.include"
+.include <bsd.port.post.mk>
diff --git a/games/ioquake3/distinfo b/games/ioquake3/distinfo
new file mode 100644
index 00000000000..17bc6407080
--- /dev/null
+++ b/games/ioquake3/distinfo
@@ -0,0 +1,3 @@
+MD5 (ioquake3-1.33.tar.bz2) = 0eaf6eb252e6b56d1195faf2d898c533
+SHA256 (ioquake3-1.33.tar.bz2) = 9e9b7f4d7b39eb82c8b1de9dc0ce62d0eed4d676d21e1adfb4930832c5123abb
+SIZE (ioquake3-1.33.tar.bz2) = 2421997
diff --git a/games/ioquake3/files/extra-patch-code__unix__unix_shared.c b/games/ioquake3/files/extra-patch-code__unix__unix_shared.c
new file mode 100644
index 00000000000..a0860384c25
--- /dev/null
+++ b/games/ioquake3/files/extra-patch-code__unix__unix_shared.c
@@ -0,0 +1,24 @@
+--- ./code/unix/unix_shared.c.orig Fri Nov 4 19:32:00 2005
++++ ./code/unix/unix_shared.c Wed Jun 7 16:52:01 2006
+@@ -20,6 +20,7 @@
+ ===========================================================================
+ */
+ #include <sys/types.h>
++#include <sys/sysctl.h>
+ #include <sys/stat.h>
+ #include <errno.h>
+ #include <stdio.h>
+@@ -430,6 +431,12 @@
+ // sysconf() in libc, POSIX.1 compliant
+ unsigned int Sys_ProcessorCount(void)
+ {
+- return sysconf(_SC_NPROCESSORS_ONLN);
++ int mib[2], value, len;
++
++ mib[0] = CTL_HW;
++ mib[1] = HW_NCPU;
++ len = sizeof(value);
++ sysctl(mib, 2, &value, &len, NULL, 0);
++ return (value);
+ }
+ #endif
diff --git a/games/ioquake3/files/patch-Makefile b/games/ioquake3/files/patch-Makefile
new file mode 100644
index 00000000000..4830ebf9300
--- /dev/null
+++ b/games/ioquake3/files/patch-Makefile
@@ -0,0 +1,316 @@
+--- ./Makefile.orig Sat Apr 29 16:54:54 2006
++++ ./Makefile Wed Jun 7 19:34:25 2006
+@@ -26,11 +26,19 @@
+ endif
+ endif
+
+-BUILD_CLIENT =
+-BUILD_CLIENT_SMP =
+-BUILD_SERVER =
+-BUILD_GAME_SO =
+-BUILD_GAME_QVM =
++BUILD_CLIENT?=0
++BUILD_CLIENT_SMP?=0
++BUILD_GAME_QVM?=0
++BUILD_GAME_SO?=0
++BUILD_SERVER?=0
++HAVE_VM_COMPILED?=false
++USE_CODEC_VORBIS?=0
++USE_LOCAL_HEADERS?=0
++USE_OPENAL?=0
++USE_OPENAL_DLOPEN?=0
++USE_OPTIMIZED_CFLAGS?=0
++USE_SDL_AUDIO?=0
++USE_SDL_VIDEO?=0
+
+ #############################################################################
+ #
+@@ -88,30 +96,10 @@
+ endif
+ export USE_CCACHE
+
+-ifndef USE_SDL
+-USE_SDL=1
+-endif
+-
+-ifndef USE_OPENAL
+-USE_OPENAL=1
+-endif
+-
+-ifndef USE_OPENAL_DLOPEN
+-USE_OPENAL_DLOPEN=0
+-endif
+-
+-ifndef USE_CODEC_VORBIS
+-USE_CODEC_VORBIS=0
+-endif
+-
+-ifndef USE_LOCAL_HEADERS
+-USE_LOCAL_HEADERS=1
+-endif
+-
+ #############################################################################
+
+ BD=$(BUILD_DIR)/debug-$(PLATFORM)-$(ARCH)
+-BR=$(BUILD_DIR)/release-$(PLATFORM)-$(ARCH)
++BR=$(BUILD_DIR)/release
+ CDIR=$(MOUNT_DIR)/client
+ SDIR=$(MOUNT_DIR)/server
+ RDIR=$(MOUNT_DIR)/renderer
+@@ -407,18 +395,12 @@
+
+ ifeq ($(PLATFORM),freebsd)
+
+- ifneq (,$(findstring alpha,$(shell uname -m)))
+- ARCH=axp
+- else #default to i386
+- ARCH=i386
+- endif #alpha test
+-
+-
+- BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes
++ BASE_CFLAGS = -DARCH='\"$(ARCH)\"' -DLIBDIR='\"$(LIBDIR)\"' -I$(LOCALBASE)/include -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes
+
+- GL_CFLAGS = -I/usr/X11R6/include
++ GL_CFLAGS = -I$(X11BASE)/include
+
+ DEBUG_CFLAGS=$(BASE_CFLAGS) -g
++ RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -pipe
+
+ ifeq ($(USE_OPENAL),1)
+ BASE_CFLAGS += -DUSE_OPENAL=1
+@@ -431,46 +413,61 @@
+ BASE_CFLAGS += -DUSE_CODEC_VORBIS=1
+ endif
+
+- ifeq ($(USE_SDL),1)
+- BASE_CFLAGS += $(shell sdl11-config --cflags) -DUSE_SDL_VIDEO=1 -DUSE_SDL_SOUND=1
++ ifeq ($(USE_SDL_AUDIO),1)
++ BASE_CFLAGS += $(shell $(SDL_CONFIG) --cflags)
++ else
++ ifeq ($(USE_SDL_VIDEO),1)
++ BASE_CFLAGS += $(shell $(SDL_CONFIG) --cflags)
++ endif
+ endif
+
+- ifeq ($(ARCH),axp)
+- CC=gcc
+- BASE_CFLAGS += -DNO_VM_COMPILED
+- RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O3 -ffast-math -funroll-loops \
+- -fomit-frame-pointer -fexpensive-optimizations
+- else
+- ifeq ($(ARCH),i386)
+- CC=gcc
+- RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O3 -mtune=pentiumpro \
+- -march=pentium -fomit-frame-pointer -pipe -ffast-math \
+- -falign-loops=2 -falign-jumps=2 -falign-functions=2 \
+- -funroll-loops -fstrength-reduce
+- else
+- BASE_CFLAGS += -DNO_VM_COMPILED
++ ifeq ($(USE_SDL_AUDIO),1)
++ BASE_CFLAGS += -DUSE_SDL_SOUND=1
+ endif
++
++ ifeq ($(USE_SDL_VIDEO),1)
++ BASE_CFLAGS += -DUSE_SDL_VIDEO=1
++ endif
++
++ ifeq ($(USE_OPTIMIZED_CFLAGS),1)
++ RELEASE_CFLAGS+=-O3 -ffast-math -funroll-loops -fomit-frame-pointer \
++ -fexpensive-optimizations
++ ifeq ($(ARCH),i386)
++ RELEASE_CFLAGS+=-falign-loops=2 -falign-jumps=2 -falign-functions=2 \
++ -fstrength-reduce
++ endif
++ endif
++
++ ifneq ($(HAVE_VM_COMPILED),true)
++ BASE_CFLAGS += -DNO_VM_COMPILED
+ endif
+
+ SHLIBEXT=so
+ SHLIBCFLAGS=-fPIC
+ SHLIBLDFLAGS=-shared $(LDFLAGS)
+
+- THREAD_LDFLAGS=-lpthread
++ THREAD_LDFLAGS=$(PTHREAD_LIBS)
+ # don't need -ldl (FreeBSD)
+- LDFLAGS=-lm
++ LDFLAGS+=-lm
+
+- CLIENT_LDFLAGS =
++ CLIENT_LDFLAGS = -L$(LOCALBASE)/lib
+
+- ifeq ($(USE_SDL),1)
+- CLIENT_LDFLAGS += $(shell sdl11-config --libs)
++ ifeq ($(USE_SDL_AUDIO),1)
++ CLIENT_LDFLAGS += $(shell $(SDL_CONFIG) --libs)
+ else
+- CLIENT_LDFLAGS += -L/usr/X11R6/$(LIB) -lGL -lX11 -lXext -lXxf86dga -lXxf86vm
++ ifeq ($(USE_SDL_VIDEO),1)
++ CLIENT_LDFLAGS += $(shell $(SDL_CONFIG) --libs)
++ endif
++ endif
++
++ ifneq ($(USE_SDL_VIDEO),1)
++ CLIENT_LDFLAGS += -L$(X11BASE)/lib -lGL -lX11 -lXext -lXxf86dga -lXxf86vm
+ endif
+
+ ifeq ($(USE_OPENAL),1)
++ CLIENT_LDFLAGS += $(THREAD_LDFLAGS)
+ ifneq ($(USE_OPENAL_DLOPEN),1)
+- CLIENT_LDFLAGS += $(THREAD_LDFLAGS) -lopenal
++ CLIENT_LDFLAGS += -lopenal
+ endif
+ endif
+
+@@ -632,24 +629,24 @@
+ TARGETS =
+
+ ifneq ($(BUILD_SERVER),0)
+- TARGETS += $(B)/ioq3ded.$(ARCH)$(BINEXT)
++ TARGETS += $(B)/ioq3ded$(BINEXT)
+ endif
+
+ ifneq ($(BUILD_CLIENT),0)
+- TARGETS += $(B)/ioquake3.$(ARCH)$(BINEXT)
++ TARGETS += $(B)/ioquake3$(BINEXT)
+ ifneq ($(BUILD_CLIENT_SMP),0)
+- TARGETS += $(B)/ioquake3-smp.$(ARCH)$(BINEXT)
++ TARGETS += $(B)/ioquake3-smp$(BINEXT)
+ endif
+ endif
+
+ ifneq ($(BUILD_GAME_SO),0)
+ TARGETS += \
+- $(B)/baseq3/cgame$(ARCH).$(SHLIBEXT) \
+- $(B)/baseq3/qagame$(ARCH).$(SHLIBEXT) \
+- $(B)/baseq3/ui$(ARCH).$(SHLIBEXT) \
+- $(B)/missionpack/cgame$(ARCH).$(SHLIBEXT) \
+- $(B)/missionpack/qagame$(ARCH).$(SHLIBEXT) \
+- $(B)/missionpack/ui$(ARCH).$(SHLIBEXT)
++ $(B)/baseq3/cgame.$(SHLIBEXT) \
++ $(B)/baseq3/qagame.$(SHLIBEXT) \
++ $(B)/baseq3/ui.$(SHLIBEXT) \
++ $(B)/missionpack/cgame.$(SHLIBEXT) \
++ $(B)/missionpack/qagame.$(SHLIBEXT) \
++ $(B)/missionpack/ui.$(SHLIBEXT)
+ endif
+
+ ifneq ($(BUILD_GAME_QVM),0)
+@@ -707,11 +704,11 @@
+ $(MAKE) targets B=$(BD) CFLAGS="$(CFLAGS) $(DEBUG_CFLAGS) $(DEPEND_CFLAGS)"
+
+ build_release: B=$(BR)
+-build_release: makedirs tools
++build_release: makedirs
+ $(MAKE) targets B=$(BR) CFLAGS="$(CFLAGS) $(RELEASE_CFLAGS) $(DEPEND_CFLAGS)"
+
+ #Build both debug and release builds
+-all:build_debug build_release
++all:build_release
+
+ targets: $(TARGETS)
+
+@@ -919,11 +916,11 @@
+ $(B)/client/ftola.o \
+ $(B)/client/snapvectora.o
+ endif
+-ifeq ($(ARCH),x86_64)
++ifeq ($(ARCH),amd64)
+ Q3OBJ += $(B)/client/vm_x86_64.o
+ endif
+
+-ifeq ($(ARCH),ppc)
++ifeq ($(ARCH),powerpc)
+ ifneq ($(VM_PPC),)
+ Q3OBJ += $(B)/client/$(VM_PPC).o
+ endif
+@@ -971,10 +968,10 @@
+ $(B)/client/sdl_glimp_smp.o
+ endif
+
+-$(B)/ioquake3.$(ARCH)$(BINEXT): $(Q3OBJ) $(Q3POBJ) $(LIBSDLMAIN)
++$(B)/ioquake3$(BINEXT): $(Q3OBJ) $(Q3POBJ) $(LIBSDLMAIN)
+ $(CC) -o $@ $(Q3OBJ) $(Q3POBJ) $(CLIENT_LDFLAGS) $(LDFLAGS) $(LIBSDLMAIN)
+
+-$(B)/ioquake3-smp.$(ARCH)$(BINEXT): $(Q3OBJ) $(Q3POBJ_SMP) $(LIBSDLMAIN)
++$(B)/ioquake3-smp$(BINEXT): $(Q3OBJ) $(Q3POBJ_SMP) $(LIBSDLMAIN)
+ $(CC) -o $@ $(Q3OBJ) $(Q3POBJ_SMP) $(CLIENT_LDFLAGS) \
+ $(THREAD_LDFLAGS) $(LDFLAGS) $(LIBSDLMAIN)
+
+@@ -1253,17 +1250,17 @@
+ $(B)/ded/snapvectora.o $(B)/ded/matha.o
+ endif
+
+-ifeq ($(ARCH),x86_64)
++ifeq ($(ARCH),amd64)
+ Q3DOBJ += $(B)/ded/vm_x86_64.o
+ endif
+
+-ifeq ($(ARCH),ppc)
++ifeq ($(ARCH),powerpc)
+ ifneq ($(VM_PPC),)
+ Q3DOBJ += $(B)/ded/$(VM_PPC).o
+ endif
+ endif
+
+-$(B)/ioq3ded.$(ARCH)$(BINEXT): $(Q3DOBJ)
++$(B)/ioq3ded$(BINEXT): $(Q3DOBJ)
+ $(CC) -o $@ $(Q3DOBJ) $(LDFLAGS)
+
+ $(B)/ded/sv_bot.o : $(SDIR)/sv_bot.c; $(DO_DED_CC)
+@@ -1377,7 +1374,7 @@
+ Q3CGOBJ = $(Q3CGOBJ_) $(B)/baseq3/cgame/cg_syscalls.o
+ Q3CGVMOBJ = $(Q3CGOBJ_:%.o=%.asm) $(B)/baseq3/game/bg_lib.asm
+
+-$(B)/baseq3/cgame$(ARCH).$(SHLIBEXT) : $(Q3CGOBJ)
++$(B)/baseq3/cgame.$(SHLIBEXT) : $(Q3CGOBJ)
+ $(CC) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ)
+
+ $(B)/baseq3/vm/cgame.qvm: $(Q3CGVMOBJ) $(CGDIR)/cg_syscalls.asm
+@@ -1418,7 +1415,7 @@
+ MPCGOBJ = $(MPCGOBJ_) $(B)/missionpack/cgame/cg_syscalls.o
+ MPCGVMOBJ = $(MPCGOBJ_:%.o=%.asm) $(B)/missionpack/game/bg_lib.asm
+
+-$(B)/missionpack/cgame$(ARCH).$(SHLIBEXT) : $(MPCGOBJ)
++$(B)/missionpack/cgame.$(SHLIBEXT) : $(MPCGOBJ)
+ $(CC) $(SHLIBLDFLAGS) -o $@ $(MPCGOBJ)
+
+ $(B)/missionpack/vm/cgame.qvm: $(MPCGVMOBJ) $(CGDIR)/cg_syscalls.asm
+@@ -1468,7 +1465,7 @@
+ Q3GOBJ = $(Q3GOBJ_) $(B)/baseq3/game/g_syscalls.o
+ Q3GVMOBJ = $(Q3GOBJ_:%.o=%.asm) $(B)/baseq3/game/bg_lib.asm
+
+-$(B)/baseq3/qagame$(ARCH).$(SHLIBEXT) : $(Q3GOBJ)
++$(B)/baseq3/qagame.$(SHLIBEXT) : $(Q3GOBJ)
+ $(CC) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ)
+
+ $(B)/baseq3/vm/qagame.qvm: $(Q3GVMOBJ) $(GDIR)/g_syscalls.asm
+@@ -1516,7 +1513,7 @@
+ MPGOBJ = $(MPGOBJ_) $(B)/missionpack/game/g_syscalls.o
+ MPGVMOBJ = $(MPGOBJ_:%.o=%.asm) $(B)/missionpack/game/bg_lib.asm
+
+-$(B)/missionpack/qagame$(ARCH).$(SHLIBEXT) : $(MPGOBJ)
++$(B)/missionpack/qagame.$(SHLIBEXT) : $(MPGOBJ)
+ $(CC) $(SHLIBLDFLAGS) -o $@ $(MPGOBJ)
+
+ $(B)/missionpack/vm/qagame.qvm: $(MPGVMOBJ) $(GDIR)/g_syscalls.asm
+@@ -1576,7 +1573,7 @@
+ Q3UIOBJ = $(Q3UIOBJ_) $(B)/missionpack/ui/ui_syscalls.o
+ Q3UIVMOBJ = $(Q3UIOBJ_:%.o=%.asm) $(B)/baseq3/game/bg_lib.asm
+
+-$(B)/baseq3/ui$(ARCH).$(SHLIBEXT) : $(Q3UIOBJ)
++$(B)/baseq3/ui.$(SHLIBEXT) : $(Q3UIOBJ)
+ $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ)
+
+ $(B)/baseq3/vm/ui.qvm: $(Q3UIVMOBJ) $(UIDIR)/ui_syscalls.asm
+@@ -1601,7 +1598,7 @@
+ MPUIOBJ = $(MPUIOBJ_) $(B)/missionpack/ui/ui_syscalls.o
+ MPUIVMOBJ = $(MPUIOBJ_:%.o=%.asm) $(B)/baseq3/game/bg_lib.asm
+
+-$(B)/missionpack/ui$(ARCH).$(SHLIBEXT) : $(MPUIOBJ)
++$(B)/missionpack/ui.$(SHLIBEXT) : $(MPUIOBJ)
+ $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(MPUIOBJ)
+
+ $(B)/missionpack/vm/ui.qvm: $(MPUIVMOBJ) $(UIDIR)/ui_syscalls.asm
diff --git a/games/ioquake3/files/patch-code__botlib__be_interface.c b/games/ioquake3/files/patch-code__botlib__be_interface.c
new file mode 100644
index 00000000000..dd57f36a808
--- /dev/null
+++ b/games/ioquake3/files/patch-code__botlib__be_interface.c
@@ -0,0 +1,11 @@
+--- ./code/botlib/be_interface.c.orig Wed Apr 26 10:36:58 2006
++++ ./code/botlib/be_interface.c Wed Jun 7 19:34:25 2006
+@@ -155,7 +155,7 @@
+ } else {
+ Com_sprintf(logfilename, sizeof(logfilename), "botlib.log");
+ }
+- Log_Open(logfilename);
++ Log_Open("/dev/null");
+ //
+ botimport.Print(PRT_MESSAGE, "------- BotLib Initialization -------\n");
+ //
diff --git a/games/ioquake3/files/patch-code__qcommon__common.c b/games/ioquake3/files/patch-code__qcommon__common.c
new file mode 100644
index 00000000000..c1fdcacdd58
--- /dev/null
+++ b/games/ioquake3/files/patch-code__qcommon__common.c
@@ -0,0 +1,10 @@
+--- ./code/qcommon/common.c.orig Wed Apr 26 08:27:12 2006
++++ ./code/qcommon/common.c Wed Jun 7 19:34:25 2006
+@@ -25,6 +25,7 @@
+ #include "qcommon.h"
+ #include <setjmp.h>
+ #ifndef _WIN32
++#include <sys/types.h>
+ #include <netinet/in.h>
+ #include <sys/stat.h> // umask
+ #else
diff --git a/games/ioquake3/files/patch-code__qcommon__q_platform.h b/games/ioquake3/files/patch-code__qcommon__q_platform.h
new file mode 100644
index 00000000000..c65c0b6f370
--- /dev/null
+++ b/games/ioquake3/files/patch-code__qcommon__q_platform.h
@@ -0,0 +1,15 @@
+--- ./code/qcommon/q_platform.h.orig Tue Dec 27 16:46:01 2005
++++ ./code/qcommon/q_platform.h Wed Jun 7 19:35:23 2006
+@@ -176,11 +176,7 @@
+ #define ID_INLINE inline
+ #define PATH_SEP '/'
+
+-#ifdef __i386__
+-#define ARCH_STRING "i386"
+-#elif defined __axp__
+-#define ARCH_STRING "alpha"
+-#endif
++#define ARCH_STRING ARCH
+
+ #if BYTE_ORDER == BIG_ENDIAN
+ #define Q3_BIG_ENDIAN
diff --git a/games/ioquake3/files/patch-code__unix__linux_glimp.c b/games/ioquake3/files/patch-code__unix__linux_glimp.c
new file mode 100644
index 00000000000..987afc280e7
--- /dev/null
+++ b/games/ioquake3/files/patch-code__unix__linux_glimp.c
@@ -0,0 +1,19 @@
+--- ./code/unix/linux_glimp.c.orig Sun Apr 30 11:32:56 2006
++++ ./code/unix/linux_glimp.c Wed Jun 7 19:34:25 2006
+@@ -631,8 +631,14 @@
+
+ dx = ((int)event.xmotion.x - mwx);
+ dy = ((int)event.xmotion.y - mwy);
+- mx += dx;
+- my += dy;
++ if (abs(dx) > 1)
++ mx += dx * 2;
++ else
++ mx += dx;
++ if (abs(dy) > 1)
++ my += dy * 2;
++ else
++ my += dy;
+
+ mwx = event.xmotion.x;
+ mwy = event.xmotion.y;
diff --git a/games/ioquake3/files/patch-code__unix__unix_main.c b/games/ioquake3/files/patch-code__unix__unix_main.c
new file mode 100644
index 00000000000..cd61c56a765
--- /dev/null
+++ b/games/ioquake3/files/patch-code__unix__unix_main.c
@@ -0,0 +1,31 @@
+--- ./code/unix/unix_main.c.orig Sun Feb 26 18:22:12 2006
++++ ./code/unix/unix_main.c Wed Jun 7 19:34:25 2006
+@@ -774,6 +774,7 @@
+ char curpath[MAX_OSPATH];
+ char fname[MAX_OSPATH];
+ char *basepath;
++ char *libpath;
+ char *homepath;
+ char *pwdpath;
+ char *cdpath;
+@@ -789,14 +790,19 @@
+ // TODO: use fs_searchpaths from files.c
+ pwdpath = Sys_Cwd();
+ basepath = Cvar_VariableString( "fs_basepath" );
++ libpath = LIBDIR;
+ homepath = Cvar_VariableString( "fs_homepath" );
+ cdpath = Cvar_VariableString( "fs_cdpath" );
+ gamedir = Cvar_VariableString( "fs_game" );
+
+- libHandle = try_dlopen(pwdpath, gamedir, fname, fqpath);
++ if(!libHandle && homepath)
++ libHandle = try_dlopen(pwdpath, gamedir, fname, fqpath);
+
+ if(!libHandle && homepath)
+ libHandle = try_dlopen(homepath, gamedir, fname, fqpath);
++
++ if(!libHandle && basepath)
++ libHandle = try_dlopen(libpath, gamedir, fname, fqpath);
+
+ if(!libHandle && basepath)
+ libHandle = try_dlopen(basepath, gamedir, fname, fqpath);
diff --git a/games/ioquake3/pkg-descr b/games/ioquake3/pkg-descr
new file mode 100644
index 00000000000..6bb3f4006f4
--- /dev/null
+++ b/games/ioquake3/pkg-descr
@@ -0,0 +1,11 @@
+This project, icculus.org/quake3 (sometimes referred to ioquake3, or ioq3 for
+short) aims to build upon id Software's Quake 3 source code release. The
+source code was released on August 20, 2005 under the GPL. Since then, we have
+been cleaning up, fixing bugs, and adding features. Our permanent goal is to
+create the open source Quake 3 distribution upon which people base their games
+and projects. We also seek to have the perfect version of the engine for
+playing Quake 3: Arena, Team Arena, and all popular mods. This distribution of
+the engine has been ported to many new platforms and has had a slew of new
+features added, along with massive bug extermination.
+
+WWW: http://icculus.org/quake3/
diff --git a/games/ioquake3/pkg-plist b/games/ioquake3/pkg-plist
new file mode 100644
index 00000000000..a2fb5a77eb6
--- /dev/null
+++ b/games/ioquake3/pkg-plist
@@ -0,0 +1,12 @@
+%%DEDICATED%%bin/ioq3ded
+%%CLIENT%%bin/ioquake3
+%%SMP%%bin/ioquake3-smp
+%%GAMELIBS%%%%LIBDIR%%/baseq3/cgame.so
+%%GAMELIBS%%%%LIBDIR%%/baseq3/qagame.so
+%%GAMELIBS%%%%LIBDIR%%/baseq3/ui.so
+%%GAMELIBS%%%%LIBDIR%%/missionpack/cgame.so
+%%GAMELIBS%%%%LIBDIR%%/missionpack/qagame.so
+%%GAMELIBS%%%%LIBDIR%%/missionpack/ui.so
+%%GAMELIBS%%@dirrm %%LIBDIR%%/missionpack
+%%GAMELIBS%%@dirrm %%LIBDIR%%/baseq3
+%%GAMELIBS%%@dirrm %%LIBDIR%%
diff --git a/games/iourbanterror/Makefile b/games/iourbanterror/Makefile
new file mode 100644
index 00000000000..a89be3f852a
--- /dev/null
+++ b/games/iourbanterror/Makefile
@@ -0,0 +1,158 @@
+# New ports collection makefile for: ioquake3
+# Date created: 3 Jun 2006
+# Whom: alepulver
+#
+# $FreeBSD$
+#
+
+PORTNAME= ioquake3
+PORTVERSION= 1.33
+CATEGORIES= games
+MASTER_SITES= ${MASTER_SITE_LOCAL}
+MASTER_SITE_SUBDIR= alepulver
+
+MAINTAINER= alepulver@FreeBSD.org
+COMMENT= Cleaned-up and enhaced version of Quake 3
+
+USE_BZIP2= yes
+USE_GCC= 3.2+
+USE_GMAKE= yes
+WRKSRC= ${WRKDIR}/quake3
+
+OPTIONS= CLIENT "Build client" on \
+ GAMELIBS "Build game libraries (when not mandatory)" off \
+ DEDICATED "Build dedicated server" on \
+ OPENAL "Enable OpenAL (3D sound) support" off \
+ OPENAL_DLOPEN "Enable dynamic loading of OpenAL" off \
+ OPTIMIZED_CFLAGS "Enable compilation optimizations" on \
+ SDL_AUDIO "Use SDL for audio" off \
+ SDL_VIDEO "Use SDL for video" off \
+ SMP "Build SMP (threaded) client" on \
+ VORBIS "Enable Ogg Vorbis codec support" off
+
+MAKE_ENV+= DEFAULT_BASEDIR="${Q3DIR}" LIBDIR="${LIBDIR}" \
+ PTHREAD_LIBS="${PTHREAD_LIBS}"
+PLIST_SUB= LIBDIR="${LIBDIR:S/${PREFIX}\///}"
+
+LIBDIR= ${PREFIX}/lib/${PORTNAME}
+SVN_REV= 777
+VM_ARCHS= amd64 i386 powerpc
+
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} < 500000
+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-code__unix__unix_shared.c
+.endif
+
+.if defined(WITHOUT_CLIENT) && defined(WITHOUT_DEDICATED) && \
+ defined(WITHOUT_SMP)
+IGNORE= needs at least one of CLIENT, DEDICATED and SMP options
+.endif
+
+.for i in ${ARCH}
+. if ${VM_ARCHS:M${i}} != ""
+HAVE_VM_COMPILED= yes
+. endif
+.endfor
+
+.if defined(HAVE_VM_COMPILED)
+MAKE_ENV+= HAVE_VM_COMPILED=true
+.endif
+
+.if !defined(WITHOUT_CLIENT) || !defined(WITHOUT_SMP)
+# OpenAL
+. if defined(WITH_OPENAL)
+LIB_DEPENDS+= openal.0:${PORTSDIR}/audio/openal
+MAKE_ENV+= USE_OPENAL=1
+. if defined(WITH_OPENAL_DLOPEN)
+MAKE_ENV+= USE_OPENAL_DLOPEN=1
+. endif
+. endif
+# SDL
+. if defined(WITH_SDL_AUDIO)
+USE_SDL= sdl
+MAKE_ENV+= USE_SDL_AUDIO=1
+. endif
+. if defined(WITH_SDL_VIDEO)
+USE_SDL= sdl
+MAKE_ENV+= USE_SDL_VIDEO=1
+. else
+USE_GL= yes
+. endif
+# Vorbis
+. if defined(WITH_VORBIS)
+LIB_DEPENDS+= vorbis.3:${PORTSDIR}/audio/libvorbis
+MAKE_ENV+= USE_CODEC_VORBIS=1
+. endif
+.endif
+
+.if !defined(WITHOUT_CLIENT)
+MAKE_ENV+= BUILD_CLIENT=1
+PLIST_SUB+= CLIENT=""
+Q3BIN+= ioquake3
+.else
+PLIST_SUB+= CLIENT="@comment "
+.endif
+
+.if !defined(WITHOUT_DEDICATED)
+MAKE_ENV+= BUILD_SERVER=1
+PLIST_SUB+= DEDICATED=""
+Q3BIN+= ioq3ded
+.else
+PLIST_SUB+= DEDICATED="@comment "
+.endif
+
+.if defined(WITH_GAMELIBS) || !defined(HAVE_VM_COMPILED)
+MAKE_ENV+= BUILD_GAME_SO=1
+PLIST_SUB+= GAMELIBS=""
+.else
+PLIST_SUB+= GAMELIBS="@comment "
+.endif
+
+.if !defined(WITHOUT_OPTIMIZED_CFLAGS)
+MAKE_ENV+= USE_OPTIMIZED_CFLAGS=1
+.endif
+
+.if !defined(WITHOUT_SMP)
+MAKE_ENV+= BUILD_CLIENT_SMP=1
+PLIST_SUB+= SMP=""
+Q3BIN+= ioquake3-smp
+.else
+PLIST_SUB+= SMP="@comment "
+.endif
+
+.if ${OSVERSION} < 500000
+post-patch:
+ @${REINPLACE_CMD} -e 's|stdint\.h|inttypes.h|' \
+ ${BUILD_WRKSRC}/code/qcommon/q_shared.h
+.endif
+
+do-install:
+.for bin in ${Q3BIN}
+ ${INSTALL_PROGRAM} ${WRKSRC}/build/release/${bin} ${PREFIX}/bin
+.endfor
+.if defined(WITH_GAMELIBS) || !defined(HAVE_VM_COMPILED)
+.for dir in baseq3 missionpack
+ ${MKDIR} ${LIBDIR}/${dir}
+ ${INSTALL_PROGRAM} ${WRKSRC}/build/release/${dir}/*.so ${LIBDIR}/${dir}
+.endfor
+.endif
+
+post-install:
+.if defined(WITH_SDL_AUDIO) || defined(WITH_OPENAL)
+ @${ECHO_CMD}
+ @${ECHO_CMD} "WARNING: if you have sound problems try recompiling without SDL_AUDIO and OPENAL options." | ${FMT}
+ @${ECHO_CMD}
+.endif
+
+maint-gen-distfile:
+ @if [ -f ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX} ]; then \
+ ${ECHO_CMD} "ERROR: the distfile already exists."; \
+ ${FALSE}; \
+ fi
+ svn export -r${SVN_REV} svn://svn.icculus.org/quake3/trunk quake3
+ ${TAR} jcf ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX} quake3
+ ${RM} -rf quake3
+
+.include "${.CURDIR}/../quake3-data/Makefile.include"
+.include <bsd.port.post.mk>
diff --git a/games/iourbanterror/distinfo b/games/iourbanterror/distinfo
new file mode 100644
index 00000000000..17bc6407080
--- /dev/null
+++ b/games/iourbanterror/distinfo
@@ -0,0 +1,3 @@
+MD5 (ioquake3-1.33.tar.bz2) = 0eaf6eb252e6b56d1195faf2d898c533
+SHA256 (ioquake3-1.33.tar.bz2) = 9e9b7f4d7b39eb82c8b1de9dc0ce62d0eed4d676d21e1adfb4930832c5123abb
+SIZE (ioquake3-1.33.tar.bz2) = 2421997
diff --git a/games/iourbanterror/files/extra-patch-code__unix__unix_shared.c b/games/iourbanterror/files/extra-patch-code__unix__unix_shared.c
new file mode 100644
index 00000000000..a0860384c25
--- /dev/null
+++ b/games/iourbanterror/files/extra-patch-code__unix__unix_shared.c
@@ -0,0 +1,24 @@
+--- ./code/unix/unix_shared.c.orig Fri Nov 4 19:32:00 2005
++++ ./code/unix/unix_shared.c Wed Jun 7 16:52:01 2006
+@@ -20,6 +20,7 @@
+ ===========================================================================
+ */
+ #include <sys/types.h>
++#include <sys/sysctl.h>
+ #include <sys/stat.h>
+ #include <errno.h>
+ #include <stdio.h>
+@@ -430,6 +431,12 @@
+ // sysconf() in libc, POSIX.1 compliant
+ unsigned int Sys_ProcessorCount(void)
+ {
+- return sysconf(_SC_NPROCESSORS_ONLN);
++ int mib[2], value, len;
++
++ mib[0] = CTL_HW;
++ mib[1] = HW_NCPU;
++ len = sizeof(value);
++ sysctl(mib, 2, &value, &len, NULL, 0);
++ return (value);
+ }
+ #endif
diff --git a/games/iourbanterror/files/patch-Makefile b/games/iourbanterror/files/patch-Makefile
new file mode 100644
index 00000000000..4830ebf9300
--- /dev/null
+++ b/games/iourbanterror/files/patch-Makefile
@@ -0,0 +1,316 @@
+--- ./Makefile.orig Sat Apr 29 16:54:54 2006
++++ ./Makefile Wed Jun 7 19:34:25 2006
+@@ -26,11 +26,19 @@
+ endif
+ endif
+
+-BUILD_CLIENT =
+-BUILD_CLIENT_SMP =
+-BUILD_SERVER =
+-BUILD_GAME_SO =
+-BUILD_GAME_QVM =
++BUILD_CLIENT?=0
++BUILD_CLIENT_SMP?=0
++BUILD_GAME_QVM?=0
++BUILD_GAME_SO?=0
++BUILD_SERVER?=0
++HAVE_VM_COMPILED?=false
++USE_CODEC_VORBIS?=0
++USE_LOCAL_HEADERS?=0
++USE_OPENAL?=0
++USE_OPENAL_DLOPEN?=0
++USE_OPTIMIZED_CFLAGS?=0
++USE_SDL_AUDIO?=0
++USE_SDL_VIDEO?=0
+
+ #############################################################################
+ #
+@@ -88,30 +96,10 @@
+ endif
+ export USE_CCACHE
+
+-ifndef USE_SDL
+-USE_SDL=1
+-endif
+-
+-ifndef USE_OPENAL
+-USE_OPENAL=1
+-endif
+-
+-ifndef USE_OPENAL_DLOPEN
+-USE_OPENAL_DLOPEN=0
+-endif
+-
+-ifndef USE_CODEC_VORBIS
+-USE_CODEC_VORBIS=0
+-endif
+-
+-ifndef USE_LOCAL_HEADERS
+-USE_LOCAL_HEADERS=1
+-endif
+-
+ #############################################################################
+
+ BD=$(BUILD_DIR)/debug-$(PLATFORM)-$(ARCH)
+-BR=$(BUILD_DIR)/release-$(PLATFORM)-$(ARCH)
++BR=$(BUILD_DIR)/release
+ CDIR=$(MOUNT_DIR)/client
+ SDIR=$(MOUNT_DIR)/server
+ RDIR=$(MOUNT_DIR)/renderer
+@@ -407,18 +395,12 @@
+
+ ifeq ($(PLATFORM),freebsd)
+
+- ifneq (,$(findstring alpha,$(shell uname -m)))
+- ARCH=axp
+- else #default to i386
+- ARCH=i386
+- endif #alpha test
+-
+-
+- BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes
++ BASE_CFLAGS = -DARCH='\"$(ARCH)\"' -DLIBDIR='\"$(LIBDIR)\"' -I$(LOCALBASE)/include -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes
+
+- GL_CFLAGS = -I/usr/X11R6/include
++ GL_CFLAGS = -I$(X11BASE)/include
+
+ DEBUG_CFLAGS=$(BASE_CFLAGS) -g
++ RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -pipe
+
+ ifeq ($(USE_OPENAL),1)
+ BASE_CFLAGS += -DUSE_OPENAL=1
+@@ -431,46 +413,61 @@
+ BASE_CFLAGS += -DUSE_CODEC_VORBIS=1
+ endif
+
+- ifeq ($(USE_SDL),1)
+- BASE_CFLAGS += $(shell sdl11-config --cflags) -DUSE_SDL_VIDEO=1 -DUSE_SDL_SOUND=1
++ ifeq ($(USE_SDL_AUDIO),1)
++ BASE_CFLAGS += $(shell $(SDL_CONFIG) --cflags)
++ else
++ ifeq ($(USE_SDL_VIDEO),1)
++ BASE_CFLAGS += $(shell $(SDL_CONFIG) --cflags)
++ endif
+ endif
+
+- ifeq ($(ARCH),axp)
+- CC=gcc
+- BASE_CFLAGS += -DNO_VM_COMPILED
+- RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O3 -ffast-math -funroll-loops \
+- -fomit-frame-pointer -fexpensive-optimizations
+- else
+- ifeq ($(ARCH),i386)
+- CC=gcc
+- RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O3 -mtune=pentiumpro \
+- -march=pentium -fomit-frame-pointer -pipe -ffast-math \
+- -falign-loops=2 -falign-jumps=2 -falign-functions=2 \
+- -funroll-loops -fstrength-reduce
+- else
+- BASE_CFLAGS += -DNO_VM_COMPILED
++ ifeq ($(USE_SDL_AUDIO),1)
++ BASE_CFLAGS += -DUSE_SDL_SOUND=1
+ endif
++
++ ifeq ($(USE_SDL_VIDEO),1)
++ BASE_CFLAGS += -DUSE_SDL_VIDEO=1
++ endif
++
++ ifeq ($(USE_OPTIMIZED_CFLAGS),1)
++ RELEASE_CFLAGS+=-O3 -ffast-math -funroll-loops -fomit-frame-pointer \
++ -fexpensive-optimizations
++ ifeq ($(ARCH),i386)
++ RELEASE_CFLAGS+=-falign-loops=2 -falign-jumps=2 -falign-functions=2 \
++ -fstrength-reduce
++ endif
++ endif
++
++ ifneq ($(HAVE_VM_COMPILED),true)
++ BASE_CFLAGS += -DNO_VM_COMPILED
+ endif
+
+ SHLIBEXT=so
+ SHLIBCFLAGS=-fPIC
+ SHLIBLDFLAGS=-shared $(LDFLAGS)
+
+- THREAD_LDFLAGS=-lpthread
++ THREAD_LDFLAGS=$(PTHREAD_LIBS)
+ # don't need -ldl (FreeBSD)
+- LDFLAGS=-lm
++ LDFLAGS+=-lm
+
+- CLIENT_LDFLAGS =
++ CLIENT_LDFLAGS = -L$(LOCALBASE)/lib
+
+- ifeq ($(USE_SDL),1)
+- CLIENT_LDFLAGS += $(shell sdl11-config --libs)
++ ifeq ($(USE_SDL_AUDIO),1)
++ CLIENT_LDFLAGS += $(shell $(SDL_CONFIG) --libs)
+ else
+- CLIENT_LDFLAGS += -L/usr/X11R6/$(LIB) -lGL -lX11 -lXext -lXxf86dga -lXxf86vm
++ ifeq ($(USE_SDL_VIDEO),1)
++ CLIENT_LDFLAGS += $(shell $(SDL_CONFIG) --libs)
++ endif
++ endif
++
++ ifneq ($(USE_SDL_VIDEO),1)
++ CLIENT_LDFLAGS += -L$(X11BASE)/lib -lGL -lX11 -lXext -lXxf86dga -lXxf86vm
+ endif
+
+ ifeq ($(USE_OPENAL),1)
++ CLIENT_LDFLAGS += $(THREAD_LDFLAGS)
+ ifneq ($(USE_OPENAL_DLOPEN),1)
+- CLIENT_LDFLAGS += $(THREAD_LDFLAGS) -lopenal
++ CLIENT_LDFLAGS += -lopenal
+ endif
+ endif
+
+@@ -632,24 +629,24 @@
+ TARGETS =
+
+ ifneq ($(BUILD_SERVER),0)
+- TARGETS += $(B)/ioq3ded.$(ARCH)$(BINEXT)
++ TARGETS += $(B)/ioq3ded$(BINEXT)
+ endif
+
+ ifneq ($(BUILD_CLIENT),0)
+- TARGETS += $(B)/ioquake3.$(ARCH)$(BINEXT)
++ TARGETS += $(B)/ioquake3$(BINEXT)
+ ifneq ($(BUILD_CLIENT_SMP),0)
+- TARGETS += $(B)/ioquake3-smp.$(ARCH)$(BINEXT)
++ TARGETS += $(B)/ioquake3-smp$(BINEXT)
+ endif
+ endif
+
+ ifneq ($(BUILD_GAME_SO),0)
+ TARGETS += \
+- $(B)/baseq3/cgame$(ARCH).$(SHLIBEXT) \
+- $(B)/baseq3/qagame$(ARCH).$(SHLIBEXT) \
+- $(B)/baseq3/ui$(ARCH).$(SHLIBEXT) \
+- $(B)/missionpack/cgame$(ARCH).$(SHLIBEXT) \
+- $(B)/missionpack/qagame$(ARCH).$(SHLIBEXT) \
+- $(B)/missionpack/ui$(ARCH).$(SHLIBEXT)
++ $(B)/baseq3/cgame.$(SHLIBEXT) \
++ $(B)/baseq3/qagame.$(SHLIBEXT) \
++ $(B)/baseq3/ui.$(SHLIBEXT) \
++ $(B)/missionpack/cgame.$(SHLIBEXT) \
++ $(B)/missionpack/qagame.$(SHLIBEXT) \
++ $(B)/missionpack/ui.$(SHLIBEXT)
+ endif
+
+ ifneq ($(BUILD_GAME_QVM),0)
+@@ -707,11 +704,11 @@
+ $(MAKE) targets B=$(BD) CFLAGS="$(CFLAGS) $(DEBUG_CFLAGS) $(DEPEND_CFLAGS)"
+
+ build_release: B=$(BR)
+-build_release: makedirs tools
++build_release: makedirs
+ $(MAKE) targets B=$(BR) CFLAGS="$(CFLAGS) $(RELEASE_CFLAGS) $(DEPEND_CFLAGS)"
+
+ #Build both debug and release builds
+-all:build_debug build_release
++all:build_release
+
+ targets: $(TARGETS)
+
+@@ -919,11 +916,11 @@
+ $(B)/client/ftola.o \
+ $(B)/client/snapvectora.o
+ endif
+-ifeq ($(ARCH),x86_64)
++ifeq ($(ARCH),amd64)
+ Q3OBJ += $(B)/client/vm_x86_64.o
+ endif
+
+-ifeq ($(ARCH),ppc)
++ifeq ($(ARCH),powerpc)
+ ifneq ($(VM_PPC),)
+ Q3OBJ += $(B)/client/$(VM_PPC).o
+ endif
+@@ -971,10 +968,10 @@
+ $(B)/client/sdl_glimp_smp.o
+ endif
+
+-$(B)/ioquake3.$(ARCH)$(BINEXT): $(Q3OBJ) $(Q3POBJ) $(LIBSDLMAIN)
++$(B)/ioquake3$(BINEXT): $(Q3OBJ) $(Q3POBJ) $(LIBSDLMAIN)
+ $(CC) -o $@ $(Q3OBJ) $(Q3POBJ) $(CLIENT_LDFLAGS) $(LDFLAGS) $(LIBSDLMAIN)
+
+-$(B)/ioquake3-smp.$(ARCH)$(BINEXT): $(Q3OBJ) $(Q3POBJ_SMP) $(LIBSDLMAIN)
++$(B)/ioquake3-smp$(BINEXT): $(Q3OBJ) $(Q3POBJ_SMP) $(LIBSDLMAIN)
+ $(CC) -o $@ $(Q3OBJ) $(Q3POBJ_SMP) $(CLIENT_LDFLAGS) \
+ $(THREAD_LDFLAGS) $(LDFLAGS) $(LIBSDLMAIN)
+
+@@ -1253,17 +1250,17 @@
+ $(B)/ded/snapvectora.o $(B)/ded/matha.o
+ endif
+
+-ifeq ($(ARCH),x86_64)
++ifeq ($(ARCH),amd64)
+ Q3DOBJ += $(B)/ded/vm_x86_64.o
+ endif
+
+-ifeq ($(ARCH),ppc)
++ifeq ($(ARCH),powerpc)
+ ifneq ($(VM_PPC),)
+ Q3DOBJ += $(B)/ded/$(VM_PPC).o
+ endif
+ endif
+
+-$(B)/ioq3ded.$(ARCH)$(BINEXT): $(Q3DOBJ)
++$(B)/ioq3ded$(BINEXT): $(Q3DOBJ)
+ $(CC) -o $@ $(Q3DOBJ) $(LDFLAGS)
+
+ $(B)/ded/sv_bot.o : $(SDIR)/sv_bot.c; $(DO_DED_CC)
+@@ -1377,7 +1374,7 @@
+ Q3CGOBJ = $(Q3CGOBJ_) $(B)/baseq3/cgame/cg_syscalls.o
+ Q3CGVMOBJ = $(Q3CGOBJ_:%.o=%.asm) $(B)/baseq3/game/bg_lib.asm
+
+-$(B)/baseq3/cgame$(ARCH).$(SHLIBEXT) : $(Q3CGOBJ)
++$(B)/baseq3/cgame.$(SHLIBEXT) : $(Q3CGOBJ)
+ $(CC) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ)
+
+ $(B)/baseq3/vm/cgame.qvm: $(Q3CGVMOBJ) $(CGDIR)/cg_syscalls.asm
+@@ -1418,7 +1415,7 @@
+ MPCGOBJ = $(MPCGOBJ_) $(B)/missionpack/cgame/cg_syscalls.o
+ MPCGVMOBJ = $(MPCGOBJ_:%.o=%.asm) $(B)/missionpack/game/bg_lib.asm
+
+-$(B)/missionpack/cgame$(ARCH).$(SHLIBEXT) : $(MPCGOBJ)
++$(B)/missionpack/cgame.$(SHLIBEXT) : $(MPCGOBJ)
+ $(CC) $(SHLIBLDFLAGS) -o $@ $(MPCGOBJ)
+
+ $(B)/missionpack/vm/cgame.qvm: $(MPCGVMOBJ) $(CGDIR)/cg_syscalls.asm
+@@ -1468,7 +1465,7 @@
+ Q3GOBJ = $(Q3GOBJ_) $(B)/baseq3/game/g_syscalls.o
+ Q3GVMOBJ = $(Q3GOBJ_:%.o=%.asm) $(B)/baseq3/game/bg_lib.asm
+
+-$(B)/baseq3/qagame$(ARCH).$(SHLIBEXT) : $(Q3GOBJ)
++$(B)/baseq3/qagame.$(SHLIBEXT) : $(Q3GOBJ)
+ $(CC) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ)
+
+ $(B)/baseq3/vm/qagame.qvm: $(Q3GVMOBJ) $(GDIR)/g_syscalls.asm
+@@ -1516,7 +1513,7 @@
+ MPGOBJ = $(MPGOBJ_) $(B)/missionpack/game/g_syscalls.o
+ MPGVMOBJ = $(MPGOBJ_:%.o=%.asm) $(B)/missionpack/game/bg_lib.asm
+
+-$(B)/missionpack/qagame$(ARCH).$(SHLIBEXT) : $(MPGOBJ)
++$(B)/missionpack/qagame.$(SHLIBEXT) : $(MPGOBJ)
+ $(CC) $(SHLIBLDFLAGS) -o $@ $(MPGOBJ)
+
+ $(B)/missionpack/vm/qagame.qvm: $(MPGVMOBJ) $(GDIR)/g_syscalls.asm
+@@ -1576,7 +1573,7 @@
+ Q3UIOBJ = $(Q3UIOBJ_) $(B)/missionpack/ui/ui_syscalls.o
+ Q3UIVMOBJ = $(Q3UIOBJ_:%.o=%.asm) $(B)/baseq3/game/bg_lib.asm
+
+-$(B)/baseq3/ui$(ARCH).$(SHLIBEXT) : $(Q3UIOBJ)
++$(B)/baseq3/ui.$(SHLIBEXT) : $(Q3UIOBJ)
+ $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ)
+
+ $(B)/baseq3/vm/ui.qvm: $(Q3UIVMOBJ) $(UIDIR)/ui_syscalls.asm
+@@ -1601,7 +1598,7 @@
+ MPUIOBJ = $(MPUIOBJ_) $(B)/missionpack/ui/ui_syscalls.o
+ MPUIVMOBJ = $(MPUIOBJ_:%.o=%.asm) $(B)/baseq3/game/bg_lib.asm
+
+-$(B)/missionpack/ui$(ARCH).$(SHLIBEXT) : $(MPUIOBJ)
++$(B)/missionpack/ui.$(SHLIBEXT) : $(MPUIOBJ)
+ $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(MPUIOBJ)
+
+ $(B)/missionpack/vm/ui.qvm: $(MPUIVMOBJ) $(UIDIR)/ui_syscalls.asm
diff --git a/games/iourbanterror/files/patch-code__botlib__be_interface.c b/games/iourbanterror/files/patch-code__botlib__be_interface.c
new file mode 100644
index 00000000000..dd57f36a808
--- /dev/null
+++ b/games/iourbanterror/files/patch-code__botlib__be_interface.c
@@ -0,0 +1,11 @@
+--- ./code/botlib/be_interface.c.orig Wed Apr 26 10:36:58 2006
++++ ./code/botlib/be_interface.c Wed Jun 7 19:34:25 2006
+@@ -155,7 +155,7 @@
+ } else {
+ Com_sprintf(logfilename, sizeof(logfilename), "botlib.log");
+ }
+- Log_Open(logfilename);
++ Log_Open("/dev/null");
+ //
+ botimport.Print(PRT_MESSAGE, "------- BotLib Initialization -------\n");
+ //
diff --git a/games/iourbanterror/files/patch-code__qcommon__common.c b/games/iourbanterror/files/patch-code__qcommon__common.c
new file mode 100644
index 00000000000..c1fdcacdd58
--- /dev/null
+++ b/games/iourbanterror/files/patch-code__qcommon__common.c
@@ -0,0 +1,10 @@
+--- ./code/qcommon/common.c.orig Wed Apr 26 08:27:12 2006
++++ ./code/qcommon/common.c Wed Jun 7 19:34:25 2006
+@@ -25,6 +25,7 @@
+ #include "qcommon.h"
+ #include <setjmp.h>
+ #ifndef _WIN32
++#include <sys/types.h>
+ #include <netinet/in.h>
+ #include <sys/stat.h> // umask
+ #else
diff --git a/games/iourbanterror/files/patch-code__qcommon__q_platform.h b/games/iourbanterror/files/patch-code__qcommon__q_platform.h
new file mode 100644
index 00000000000..c65c0b6f370
--- /dev/null
+++ b/games/iourbanterror/files/patch-code__qcommon__q_platform.h
@@ -0,0 +1,15 @@
+--- ./code/qcommon/q_platform.h.orig Tue Dec 27 16:46:01 2005
++++ ./code/qcommon/q_platform.h Wed Jun 7 19:35:23 2006
+@@ -176,11 +176,7 @@
+ #define ID_INLINE inline
+ #define PATH_SEP '/'
+
+-#ifdef __i386__
+-#define ARCH_STRING "i386"
+-#elif defined __axp__
+-#define ARCH_STRING "alpha"
+-#endif
++#define ARCH_STRING ARCH
+
+ #if BYTE_ORDER == BIG_ENDIAN
+ #define Q3_BIG_ENDIAN
diff --git a/games/iourbanterror/files/patch-code__unix__linux_glimp.c b/games/iourbanterror/files/patch-code__unix__linux_glimp.c
new file mode 100644
index 00000000000..987afc280e7
--- /dev/null
+++ b/games/iourbanterror/files/patch-code__unix__linux_glimp.c
@@ -0,0 +1,19 @@
+--- ./code/unix/linux_glimp.c.orig Sun Apr 30 11:32:56 2006
++++ ./code/unix/linux_glimp.c Wed Jun 7 19:34:25 2006
+@@ -631,8 +631,14 @@
+
+ dx = ((int)event.xmotion.x - mwx);
+ dy = ((int)event.xmotion.y - mwy);
+- mx += dx;
+- my += dy;
++ if (abs(dx) > 1)
++ mx += dx * 2;
++ else
++ mx += dx;
++ if (abs(dy) > 1)
++ my += dy * 2;
++ else
++ my += dy;
+
+ mwx = event.xmotion.x;
+ mwy = event.xmotion.y;
diff --git a/games/iourbanterror/files/patch-code__unix__unix_main.c b/games/iourbanterror/files/patch-code__unix__unix_main.c
new file mode 100644
index 00000000000..cd61c56a765
--- /dev/null
+++ b/games/iourbanterror/files/patch-code__unix__unix_main.c
@@ -0,0 +1,31 @@
+--- ./code/unix/unix_main.c.orig Sun Feb 26 18:22:12 2006
++++ ./code/unix/unix_main.c Wed Jun 7 19:34:25 2006
+@@ -774,6 +774,7 @@
+ char curpath[MAX_OSPATH];
+ char fname[MAX_OSPATH];
+ char *basepath;
++ char *libpath;
+ char *homepath;
+ char *pwdpath;
+ char *cdpath;
+@@ -789,14 +790,19 @@
+ // TODO: use fs_searchpaths from files.c
+ pwdpath = Sys_Cwd();
+ basepath = Cvar_VariableString( "fs_basepath" );
++ libpath = LIBDIR;
+ homepath = Cvar_VariableString( "fs_homepath" );
+ cdpath = Cvar_VariableString( "fs_cdpath" );
+ gamedir = Cvar_VariableString( "fs_game" );
+
+- libHandle = try_dlopen(pwdpath, gamedir, fname, fqpath);
++ if(!libHandle && homepath)
++ libHandle = try_dlopen(pwdpath, gamedir, fname, fqpath);
+
+ if(!libHandle && homepath)
+ libHandle = try_dlopen(homepath, gamedir, fname, fqpath);
++
++ if(!libHandle && basepath)
++ libHandle = try_dlopen(libpath, gamedir, fname, fqpath);
+
+ if(!libHandle && basepath)
+ libHandle = try_dlopen(basepath, gamedir, fname, fqpath);
diff --git a/games/iourbanterror/pkg-descr b/games/iourbanterror/pkg-descr
new file mode 100644
index 00000000000..6bb3f4006f4
--- /dev/null
+++ b/games/iourbanterror/pkg-descr
@@ -0,0 +1,11 @@
+This project, icculus.org/quake3 (sometimes referred to ioquake3, or ioq3 for
+short) aims to build upon id Software's Quake 3 source code release. The
+source code was released on August 20, 2005 under the GPL. Since then, we have
+been cleaning up, fixing bugs, and adding features. Our permanent goal is to
+create the open source Quake 3 distribution upon which people base their games
+and projects. We also seek to have the perfect version of the engine for
+playing Quake 3: Arena, Team Arena, and all popular mods. This distribution of
+the engine has been ported to many new platforms and has had a slew of new
+features added, along with massive bug extermination.
+
+WWW: http://icculus.org/quake3/
diff --git a/games/iourbanterror/pkg-plist b/games/iourbanterror/pkg-plist
new file mode 100644
index 00000000000..a2fb5a77eb6
--- /dev/null
+++ b/games/iourbanterror/pkg-plist
@@ -0,0 +1,12 @@
+%%DEDICATED%%bin/ioq3ded
+%%CLIENT%%bin/ioquake3
+%%SMP%%bin/ioquake3-smp
+%%GAMELIBS%%%%LIBDIR%%/baseq3/cgame.so
+%%GAMELIBS%%%%LIBDIR%%/baseq3/qagame.so
+%%GAMELIBS%%%%LIBDIR%%/baseq3/ui.so
+%%GAMELIBS%%%%LIBDIR%%/missionpack/cgame.so
+%%GAMELIBS%%%%LIBDIR%%/missionpack/qagame.so
+%%GAMELIBS%%%%LIBDIR%%/missionpack/ui.so
+%%GAMELIBS%%@dirrm %%LIBDIR%%/missionpack
+%%GAMELIBS%%@dirrm %%LIBDIR%%/baseq3
+%%GAMELIBS%%@dirrm %%LIBDIR%%