summaryrefslogtreecommitdiff
path: root/games/quake2lnx
diff options
context:
space:
mode:
authorMax Khon <fjoe@FreeBSD.org>2003-06-18 09:21:21 +0000
committerMax Khon <fjoe@FreeBSD.org>2003-06-18 09:21:21 +0000
commit5dfaba8ea1e84f0b981ac1ea14dbf2ebcf6c4cff (patch)
tree94263949a16f153327d82eb0e15dc57c28ad5254 /games/quake2lnx
parentDon't trust IP comes from fake HELO (diff)
New port: games/quake2lnx
Quake2-LNX project aims to further develop and bug fix original Quake II code released by id Software in 1998, as well as support multiple architectures. It also includes additional rendering drivers, eyecandy stuff from Quake2Max project, and experimental IPv6 support. Submitted by: Alexey Dokuchaev <danfe (at) regency.nsu.ru>
Notes
Notes: svn path=/head/; revision=83249
Diffstat (limited to 'games/quake2lnx')
-rw-r--r--games/quake2lnx/Makefile275
-rw-r--r--games/quake2lnx/distinfo4
-rw-r--r--games/quake2lnx/files/patch-Makefile428
-rw-r--r--games/quake2lnx/files/patch-src::client::cl_fx.c11
-rw-r--r--games/quake2lnx/files/patch-src::client::cl_fxmax.c43
-rw-r--r--games/quake2lnx/files/patch-src::client::cl_newfx.c85
-rw-r--r--games/quake2lnx/files/patch-src::client::cl_view.c12
-rw-r--r--games/quake2lnx/files/patch-src::client::snd_mix.c20
-rw-r--r--games/quake2lnx/files/patch-src::linux::gl_glx.c183
-rw-r--r--games/quake2lnx/files/patch-src::linux::rw_aa.c30
-rw-r--r--games/quake2lnx/files/patch-src::linux::rw_in_aa.c19
-rw-r--r--games/quake2lnx/files/patch-src::linux::rw_in_svgalib.c273
-rw-r--r--games/quake2lnx/files/patch-src::linux::rw_sdl.c14
-rw-r--r--games/quake2lnx/files/patch-src::linux::rw_svgalib.c12
-rw-r--r--games/quake2lnx/files/patch-src::linux::rw_x11.c171
-rw-r--r--games/quake2lnx/files/patch-src::ref_candygl::gl_rmisc.c12
-rw-r--r--games/quake2lnx/pkg-descr7
-rw-r--r--games/quake2lnx/pkg-message13
-rw-r--r--games/quake2lnx/pkg-plist84
19 files changed, 1696 insertions, 0 deletions
diff --git a/games/quake2lnx/Makefile b/games/quake2lnx/Makefile
new file mode 100644
index 000000000000..4d0809fa8d61
--- /dev/null
+++ b/games/quake2lnx/Makefile
@@ -0,0 +1,275 @@
+# New ports collection makefile for: Quake2-LNX
+# Date created: 11 Jun 2003
+# Whom: Alexey Dokuchaev <danfe@regency.nsu.ru>
+#
+# $FreeBSD$
+#
+
+PORTNAME= quake2lnx
+PORTVERSION= 0.15
+CATEGORIES= games
+MASTER_SITES= http://www.icculus.org/quake2/files/:src \
+ http://freebsd.nsu.ru/distfiles/q2/:pak
+DISTNAME= quake2-r${PORTVERSION}
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:src
+.if defined(WITH_EYECANDY)
+DISTFILES+= maxpak.pak:pak
+.endif
+.if defined(WITH_SHAREWARE_DATA)
+DISTFILES+= pak0.pak:pak \
+ players.tgz:pak
+.endif
+EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
+
+MAINTAINER= danfe@regency.nsu.ru
+COMMENT= Cleaned up copy of the original Quake II source code
+
+USE_GMAKE= yes
+
+.include <bsd.port.pre.mk>
+
+### #
+## CLIENTS AND RENDERERS ##
+# ###
+
+.if ${ARCH} == "i386" && !defined(WITHOUT_SVGA) \
+ && (defined(WITH_SVGA) || exists(${LOCALBASE}/lib/libvga.so.1))
+LIB_DEPENDS+= vga.1:${PORTSDIR}/graphics/svgalib
+MAKE_ARGS+= BUILD_SVGA=YES
+REF_TARGETS+= soft
+PLIST_SUB+= SVGA=""
+.else
+PLIST_SUB+= SVGA="@comment "
+.endif
+
+.if defined(WITH_SDLCLIENT) || defined(WITH_SDL) || defined(WITH_SDLGL) \
+ || exists(${LOCALBASE}/lib/libSDL-1.1.so.5)
+. if !(defined(WITHOUT_SDLCLIENT) && defined(WITHOUT_SDL) \
+ && defined(WITHOUT_SDLGL))
+LIB_DEPENDS+= SDL-1.1.5:${PORTSDIR}/devel/sdl12
+. endif
+. if !defined(WITHOUT_SDLCLIENT)
+MAKE_ARGS+= BUILD_SDLQUAKE2=YES
+EXE_TARGETS+= sdlquake2
+PLIST_SUB+= SDLCLIENT=""
+. else
+PLIST_SUB+= SDLCLIENT="@comment "
+. endif
+. if !defined(WITHOUT_SDL)
+MAKE_ARGS+= BUILD_SDL=YES
+REF_TARGETS+= softsdl
+PLIST_SUB+= SDL=""
+. else
+PLIST_SUB+= SDL="@comment "
+. endif
+. if !defined(WITHOUT_SDLGL)
+MAKE_ARGS+= BUILD_SDLGL=YES
+REF_TARGETS+= sdlgl
+PLIST_SUB+= SDLGL=""
+. else
+PLIST_SUB+= SDLGL="@comment "
+. endif
+.endif
+
+.if !defined(WITHOUT_X11)
+LIB_DEPENDS+= X11.6:${PORTSDIR}/x11/XFree86-4-libraries \
+ Xext.6:${PORTSDIR}/x11/XFree86-4-libraries
+MAKE_ARGS+= BUILD_X11=YES
+REF_TARGETS+= softx
+PLIST_SUB+= X11=""
+.else
+PLIST_SUB+= X11="@comment "
+.endif
+
+.if !defined(WITHOUT_GLX) || defined(WITH_EYECANDY)
+LIB_DEPENDS+= GL.1:${PORTSDIR}/x11/XFree86-4-libraries
+MAKE_ARGS+= BUILD_GLX=YES
+REF_TARGETS+= glx
+PLIST_SUB+= GLX=""
+.else
+PLIST_SUB+= GLX="@comment "
+.endif
+
+.if !defined(WITHOUT_AA) && (defined(WITH_AA) \
+ || exists(${LOCALBASE}/lib/libaa.so.1))
+LIB_DEPENDS+= aa.1:${PORTSDIR}/graphics/aalib
+MAKE_ARGS+= BUILD_AA=YES
+REF_TARGETS+= softaa
+PLIST_SUB+= AA=""
+.else
+PLIST_SUB+= AA="@comment "
+.endif
+
+.if defined(WITH_EYECANDY)
+LIB_DEPENDS+= jpeg.9:${PORTSDIR}/graphics/jpeg
+MAKE_ARGS+= BUILD_QMAX=YES
+PLIST_SUB+= QMAX=""
+.else
+PLIST_SUB+= QMAX="@comment "
+.endif
+
+.if !defined(WITHOUT_CLIENT)
+MAKE_ARGS+= BUILD_CLIENT=YES
+EXE_TARGETS+= quake2
+PLIST_SUB+= CLIENT=""
+.else
+PLIST_SUB+= CLIENT="@comment "
+.endif
+
+.if !defined(WITHOUT_SERVER)
+MAKE_ARGS+= BUILD_DEDICATED=YES
+PLIST_SUB+= SERVER=""
+EXE_TARGETS+= q2ded
+.else
+PLIST_SUB+= SERVER="@comment "
+.endif
+
+### #
+## GAME, MISSION ADDONS, AND MODS ##
+# ###
+
+.if !defined(WITHOUT_GAME)
+MAKE_ARGS+= BUILD_GAME=YES
+PLIST_SUB+= GAME=""
+.else
+PLIST_SUB+= GAME="@comment "
+.endif
+
+.if defined(WITH_CTF)
+MAKE_ARGS+= BUILD_CTFDLL=YES
+PLIST_SUB+= CTF=""
+.else
+PLIST_SUB+= CTF="@comment "
+.endif
+
+.if defined(WITH_SHAREWARE_DATA)
+PLIST_SUB+= SHAREWARE=""
+.else
+PLIST_SUB+= SHAREWARE="@comment "
+.endif
+
+### #
+## MISCELLANEOUS TUNABLES ##
+# ###
+
+.if defined(WITH_JOYSTICK)
+MAKE_ARGS+= BUILD_JOYSTICK=YES
+.endif
+
+.if !defined(WITHOUT_ARTS) && (defined(WITH_ARTS) \
+ || exists (${LOCALBASE}/lib/libartsc.so.0))
+LIB_DEPENDS+= artsc.0:${PORTSDIR}/audio/arts
+MAKE_ARGS+= BUILD_ARTS=YES
+.endif
+
+.if defined(WITH_IPV6)
+MAKE_ARGS+= HAVE_IPV6=YES
+.endif
+
+.if defined(WITH_OPTIMIZED_CFLAGS)
+MAKE_ARGS+= OPTIMIZED_CFLAGS="-O9 -pipe -s -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations"
+.endif
+
+.if ${ARCH} != "i386" || defined(WITHOUT_X86_ASM)
+MAKE_ARGS+= NO_X86_ASM=YES
+.endif
+
+### #
+## END OF CONFIGURATION KNOBS ##
+# ###
+
+pre-everything::
+.if ${ARCH} == "i386" && !(defined(WITH_SVGA) || exists(${LOCALBASE}/lib/libvga.so.1))
+ @${ECHO_MSG} "Define WITH_SVGA to build SVGA driver"
+.endif
+.if !(defined(WITH_SDL) || exists(${LOCALBASE}/lib/libSDL-1.1.so.5))
+ @${ECHO_MSG} "Define WITH_SDL to build SDL software driver"
+.endif
+.if !(defined(WITH_SDLGL) || exists(${LOCALBASE}/lib/libSDL-1.1.so.5))
+ @${ECHO_MSG} "Define WITH_SDLGL to build SDL OpenGL driver"
+.endif
+.if !(defined(WITH_SDLCLIENT) || exists(${LOCALBASE}/lib/libSDL-1.1.so.5))
+ @${ECHO_MSG} "Define WITH_SDLCLIENT to build executable that uses SDL for cdrom and sound"
+.endif
+.if !(defined(WITH_AA) || exists(${LOCALBASE}/lib/libaa.so.1))
+ @${ECHO_MSG} "Define WITH_AA to build ASCII software renderer"
+.endif
+.if !defined(WITHOUT_X11)
+ @${ECHO_MSG} "Define WITHOUT_X11 to disable building of X11 driver"
+.endif
+.if !defined(WITHOUT_GLX)
+ @${ECHO_MSG} "Define WITHOUT_GLX to disable building of GLX driver"
+.endif
+.if !defined(WITH_EYECANDY)
+ @${ECHO_MSG} "Define WITH_EYECANDY to build executable with fancier GL graphics"
+.endif
+.if !defined(WITHOUT_CLIENT)
+ @${ECHO_MSG} "Define WITHOUT_CLIENT to disable building Quake2 client executable"
+.endif
+.if !defined(WITHOUT_SERVER)
+ @${ECHO_MSG} "Define WITHOUT_SERVER to disable building of dedicated server"
+.endif
+.if !defined(WITHOUT_GAME)
+ @${ECHO_MSG} "Define WITHOUT_GAME to build without main game .so"
+.endif
+.if !defined(WITH_CTF)
+ @${ECHO_MSG} "Define WITH_CTF to build Capture The Flag mod"
+.endif
+.if !defined(WITH_SHAREWARE_DATA)
+ @${ECHO_MSG} "Define WITH_SHAREWARE_DATA to install demo version game data"
+.endif
+.if !defined(WITH_JOYSTICK)
+ @${ECHO_MSG} "Define WITH_JOYSTICK to enable joystick support"
+.endif
+.if !(defined(WITH_ARTS) || exists (${LOCALBASE}/lib/libartsc.so.0))
+ @${ECHO_MSG} "Define WITH_ARTS to enable support for aRts sound daemon"
+.endif
+.if !defined(WITH_IPV6)
+ @${ECHO_MSG} "Define WITH_IPV6 to enable experimental IPv6 support"
+.endif
+.if !defined(WITH_OPTIMIZED_CFLAGS)
+ @${ECHO_MSG} "Define WITH_OPTIMIZED_CFLAGS to enable extra optimization options"
+.endif
+.if ${ARCH} == "i386" && !defined(WITHOUT_X86_ASM)
+ @${ECHO_MSG} "Define WITHOUT_X86_ASM to disable x86 assembly code"
+.endif
+
+TGTDIR= ${WRKSRC}/release${ARCH}
+
+do-build:
+ @(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} \
+ ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} build_release)
+
+PLIST_SUB+= ARCH="${ARCH}"
+
+do-install:
+.for tgt in ${EXE_TARGETS}
+ ${INSTALL_PROGRAM} ${TGTDIR}/${tgt} ${PREFIX}/bin
+.endfor
+ @${MKDIR} ${DATADIR}/baseq2
+.for tgt in ${REF_TARGETS}
+ ${INSTALL_PROGRAM} ${TGTDIR}/ref_${tgt}.so ${DATADIR}
+.endfor
+.if !defined(WITHOUT_GAME)
+ ${INSTALL_PROGRAM} ${TGTDIR}/game${ARCH}.so ${DATADIR}/baseq2
+.endif
+.if defined(WITH_CTF)
+ @${MKDIR} ${DATADIR}/ctf
+ ${INSTALL_PROGRAM} ${TGTDIR}/ctf/game${ARCH}.so ${DATADIR}/ctf
+.endif
+.if defined(WITH_SHAREWARE_DATA)
+ ${INSTALL_DATA} ${DISTDIR}/pak0.pak ${DATADIR}/baseq2
+ ${GUNZIP_CMD} -c ${DISTDIR}/players.tgz | ${TAR} -C ${DATADIR}/baseq2 -xf -
+.endif
+.if defined(WITH_EYECANDY)
+ ${INSTALL_DATA} ${DISTDIR}/maxpak.pak ${DATADIR}/baseq2
+.endif
+.if !defined(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR}
+ ${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
+.endif
+
+post-install:
+ @${SED} -e 's#$${PREFIX}#${PREFIX}#g' ${PKGMESSAGE}
+
+.include <bsd.port.post.mk>
diff --git a/games/quake2lnx/distinfo b/games/quake2lnx/distinfo
new file mode 100644
index 000000000000..8ba8bc5f2206
--- /dev/null
+++ b/games/quake2lnx/distinfo
@@ -0,0 +1,4 @@
+MD5 (quake2-r0.15.tar.gz) = 9e16f29db33715f2f9420b5bb31e6263
+MD5 (maxpak.pak) = 5207a493edd1d359f5b7312fa028343b
+MD5 (pak0.pak) = 27d77240466ec4f3253256832b54db8a
+MD5 (players.tgz) = c20ee0e8ee77fb615cae61ad5f8f5347
diff --git a/games/quake2lnx/files/patch-Makefile b/games/quake2lnx/files/patch-Makefile
new file mode 100644
index 000000000000..d7d30abd19f8
--- /dev/null
+++ b/games/quake2lnx/files/patch-Makefile
@@ -0,0 +1,428 @@
+--- Makefile.orig Thu Oct 10 01:08:21 2002
++++ Makefile Tue Jun 17 22:23:11 2003
+@@ -12,28 +12,28 @@
+ # (Note: not all options are available for all platforms).
+ # quake2 (uses OSS for sound, cdrom ioctls for cd audio) is automatically built.
+ # game$(ARCH).so is automatically built.
+-BUILD_SDLQUAKE2=YES # sdlquake2 executable (uses SDL for cdrom and sound)
+-BUILD_SVGA=NO # SVGAlib driver. Seems to work fine.
+-BUILD_X11=YES # X11 software driver. Works somewhat ok.
+-BUILD_GLX=YES # X11 GLX driver. Works somewhat ok.
+-BUILD_FXGL=NO # FXMesa driver. Not tested. (used only for V1 and V2).
+-BUILD_SDL=YES # SDL software driver. Works fine for some people.
+-BUILD_SDLGL=YES # SDL OpenGL driver. Works fine for some people.
+-BUILD_CTFDLL=YES # game$(ARCH).so for ctf
+-BUILD_XATRIX=NO # game$(ARCH).so for xatrix (see README.r for details)
+-BUILD_ROGUE=NO # game$(ARCH).so for rogue (see README.r for details)
+-BUILD_JOYSTICK=YES # build in joystick support
+-BUILD_ARTS=NO # build in support for libaRts sound.
+-BUILD_DEDICATED=NO # build a dedicated quake2 server
+-BUILD_AA=YES # build the ascii soft renderer.
+-BUILD_QMAX=YES # build the fancier GL graphics
++#BUILD_SDLQUAKE2=YES # sdlquake2 executable (uses SDL for cdrom and sound)
++#BUILD_SVGA=NO # SVGAlib driver. Seems to work fine.
++#BUILD_X11=YES # X11 software driver. Works somewhat ok.
++#BUILD_GLX=YES # X11 GLX driver. Works somewhat ok.
++#BUILD_FXGL=NO # FXMesa driver. Not tested. (used only for V1 and V2).
++#BUILD_SDL=YES # SDL software driver. Works fine for some people.
++#BUILD_SDLGL=YES # SDL OpenGL driver. Works fine for some people.
++#BUILD_CTFDLL=YES # game$(ARCH).so for ctf
++#BUILD_XATRIX=NO # game$(ARCH).so for xatrix (see README.r for details)
++#BUILD_ROGUE=NO # game$(ARCH).so for rogue (see README.r for details)
++#BUILD_JOYSTICK=YES # build in joystick support
++#BUILD_ARTS=NO # build in support for libaRts sound.
++#BUILD_DEDICATED=NO # build a dedicated quake2 server
++#BUILD_AA=YES # build the ascii soft renderer.
++#BUILD_QMAX=YES # build the fancier GL graphics
+
+ STATICSDL=NO
+-SDLDIR=/usr/local/lib
++SDLDIR=${PREFIX}/lib
+
+ # Other compile-time options:
+ # Compile with IPv6 (protocol independent API). Tested on FreeBSD
+-HAVE_IPV6=NO
++#HAVE_IPV6=NO
+
+ # (hopefully) end of configurable options
+
+@@ -50,47 +50,11 @@
+ endif
+ endif
+
++CC?=gcc
+
+-# this nice line comes from the linux kernel makefile
+-ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc/ -e s/sparc64/sparc/ -e s/arm.*/arm/ -e s/sa110/arm/ -e s/alpha/axp/)
++RELEASE_CFLAGS= $(BASE_CFLAGS) $(OPTIMIZED_CFLAGS)
+
+-ifneq ($(ARCH),i386)
+-ifneq ($(ARCH),axp)
+-ifneq ($(ARCH),ppc)
+-ifneq ($(ARCH),sparc)
+-$(error arch $(ARCH) is currently not supported)
+-endif
+-endif
+-endif
+-endif
+-
+-CC=gcc
+-
+-ifeq ($(ARCH),axp)
+-RELEASE_CFLAGS=$(BASE_CFLAGS) -ffast-math -funroll-loops \
+- -fomit-frame-pointer -fexpensive-optimizations
+-endif
+-
+-ifeq ($(ARCH),ppc)
+-RELEASE_CFLAGS=$(BASE_CFLAGS) -O2 -ffast-math -funroll-loops \
+- -fomit-frame-pointer -fexpensive-optimizations
+-endif
+-
+-ifeq ($(ARCH),sparc)
+-RELEASE_CFLAGS=$(BASE_CFLAGS) -ffast-math -funroll-loops \
+- -fomit-frame-pointer -fexpensive-optimizations
+-endif
+-
+-ifeq ($(ARCH),i386)
+-RELEASE_CFLAGS=$(BASE_CFLAGS) -O2 -ffast-math -funroll-loops -malign-loops=2 \
+- -malign-jumps=2 -malign-functions=2 -g
+-# compiler bugs with gcc 2.96 and 3.0.1 can cause bad builds with heavy opts.
+-#RELEASE_CFLAGS=$(BASE_CFLAGS) -O6 -m486 -ffast-math -funroll-loops \
+-# -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
+-# -malign-jumps=2 -malign-functions=2
+-endif
+-
+-VERSION=3.21+rCVS
++VERSION=3.21+r0.15
+
+ MOUNT_DIR=src
+
+@@ -108,7 +72,7 @@
+ ROGUE_DIR=$(MOUNT_DIR)/rogue
+ NULL_DIR=$(MOUNT_DIR)/null
+
+-BASE_CFLAGS=-Wall -pipe -Dstricmp=strcasecmp
++BASE_CFLAGS=-Wall -pipe -Dstricmp=strcasecmp $(CFLAGS)
+ ifeq ($(HAVE_IPV6),YES)
+ BASE_CFLAGS+= -DHAVE_IPV6 -DHAVE_SIN6_LEN
+ NET_UDP=net_udp6
+@@ -127,7 +91,13 @@
+ BASE_CFLAGS+=$(shell artsc-config --cflags)
+ endif
+
+-ifneq ($(ARCH),i386)
++ifeq ($(ARCH),i386)
++ifneq ($(strip $(NO_X86_ASM)),YES)
++ BASE_CFLAGS+=-Did386
++else
++ BASE_CFLAGS+=-DC_ONLY
++endif
++else
+ BASE_CFLAGS+=-DC_ONLY
+ endif
+
+@@ -144,20 +114,22 @@
+ LDFLAGS+=$(shell artsc-config --libs)
+ endif
+
+-SVGALDFLAGS=-lvga
++SVGALDFLAGS=-L${PREFIX}/lib -lvga
++SVGACFLAGS=-I${PREFIX}/include
+
+-XCFLAGS=-I/usr/X11R6/include
+-XLDFLAGS=-L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm
+-AALDFLAGS=-lm -laa
++XCFLAGS=-I${X11BASE}/include
++XLDFLAGS=-L${X11BASE}/lib -lX11 -lXext -lXxf86dga -lXxf86vm
++AACFLAGS=-I${PREFIX}/include
++AALDFLAGS=-L${PREFIX}/lib -laa
+
+-SDLCFLAGS=$(shell sdl-config --cflags)
++SDLCFLAGS=$(shell sdl11-config --cflags)
+ ifeq ($(strip $(STATICSDL)),YES)
+- SDLLDFLAGS += -L/usr/X11R6/lib -Wl,-Bstatic $(SDLDIR)/libSDL.a
++ SDLLDFLAGS += -L${X11BASE}/lib -Wl,-Bstatic $(SDLDIR)/libSDL.a
+ SDLLDFLAGS += $(SDLDIR)/libesd.a $(SDLDIR)/libartsc.a -Wl,-Bdynamic
+ SDLLDFLAGS += -lpthread -lX11 -lXext -lXxf86dga -lXxf86vm -lXv \
+ -lXinerama
+ else
+- SDLLDFLAGS=$(shell sdl-config --libs)
++ SDLLDFLAGS=$(shell sdl11-config --libs)
+ endif
+
+ ifeq ($(strip $(BUILD_JOYSTICK)),YES)
+@@ -168,15 +140,16 @@
+ FXGLLDFLAGS=-L/usr/local/glide/lib -L/usr/X11/lib -L/usr/local/lib \
+ -L/usr/X11R6/lib -lX11 -lXext -lGL -lvga
+
+-GLXCFLAGS=-I/usr/X11R6/include -DOPENGL
+-GLXLDFLAGS=-L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm
++GLXCFLAGS=-I${X11BASE}/include -DOPENGL
++GLXLDFLAGS=-L${X11BASE}/lib -lX11 -lXext -lXxf86dga -lXxf86vm
+
+ SDLGLCFLAGS=$(SDLCFLAGS) -DOPENGL
+ SDLGLLDFLAGS=$(SDLLDFLAGS)
+
+ ifeq ($(strip $(BUILD_QMAX)),YES)
+-GLXLDFLAGS+=-ljpeg
+-SDLGLLDFLAGS+=-ljpeg
++GLXCFLAGS+=-I${PREFIX}/include
++GLXLDFLAGS+=-L${PREFIX}/lib -ljpeg
++SDLGLLDFLAGS+=-L${PREFIX}/lib -ljpeg
+ REF_GL_DIR = $(MOUNT_DIR)/ref_candygl
+ CL_FX = cl_fxmax.c
+ else
+@@ -192,7 +165,7 @@
+ DO_DED_CC=$(CC) $(CFLAGS) -DDEDICATED_ONLY -o $@ -c $<
+ DO_DED_DEBUG_CC=$(CC) $(DEBUG_CFLAGS) -DDEDICATED_ONLY -o $@ -c $<
+ DO_SHLIB_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
+-DO_GL_SHLIB_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) $(GLCFLAGS) -o $@ -c $<
++DO_GL_SHLIB_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) $(GLCFLAGS) $(GLXCFLAGS) -o $@ -c $<
+ DO_AS=$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+ DO_SHLIB_AS=$(CC) $(CFLAGS) $(SHLIBCFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
+
+@@ -202,10 +175,42 @@
+
+ .PHONY : targets build_debug build_release clean clean-debug clean-release clean2
+
+-TARGETS=$(BUILDDIR)/quake2 $(BUILDDIR)/game$(ARCH).$(SHLIBEXT)
++ifeq ($(strip $(BUILD_CLIENT)),YES)
++ TARGETS += $(BUILDDIR)/quake2
++endif
++
++ifeq ($(strip $(BUILD_SDLQUAKE2)),YES)
++ TARGETS += $(BUILDDIR)/sdlquake2
++endif
++
++ifeq ($(strip $(BUILD_SVGA)),YES)
++ TARGETS += $(BUILDDIR)/ref_soft.$(SHLIBEXT)
++endif
++
++ifeq ($(strip $(BUILD_X11)),YES)
++ TARGETS += $(BUILDDIR)/ref_softx.$(SHLIBEXT)
++endif
++
++ifeq ($(strip $(BUILD_GLX)),YES)
++ TARGETS += $(BUILDDIR)/ref_glx.$(SHLIBEXT)
++endif
++
++ifeq ($(strip $(BUILD_SDL)),YES)
++ TARGETS += $(BUILDDIR)/ref_softsdl.$(SHLIBEXT)
++endif
++
++ifeq ($(strip $(BUILD_SDLGL)),YES)
++ TARGETS += $(BUILDDIR)/ref_sdlgl.$(SHLIBEXT)
++endif
++
+ ifeq ($(strip $(BUILD_DEDICATED)),YES)
+ TARGETS += $(BUILDDIR)/q2ded
+ endif
++
++ifeq ($(strip $(BUILD_GAME)),YES)
++ TARGETS += $(BUILDDIR)/game$(ARCH).$(SHLIBEXT)
++endif
++
+ ifeq ($(strip $(BUILD_CTFDLL)),YES)
+ TARGETS += $(BUILDDIR)/ctf/game$(ARCH).$(SHLIBEXT)
+ endif
+@@ -218,126 +223,6 @@
+ TARGETS += $(BUILDDIR)/rogue/game$(ARCH).$(SHLIBEXT)
+ endif
+
+-ifeq ($(ARCH),axp)
+- ifeq ($(strip $(BUILD_SDLQUAKE2)),YES)
+- $(warning Warning: SDLQuake2 not supported for $(ARCH))
+- endif
+-
+- ifeq ($(strip $(BUILD_SVGA)),YES)
+- $(warning Warning: SVGAlib support not supported for $(ARCH))
+- endif
+-
+- ifeq ($(strip $(BUILD_X11)),YES)
+- $(warning Warning: X11 support not supported for $(ARCH))
+- endif
+-
+- ifeq ($(strip $(BUILD_GLX)),YES)
+- $(warning Warning: support not supported for $(ARCH))
+- endif
+-
+- ifeq ($(strip $(BUILD_FXGL)),YES)
+- $(warning Warning: FXGL support not supported for $(ARCH))
+- endif
+-
+- ifeq ($(strip $(BUILD_SDL)),YES)
+- $(warning Warning: SDL support not supported for $(ARCH))
+- endif
+-
+- ifeq ($(strip $(BUILD_SDLGL)),YES)
+- $(warning Warning: SDLGL support not supported for $(ARCH))
+- endif
+-endif # ARCH axp
+-
+-ifeq ($(ARCH),ppc)
+- ifeq ($(strip $(BUILD_SDLQUAKE2)),YES)
+- TARGETS += $(BUILDDIR)/sdlquake2
+- endif
+-
+- ifeq ($(strip $(BUILD_SVGA)),YES)
+- $(warning Warning: SVGAlib support not supported for $(ARCH))
+- endif
+-
+- ifeq ($(strip $(BUILD_X11)),YES)
+- TARGETS += $(BUILDDIR)/ref_softx.$(SHLIBEXT)
+- endif
+-
+- ifeq ($(strip $(BUILD_GLX)),YES)
+- TARGETS += $(BUILDDIR)/ref_glx.$(SHLIBEXT)
+- endif
+-
+- ifeq ($(strip $(BUILD_FXGL)),YES)
+- $(warning Warning: FXGL support not supported for $(ARCH))
+- endif
+-
+- ifeq ($(strip $(BUILD_SDL)),YES)
+- TARGETS += $(BUILDDIR)/ref_softsdl.$(SHLIBEXT)
+- endif
+-
+- ifeq ($(strip $(BUILD_SDLGL)),YES)
+- TARGETS += $(BUILDDIR)/ref_sdlgl.$(SHLIBEXT)
+- endif
+-endif # ARCH ppc
+-
+-ifeq ($(ARCH),sparc)
+- ifeq ($(strip $(BUILD_SDLQUAKE2)),YES)
+- TARGETS += $(BUILDDIR)/sdlquake2
+- endif
+-
+- ifeq ($(strip $(BUILD_SVGA)),YES)
+- $(warning Warning: SVGAlib support not supported for $(ARCH))
+- endif
+-
+- ifeq ($(strip $(BUILD_X11)),YES)
+- TARGETS += $(BUILDDIR)/ref_softx.$(SHLIBEXT)
+- endif
+-
+- ifeq ($(strip $(BUILD_GLX)),YES)
+- $(warning Warning: GLX support not supported for $(ARCH))
+- endif
+-
+- ifeq ($(strip $(BUILD_FXGL)),YES)
+- $(warning Warning: FXGL support not supported for $(ARCH))
+- endif
+-
+- ifeq ($(strip $(BUILD_SDL)),YES)
+- TARGETS += $(BUILDDIR)/ref_softsdl.$(SHLIBEXT)
+- endif
+-
+- ifeq ($(strip $(BUILD_SDLGL)),YES)
+- $(warning Warning: SDLGL support not supported for $(ARCH))
+- endif
+-endif # ARCH sparc
+-
+-ifeq ($(ARCH),i386)
+- ifeq ($(strip $(BUILD_SDLQUAKE2)),YES)
+- TARGETS += $(BUILDDIR)/sdlquake2
+- endif
+-
+- ifeq ($(strip $(BUILD_SVGA)),YES)
+- TARGETS += $(BUILDDIR)/ref_soft.$(SHLIBEXT)
+- endif
+-
+- ifeq ($(strip $(BUILD_X11)),YES)
+- TARGETS += $(BUILDDIR)/ref_softx.$(SHLIBEXT)
+- endif
+-
+- ifeq ($(strip $(BUILD_GLX)),YES)
+- TARGETS += $(BUILDDIR)/ref_glx.$(SHLIBEXT)
+- endif
+-
+- ifeq ($(strip $(BUILD_FXGL)),YES)
+- TARGETS += $(BUILDDIR)/ref_gl.$(SHLIBEXT)
+- endif
+-
+- ifeq ($(strip $(BUILD_SDL)),YES)
+- TARGETS += $(BUILDDIR)/ref_softsdl.$(SHLIBEXT)
+- endif
+-
+- ifeq ($(strip $(BUILD_SDLGL)),YES)
+- TARGETS += $(BUILDDIR)/ref_sdlgl.$(SHLIBEXT)
+- endif
+-endif # ARCH i386
+-
+ ifeq ($(strip $(BUILD_AA)),YES)
+ TARGETS += $(BUILDDIR)/ref_softaa.$(SHLIBEXT)
+ endif
+@@ -437,10 +322,11 @@
+ $(BUILDDIR)/client/snd_sdl.o
+
+ ifeq ($(ARCH),i386)
++ifneq ($(strip $(NO_X86_ASM)),YES)
+ QUAKE2_AS_OBJS = \
+ $(BUILDDIR)/client/snd_mixa.o
+ else
+-QUAKE2_AS_OBJS = #blank
++endif
+ endif
+
+ $(BUILDDIR)/quake2 : $(QUAKE2_OBJS) $(QUAKE2_LNX_OBJS) $(QUAKE2_AS_OBJS)
+@@ -626,7 +512,7 @@
+ $(BUILDDIR)/ded/q_shlinux.o \
+ $(BUILDDIR)/ded/sys_linux.o \
+ $(BUILDDIR)/ded/glob.o \
+- $(BUILDDIR)/ded/net_udp.o \
++ $(BUILDDIR)/ded/$(NET_UDP).o \
+ $(BUILDDIR)/ded/q_shared.o \
+ $(BUILDDIR)/ded/pmove.o \
+ $(BUILDDIR)/ded/cl_null.o \
+@@ -701,6 +587,9 @@
+ $(BUILDDIR)/ded/net_udp.o : $(LINUX_DIR)/net_udp.c
+ $(DO_DED_CC)
+
++$(BUILDDIR)/ded/net_udp6.o : $(LINUX_DIR)/net_udp6.c
++ $(DO_DED_CC)
++
+ $(BUILDDIR)/ded/cd_null.o : $(NULL_DIR)/cd_null.c
+ $(DO_DED_CC)
+
+@@ -1525,6 +1414,7 @@
+ $(BUILDDIR)/ref_soft/glob.o
+
+ ifeq ($(ARCH),i386)
++ifneq ($(strip $(NO_X86_ASM)),YES)
+ REF_SOFT_OBJS += \
+ $(BUILDDIR)/ref_soft/r_aclipa.o \
+ $(BUILDDIR)/ref_soft/r_draw16.o \
+@@ -1538,6 +1428,7 @@
+ $(BUILDDIR)/ref_soft/r_varsa.o \
+ $(BUILDDIR)/ref_soft/sys_dosa.o
+ endif
++endif
+
+ REF_SOFT_SVGA_OBJS = \
+ $(BUILDDIR)/ref_soft/rw_svgalib.o \
+@@ -1667,10 +1558,10 @@
+ $(DO_SHLIB_AS)
+
+ $(BUILDDIR)/ref_soft/rw_svgalib.o : $(LINUX_DIR)/rw_svgalib.c
+- $(DO_SHLIB_CC)
++ $(DO_SHLIB_CC) $(SVGACFLAGS)
+
+ $(BUILDDIR)/ref_soft/rw_in_svgalib.o : $(LINUX_DIR)/rw_in_svgalib.c
+- $(DO_SHLIB_CC)
++ $(DO_SHLIB_CC) $(SVGACFLAGS)
+
+ $(BUILDDIR)/ref_soft/rw_x11.o : $(LINUX_DIR)/rw_x11.c
+ $(DO_SHLIB_CC) $(XCFLAGS)
+@@ -1679,10 +1570,10 @@
+ $(DO_SHLIB_CC) $(SDLCFLAGS)
+
+ $(BUILDDIR)/ref_soft/rw_aa.o : $(LINUX_DIR)/rw_aa.c
+- $(DO_SHLIB_CC)
++ $(DO_SHLIB_CC) $(AACFLAGS)
+
+ $(BUILDDIR)/ref_soft/rw_in_aa.o : $(LINUX_DIR)/rw_in_aa.c
+- $(DO_SHLIB_CC)
++ $(DO_SHLIB_CC) $(AACFLAGS)
+
+ #############################################################################
+ # REF_GL
diff --git a/games/quake2lnx/files/patch-src::client::cl_fx.c b/games/quake2lnx/files/patch-src::client::cl_fx.c
new file mode 100644
index 000000000000..a1da485a1ecc
--- /dev/null
+++ b/games/quake2lnx/files/patch-src::client::cl_fx.c
@@ -0,0 +1,11 @@
+--- src/client/cl_fx.c.orig Thu Jun 12 14:24:20 2003
++++ src/client/cl_fx.c Thu Jun 12 14:24:42 2003
+@@ -1507,7 +1507,7 @@
+ */
+ #ifdef QMAX
+ void CL_FlagTrail (vec3_t start, vec3_t end, boolean isred)
+-#else)
++#else
+ void CL_FlagTrail (vec3_t start, vec3_t end, float color)
+ #endif
+ {
diff --git a/games/quake2lnx/files/patch-src::client::cl_fxmax.c b/games/quake2lnx/files/patch-src::client::cl_fxmax.c
new file mode 100644
index 000000000000..574c30595f03
--- /dev/null
+++ b/games/quake2lnx/files/patch-src::client::cl_fxmax.c
@@ -0,0 +1,43 @@
+--- src/client/cl_fxmax.c.orig Thu Jun 12 14:32:17 2003
++++ src/client/cl_fxmax.c Thu Jun 12 14:34:33 2003
+@@ -1733,7 +1733,6 @@
+
+ void CL_Disruptor_Explosion_Particle (vec3_t org, float size)
+ {
+- int i;
+ float alphastart = 1,
+ alphadecel = -5;
+ cparticle_t *p;
+@@ -1817,7 +1816,7 @@
+ {
+ float length;
+ int i;
+- vec3_t len, ang;
++ vec3_t len;
+
+ VectorSubtract(p->angle, org, len);
+ {
+@@ -2194,7 +2193,6 @@
+
+ void pSparksThink (cparticle_t *p, vec3_t org, vec3_t angle, float *alpha, float *size, int *image, float *time)
+ {
+- vec3_t dir;
+ int i;
+
+ //setting up angle for sparks
+@@ -2523,7 +2521,6 @@
+ #define pBlasterMaxSize 5
+ void pBlasterThink (cparticle_t *p, vec3_t org, vec3_t angle, float *alpha, float *size, int *image, float *time)
+ {
+- int i;
+ vec3_t len;
+ VectorSubtract(p->angle, org, len);
+
+@@ -3038,7 +3035,6 @@
+ vec3_t vec, point;
+ int i;
+ float len;
+- float dec;
+ vec3_t right, up;
+ qboolean colored = (cl_railtype->value!=1);
+
diff --git a/games/quake2lnx/files/patch-src::client::cl_newfx.c b/games/quake2lnx/files/patch-src::client::cl_newfx.c
new file mode 100644
index 000000000000..d5628a3837c1
--- /dev/null
+++ b/games/quake2lnx/files/patch-src::client::cl_newfx.c
@@ -0,0 +1,85 @@
+--- src/client/cl_newfx.c.orig Thu Jun 12 14:36:30 2003
++++ src/client/cl_newfx.c Thu Jun 12 14:58:25 2003
+@@ -143,7 +143,9 @@
+ vec3_t vec;
+ float len;
+ // int j;
++#ifndef QMAX
+ cparticle_t *p;
++#endif
+ float dec;
+ vec3_t right, up;
+ // int i;
+@@ -266,11 +268,12 @@
+ vec3_t vec;
+ #ifdef QMAX
+ vec3_t color = { color8red(color8), color8green(color8), color8blue(color8)};
++#else
++ int j;
++ cparticle_t *p;
+ #endif
+
+ float len;
+- int j;
+- cparticle_t *p;
+
+ VectorCopy (start, move);
+ VectorSubtract (end, start, vec);
+@@ -448,8 +451,11 @@
+ vec3_t move;
+ vec3_t vec;
+ float len;
+- int i, j;
++ int i;
++#ifndef QMAX
++ int j;
+ cparticle_t *p;
++#endif
+ float dec;
+
+ VectorCopy (start, move);
+@@ -1062,7 +1068,9 @@
+ vec3_t dir;
+ int i;
+ cparticle_t *p;
++#ifndef QMAX
+ static int colortable[4] = {2*8,13*8,21*8,18*8};
++#endif
+ float ratio;
+
+ ratio = 1.0 - (((float)self->endtime - (float)cl.time)/2100.0);
+@@ -1099,7 +1107,9 @@
+ vec3_t dir;
+ int i;
+ cparticle_t *p;
++#ifndef QMAX
+ static int colortable[4] = {110, 112, 114, 116};
++#endif
+ float ratio;
+
+ ratio = 1.0 - (((float)self->endtime - (float)cl.time)/1000.0);
+@@ -1133,7 +1143,9 @@
+
+ void CL_WidowSplash (vec3_t org)
+ {
++#ifndef QMAX
+ static int colortable[4] = {2*8,13*8,21*8,18*8};
++#endif
+ int i;
+ cparticle_t *p;
+ vec3_t dir;
+@@ -1260,10 +1272,12 @@
+ */
+ void CL_ColorExplosionParticles (vec3_t org, int color8, int run)
+ {
+- int i, j;
+- cparticle_t *p;
++ int i;
+ #ifdef QMAX
+ vec3_t color = { color8red(color8), color8green(color8), color8blue(color8)};
++#else
++ int j;
++ cparticle_t *p;
+ #endif
+ for (i=0 ; i<128 ; i++)
+ {
diff --git a/games/quake2lnx/files/patch-src::client::cl_view.c b/games/quake2lnx/files/patch-src::client::cl_view.c
new file mode 100644
index 000000000000..937fff2d4cef
--- /dev/null
+++ b/games/quake2lnx/files/patch-src::client::cl_view.c
@@ -0,0 +1,12 @@
+--- src/client/cl_view.c.orig Thu Jun 12 14:25:46 2003
++++ src/client/cl_view.c Thu Jun 12 14:26:07 2003
+@@ -470,7 +470,9 @@
+ */
+ void SCR_DrawCrosshair (void)
+ {
++#ifdef QMAX
+ float scale;
++#endif
+ if (!crosshair->value)
+ return;
+
diff --git a/games/quake2lnx/files/patch-src::client::snd_mix.c b/games/quake2lnx/files/patch-src::client::snd_mix.c
new file mode 100644
index 000000000000..c295644afe3a
--- /dev/null
+++ b/games/quake2lnx/files/patch-src::client::snd_mix.c
@@ -0,0 +1,20 @@
+--- src/client/snd_mix.c.orig Wed Oct 9 03:54:25 2002
++++ src/client/snd_mix.c Thu Jun 12 15:16:54 2003
+@@ -30,7 +30,7 @@
+
+ void S_WriteLinearBlastStereo16 (void);
+
+-#if !((defined __linux__ || defined __FreeBSD__) && defined __i386__)
++#if !((defined __linux__ || defined __FreeBSD__) && defined __i386__) || defined C_ONLY
+ #if !id386
+
+ void S_WriteLinearBlastStereo16 (void)
+@@ -362,7 +362,7 @@
+ }
+
+
+-#if !((defined __linux__ || __FreeBSD__) && defined __i386__)
++#if !((defined __linux__ || __FreeBSD__) && defined __i386__) || defined C_ONLY
+ #if !id386
+
+ void S_PaintChannelFrom8 (channel_t *ch, sfxcache_t *sc, int count, int offset)
diff --git a/games/quake2lnx/files/patch-src::linux::gl_glx.c b/games/quake2lnx/files/patch-src::linux::gl_glx.c
new file mode 100644
index 000000000000..fbbfbea08fb9
--- /dev/null
+++ b/games/quake2lnx/files/patch-src::linux::gl_glx.c
@@ -0,0 +1,183 @@
+--- src/linux/gl_glx.c.orig Thu Oct 10 01:29:47 2002
++++ src/linux/gl_glx.c Mon Jun 16 23:19:21 2003
+@@ -40,7 +40,6 @@
+ #include <signal.h>
+ #include <dlfcn.h>
+ #ifdef Joystick
+-#include <sys/stat.h>
+ #include <fcntl.h>
+ #endif
+ #include "../ref_gl/gl_local.h"
+@@ -58,7 +57,11 @@
+ #include <X11/extensions/xf86dga.h>
+ #include <X11/extensions/xf86vmode.h>
+ #ifdef Joystick
+-#include <linux/joystick.h>
++# if defined(__linux__)
++# include <linux/joystick.h>
++# elif defined(__FreeBSD__)
++# include <sys/joystick.h>
++# endif
+ #include <glob.h>
+ #endif
+ #include <GL/glx.h>
+@@ -87,18 +90,19 @@
+ #ifdef Joystick
+ static cvar_t *in_joystick;
+ static qboolean joystick_avail = false;
+-static int joy_fd, jx, jy, jt;
++static int joy_fd, jx, jy, center_jx, center_jy;
+ static cvar_t *j_invert_y;
++static cvar_t *j_sensitivity;
+ #endif
+
+ #ifdef Joystick
+ void InitJoystick() {
+ int i, err;
+ glob_t pglob;
+- struct js_event e;
++ struct joystick j;
+
+ joystick_avail = false;
+- err = glob("/dev/js*", 0, NULL, &pglob);
++ err = glob("/dev/joy*", 0, NULL, &pglob);
+
+ if (err) {
+ switch (err) {
+@@ -111,7 +115,7 @@
+ default:
+ ri.Con_Printf(PRINT_ALL, "Error #%d while looking for joysticks\n",err);
+ }
+- return;
++ goto out;
+ }
+
+ for (i=0;i<pglob.gl_pathc;i++) {
+@@ -121,15 +125,14 @@
+ ri.Con_Printf(PRINT_ALL, "Error opening joystick dev %s\n",
+ pglob.gl_pathv[i]);
+ }
+- else {
+- while (read(joy_fd, &e, sizeof(struct js_event))!=-1 &&
+- (e.type & JS_EVENT_INIT))
+- ri.Con_Printf(PRINT_ALL, "Read init event\n");
+- ri.Con_Printf(PRINT_ALL, "Using joystick dev %s\n", pglob.gl_pathv[i]);
++ else if (read(joy_fd, &j, sizeof(struct joystick)) != -1) {
++ ri.Con_Printf(PRINT_ALL, "Using joystick dev %s\n", pglob.gl_pathv[i]);
+ joystick_avail = true;
+- return;
++ center_jx = j.x; center_jy = j.y;
++ break;
+ }
+ }
++out:
+ globfree(&pglob);
+ }
+ #endif
+@@ -288,6 +291,7 @@
+ #ifdef Joystick
+ in_joystick = ri.Cvar_Get ("in_joystick", "1", CVAR_ARCHIVE);
+ j_invert_y = ri.Cvar_Get ("j_invert_y", "1", CVAR_ARCHIVE);
++ j_sensitivity = ri.Cvar_Get ("j_sensitivity", "3", 0);
+ #endif
+
+ // mouse variables
+@@ -342,8 +346,7 @@
+ {
+ int i;
+ #ifdef Joystick
+- struct js_event e;
+- int key_index;
++ struct joystick j;
+ #endif
+ if (mouse_avail) {
+ for (i=0 ; i<3 ; i++) {
+@@ -356,31 +359,18 @@
+ mouse_oldbuttonstate = mouse_buttonstate;
+ }
+ #ifdef Joystick
++ /* FreeBSD does not fully support multi-buttoned joysticks */
+ if (joystick_avail) {
+- while (read(joy_fd, &e, sizeof(struct js_event))!=-1) {
+- if (JS_EVENT_BUTTON & e.type) {
+- key_index = (e.number < 4) ? K_JOY1 : K_AUX1;
+- if (e.value) {
+- in_state->Key_Event_fp (key_index + e.number, true);
+- }
+- else {
+- in_state->Key_Event_fp (key_index + e.number, false);
+- }
+- //joy_oldbuttonstate = e.number;
+- }
+- else if (JS_EVENT_AXIS & e.type) {
+- switch (e.number) {
+- case 0:
+- jx = e.value;
+- break;
+- case 1:
+- jy = e.value;
+- break;
+- case 3:
+- jt = e.value;
+- break;
+- }
+- }
++ if (read(joy_fd, &j, sizeof(struct joystick)) != -1) {
++ if (j.b1)
++ in_state->Key_Event_fp (K_JOY1, true);
++ else
++ in_state->Key_Event_fp (K_JOY1, false);
++ if (j.b2)
++ in_state->Key_Event_fp (K_JOY2, true);
++ else
++ in_state->Key_Event_fp (K_JOY2, false);
++ jx = j.x; jy = j.y;
+ }
+ }
+ #endif
+@@ -393,7 +383,11 @@
+ */
+ void RW_IN_Move (usercmd_t *cmd)
+ {
+- if (!mouse_avail)
++ if (!mouse_avail
++#ifdef Joystick
++ && !joystick_avail
++#endif
++ )
+ return;
+
+ if (m_filter->value)
+@@ -429,25 +423,26 @@
+
+ #ifdef Joystick
+ if (joystick_avail) {
++ int djx = (jx - center_jx) * j_sensitivity->value / 10,
++ djy = (jy - center_jy) * j_sensitivity->value / 10;
+ // add joy X/Y movement to cmd
+ if ( (*in_state->in_strafe_state & 1) ||
+ (lookstrafe->value && mlooking ))
+- cmd->sidemove += m_side->value * (jx/100);
++ cmd->sidemove += m_side->value * djx;
+ else
+- in_state->viewangles[YAW] -= m_yaw->value * (jx/100);
++ in_state->viewangles[YAW] -= m_yaw->value * djx;
+
+ if ( (mlooking || freelook->value) &&
+ !(*in_state->in_strafe_state & 1))
+ {
+ if (j_invert_y)
+- in_state->viewangles[PITCH] -= m_pitch->value * (jy/100);
++ in_state->viewangles[PITCH] -= m_pitch->value * djy;
+ else
+- in_state->viewangles[PITCH] += m_pitch->value * (jy/100);
+- cmd->forwardmove -= m_forward->value * (jt/100);
++ in_state->viewangles[PITCH] += m_pitch->value * djy;
+ }
+ else
+ {
+- cmd->forwardmove -= m_forward->value * (jy/100);
++ cmd->forwardmove -= m_forward->value * djy;
+ }
+ }
+ #endif
diff --git a/games/quake2lnx/files/patch-src::linux::rw_aa.c b/games/quake2lnx/files/patch-src::linux::rw_aa.c
new file mode 100644
index 000000000000..9e3db53af38d
--- /dev/null
+++ b/games/quake2lnx/files/patch-src::linux::rw_aa.c
@@ -0,0 +1,30 @@
+--- src/linux/rw_aa.c.orig Thu Jun 12 18:26:51 2003
++++ src/linux/rw_aa.c Thu Jun 12 18:30:59 2003
+@@ -53,15 +53,18 @@
+ */
+
+ #include <termios.h>
++#include <unistd.h>
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
+-#include <sys/vt.h>
+ #include <stdarg.h>
+ #include <stdio.h>
+ #include <signal.h>
+ #include <sys/mman.h>
+ #include <dlfcn.h>
++#ifdef __linux__
++#include <sys/vt.h>
+ #include <asm/io.h>
++#endif
+
+ #include <aalib.h>
+
+@@ -240,7 +243,6 @@
+ */
+ void SWimp_SetPalette( const unsigned char *palette )
+ {
+- static int tmppal[256*3];
+ const unsigned char *pal;
+ int i;
+
diff --git a/games/quake2lnx/files/patch-src::linux::rw_in_aa.c b/games/quake2lnx/files/patch-src::linux::rw_in_aa.c
new file mode 100644
index 000000000000..dfc466519b5c
--- /dev/null
+++ b/games/quake2lnx/files/patch-src::linux::rw_in_aa.c
@@ -0,0 +1,19 @@
+--- src/linux/rw_in_aa.c.orig Thu Jun 12 18:31:47 2003
++++ src/linux/rw_in_aa.c Thu Jun 12 18:32:19 2003
+@@ -40,13 +40,14 @@
+ #include <termios.h>
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
+-#include <sys/vt.h>
+ #include <stdarg.h>
+ #include <stdio.h>
+ #include <signal.h>
+ #include <sys/mman.h>
+-
++#ifdef __linux__
++#include <sys/vt.h>
+ #include <asm/io.h>
++#endif
+
+ #include <aalib.h>
+
diff --git a/games/quake2lnx/files/patch-src::linux::rw_in_svgalib.c b/games/quake2lnx/files/patch-src::linux::rw_in_svgalib.c
new file mode 100644
index 000000000000..255532e3b1d6
--- /dev/null
+++ b/games/quake2lnx/files/patch-src::linux::rw_in_svgalib.c
@@ -0,0 +1,273 @@
+--- src/linux/rw_in_svgalib.c.orig Wed Oct 9 03:54:25 2002
++++ src/linux/rw_in_svgalib.c Mon Jun 16 23:00:10 2003
+@@ -20,11 +20,23 @@
+ #include <termios.h>
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
++#ifdef __linux__
+ #include <sys/vt.h>
++#endif
+ #include <stdarg.h>
+ #include <stdio.h>
+ #include <signal.h>
+ #include <sys/mman.h>
++#ifdef Joystick
++# if defined(__linux__)
++# include <linux/joystick.h>
++# elif defined(__FreeBSD__)
++# include <sys/joystick.h>
++# endif
++#include <fcntl.h>
++#include <glob.h>
++#include <unistd.h>
++#endif
+
+ #include "vga.h"
+ #include "vgakeyboard.h"
+@@ -145,26 +157,22 @@
+ // 84 to 86 not used
+ scantokey[ 87] = K_F11;
+ scantokey[ 88] = K_F12;
+- // 89 to 95 not used
+- scantokey[ 96] = K_KP_ENTER; //keypad enter
+- scantokey[ 97] = K_CTRL; //right
+- scantokey[ 98] = K_KP_SLASH;
+- scantokey[ 99] = K_F12; // print screen, bind to screenshot by default
+- scantokey[100] = K_ALT; // right
+-
+- scantokey[101] = K_PAUSE; // break
+- scantokey[102] = K_HOME;
+- scantokey[103] = K_UPARROW;
+- scantokey[104] = K_PGUP;
+- scantokey[105] = K_LEFTARROW;
+- scantokey[106] = K_RIGHTARROW;
+- scantokey[107] = K_END;
+- scantokey[108] = K_DOWNARROW;
+- scantokey[109] = K_PGDN;
+- scantokey[110] = K_INS;
+- scantokey[111] = K_DEL;
+-
+- scantokey[119] = K_PAUSE;
++ scantokey[ 89] = K_KP_ENTER; //keypad enter
++ scantokey[ 90] = K_CTRL; //right
++ scantokey[ 91] = K_KP_SLASH;
++ scantokey[ 92] = K_F12; // print screen, bind to screenshot by default
++ scantokey[ 93] = K_ALT; // right
++ scantokey[ 94] = K_HOME;
++ scantokey[ 95] = K_UPARROW;
++ scantokey[ 96] = K_PGUP;
++ scantokey[ 97] = K_LEFTARROW;
++ scantokey[ 98] = K_RIGHTARROW;
++ scantokey[ 99] = K_END;
++ scantokey[100] = K_DOWNARROW;
++ scantokey[101] = K_PGDN;
++ scantokey[102] = K_INS;
++ scantokey[103] = K_DEL;
++ scantokey[104] = K_PAUSE;
+
+ if (keyboard_init())
+ Sys_Error("keyboard_init() failed");
+@@ -184,7 +192,7 @@
+ }
+
+ /*****************************************************************************/
+-/* MOUSE */
++/* MOUSE AND JOYSTICK */
+ /*****************************************************************************/
+
+ // this is inside the renderer shared lib, so these are called from vid_so
+@@ -207,6 +215,14 @@
+ static cvar_t *mdev;
+ static cvar_t *mrate;
+
++#ifdef Joystick
++static cvar_t *in_joystick;
++static qboolean joystick_avail = false;
++static int joy_fd, jx, jy, center_jx, center_jy;
++static cvar_t *j_invert_y;
++static cvar_t *j_sensitivity;
++#endif
++
+ static qboolean mlooking;
+
+ // state struct passed in Init
+@@ -254,6 +270,49 @@
+ }
+ #endif
+
++#ifdef Joystick
++void
++InitJoystick()
++{
++ int i, err;
++ glob_t pglob;
++ struct joystick j;
++
++ err = glob("/dev/joy*", 0, NULL, &pglob);
++
++ if (err) {
++ switch (err) {
++ case GLOB_NOSPACE:
++ ri.Con_Printf(PRINT_ALL, "Error, out of memory while looking for joysticks\n");
++ break;
++ case GLOB_NOMATCH:
++ ri.Con_Printf(PRINT_ALL, "No joysticks found\n");
++ break;
++ default:
++ ri.Con_Printf(PRINT_ALL, "Error #%d while looking for joysticks\n", err);
++ }
++ goto out;
++ }
++
++ for (i = 0; i < pglob.gl_pathc; i++) {
++ ri.Con_Printf(PRINT_ALL, "Trying joystick dev %s\n", pglob.gl_pathv[i]);
++ joy_fd = open(pglob.gl_pathv[i], O_RDONLY | O_NONBLOCK);
++ if (joy_fd == -1) {
++ ri.Con_Printf(PRINT_ALL, "Error opening joystick dev %s\n",
++ pglob.gl_pathv[i]);
++ }
++ else if (read(joy_fd, &j, sizeof(struct joystick)) != -1) {
++ ri.Con_Printf(PRINT_ALL, "Using joystick dev %s\n", pglob.gl_pathv[i]);
++ joystick_avail = true;
++ center_jx = j.x; center_jy = j.y;
++ break;
++ }
++ }
++out:
++ globfree(&pglob);
++}
++#endif
++
+ void RW_IN_Init(in_state_t *in_state_p)
+ {
+ int mtype;
+@@ -262,7 +321,12 @@
+
+ // mouse variables
+ m_filter = ri.Cvar_Get ("m_filter", "0", 0);
+- in_mouse = ri.Cvar_Get ("in_mouse", "1", CVAR_ARCHIVE);
++ in_mouse = ri.Cvar_Get ("in_mouse", "1", CVAR_ARCHIVE);
++#ifdef Joystick
++ in_joystick = ri.Cvar_Get ("in_joystick", "1", CVAR_ARCHIVE);
++ j_invert_y = ri.Cvar_Get ("j_invert_y", "1", CVAR_ARCHIVE);
++ j_sensitivity = ri.Cvar_Get ("j_sensitivity", "3", 0);
++#endif
+ freelook = ri.Cvar_Get( "freelook", "0", 0 );
+ lookstrafe = ri.Cvar_Get ("lookstrafe", "0", 0);
+ sensitivity = ri.Cvar_Get ("sensitivity", "3", 0);
+@@ -293,11 +357,20 @@
+ }
+ else
+ mouse_seteventhandler(mousehandler);
++#ifdef Joystick
++ if (in_joystick)
++ InitJoystick();
++#endif
+ }
+
+ void RW_IN_Shutdown(void)
+ {
+ mouse_close();
++#ifdef Joystick
++ if (joystick_avail)
++ if (close(joy_fd))
++ ri.Con_Printf(PRINT_ALL, "Error, problem closing joystick\n");
++#endif
+ }
+
+ /*
+@@ -307,7 +380,14 @@
+ */
+ void RW_IN_Commands (void)
+ {
+- if (!UseMouse)
++#ifdef Joystick
++ struct joystick j;
++#endif
++ if (!UseMouse
++#ifdef Joystick
++ && !joystick_avail
++#endif
++ )
+ return;
+
+ // poll mouse values
+@@ -346,6 +426,23 @@
+ in_state->Key_Event_fp (K_MWHEELDOWN, false);
+ }
+ mwheel = 0;
++
++#ifdef Joystick
++ /* FreeBSD does not fully support multi-buttoned joysticks */
++ if (joystick_avail) {
++ if (read(joy_fd, &j, sizeof(struct joystick)) != -1) {
++ if (j.b1)
++ in_state->Key_Event_fp (K_JOY1, true);
++ else
++ in_state->Key_Event_fp (K_JOY1, false);
++ if (j.b2)
++ in_state->Key_Event_fp (K_JOY2, true);
++ else
++ in_state->Key_Event_fp (K_JOY2, false);
++ jx = j.x; jy = j.y;
++ }
++ }
++#endif
+ }
+
+ /*
+@@ -355,7 +452,11 @@
+ */
+ void RW_IN_Move (usercmd_t *cmd)
+ {
+- if (!UseMouse)
++ if (!UseMouse
++#ifdef Joystick
++ && !joystick_avail
++#endif
++ )
+ return;
+
+ // poll mouse values
+@@ -374,7 +475,11 @@
+ old_mouse_x = mx;
+ old_mouse_y = my;
+
+- if (!mx && !my)
++ if (!mx && !my
++#ifdef Joystick
++ && !joystick_avail
++#endif
++ )
+ return;
+
+ mx = my = 0; // clear for next update
+@@ -398,6 +503,28 @@
+ {
+ cmd->forwardmove -= m_forward->value * mouse_y;
+ }
++
++#ifdef Joystick
++ if (joystick_avail) {
++ int djx = (jx - center_jx) * j_sensitivity->value / 10,
++ djy = (jy - center_jy) * j_sensitivity->value / 10;
++// add joy X/Y movement to cmd
++ if ((*in_state->in_strafe_state & 1) ||
++ (lookstrafe->value && mlooking))
++ cmd->sidemove += m_side->value * djx;
++ else
++ in_state->viewangles[YAW] -= m_yaw->value * djx;
++
++ if ((mlooking || freelook->value) &&
++ !(*in_state->in_strafe_state & 1)) {
++ if (j_invert_y)
++ in_state->viewangles[PITCH] -= m_pitch->value * djy;
++ else
++ in_state->viewangles[PITCH] += m_pitch->value * djy;
++ }
++ else cmd->forwardmove -= m_forward->value * djy;
++ }
++#endif
+ }
+
+ void RW_IN_Frame (void)
diff --git a/games/quake2lnx/files/patch-src::linux::rw_sdl.c b/games/quake2lnx/files/patch-src::linux::rw_sdl.c
new file mode 100644
index 000000000000..7b3989bd2da8
--- /dev/null
+++ b/games/quake2lnx/files/patch-src::linux::rw_sdl.c
@@ -0,0 +1,14 @@
+--- src/linux/rw_sdl.c.orig Wed Jun 18 08:01:40 2003
++++ src/linux/rw_sdl.c Wed Jun 18 08:02:13 2003
+@@ -190,7 +190,10 @@
+ */
+ void RW_IN_Commands (void)
+ {
+- int i, key_index;
++ int i;
++#ifdef Joystick
++ int key_index;
++#endif
+
+ if (mouse_avail) {
+ for (i=0 ; i<3 ; i++) {
diff --git a/games/quake2lnx/files/patch-src::linux::rw_svgalib.c b/games/quake2lnx/files/patch-src::linux::rw_svgalib.c
new file mode 100644
index 000000000000..a9937ff476b3
--- /dev/null
+++ b/games/quake2lnx/files/patch-src::linux::rw_svgalib.c
@@ -0,0 +1,12 @@
+--- src/linux/rw_svgalib.c.orig Thu Jun 12 18:41:01 2003
++++ src/linux/rw_svgalib.c Thu Jun 12 18:41:41 2003
+@@ -36,7 +36,9 @@
+ #include <termios.h>
+ #include <sys/ioctl.h>
+ #include <sys/stat.h>
++#ifdef __linux__
+ #include <sys/vt.h>
++#endif
+ #include <stdarg.h>
+ #include <stdio.h>
+ #include <signal.h>
diff --git a/games/quake2lnx/files/patch-src::linux::rw_x11.c b/games/quake2lnx/files/patch-src::linux::rw_x11.c
new file mode 100644
index 000000000000..3472cb66844e
--- /dev/null
+++ b/games/quake2lnx/files/patch-src::linux::rw_x11.c
@@ -0,0 +1,171 @@
+--- src/linux/rw_x11.c.orig Wed Oct 9 03:54:25 2002
++++ src/linux/rw_x11.c Mon Jun 16 23:19:40 2003
+@@ -36,7 +36,6 @@
+ #include <sys/time.h>
+ #include <sys/types.h>
+ #ifdef Joystick
+-#include <sys/stat.h>
+ #include <fcntl.h>
+ #endif
+ #include <unistd.h>
+@@ -58,7 +57,11 @@
+ #include <X11/extensions/xf86vmode.h>
+ #endif
+ #ifdef Joystick
+-#include <linux/joystick.h>
++# if defined(__linux__)
++# include <linux/joystick.h>
++# elif defined(__FreeBSD__)
++# include <sys/joystick.h>
++# endif
+ #include <glob.h>
+ #endif
+
+@@ -317,8 +320,9 @@
+ #ifdef Joystick
+ static cvar_t *in_joystick;
+ static qboolean joystick_avail = false;
+-static int joy_fd, jx, jy, jt;
++static int joy_fd, jx, jy, center_jx, center_jy;
+ static cvar_t *j_invert_y;
++static cvar_t *j_sensitivity;
+ #endif
+
+ static qboolean mlooking;
+@@ -357,10 +361,10 @@
+ void InitJoystick() {
+ int i, err;
+ glob_t pglob;
+- struct js_event e;
++ struct joystick j;
+
+ joystick_avail = false;
+- err = glob("/dev/js*", 0, NULL, &pglob);
++ err = glob("/dev/joy*", 0, NULL, &pglob);
+
+ if (err) {
+ switch (err) {
+@@ -373,7 +377,7 @@
+ default:
+ ri.Con_Printf(PRINT_ALL, "Error #%d while looking for joysticks\n",err);
+ }
+- return;
++ goto out;
+ }
+
+ for (i=0;i<pglob.gl_pathc;i++) {
+@@ -383,15 +387,14 @@
+ ri.Con_Printf(PRINT_ALL, "Error opening joystick dev %s\n",
+ pglob.gl_pathv[i]);
+ }
+- else {
+- while (read(joy_fd, &e, sizeof(struct js_event))!=-1 &&
+- (e.type & JS_EVENT_INIT))
+- ri.Con_Printf(PRINT_ALL, "Read init event\n");
+- ri.Con_Printf(PRINT_ALL, "Using joystick dev %s\n", pglob.gl_pathv[i]);
++ else if (read(joy_fd, &j, sizeof(struct joystick)) != -1) {
++ ri.Con_Printf(PRINT_ALL, "Using joystick dev %s\n", pglob.gl_pathv[i]);
+ joystick_avail = true;
+- return;
++ center_jx = j.x; center_jy = j.y;
++ break;
+ }
+ }
++out:
+ globfree(&pglob);
+ }
+ #endif
+@@ -407,6 +410,7 @@
+ #ifdef Joystick
+ in_joystick = ri.Cvar_Get ("in_joystick", "1", CVAR_ARCHIVE);
+ j_invert_y = ri.Cvar_Get ("j_invert_y", "1", CVAR_ARCHIVE);
++ j_sensitivity = ri.Cvar_Get ("j_sensitivity", "3", 0);
+ #endif
+ freelook = ri.Cvar_Get( "freelook", "0", 0 );
+ lookstrafe = ri.Cvar_Get ("lookstrafe", "0", 0);
+@@ -442,8 +446,7 @@
+ {
+ int i;
+ #ifdef Joystick
+- struct js_event e;
+- int key_index;
++ struct joystick j;
+ #endif
+ if (mouse_avail) {
+ for (i=0 ; i<3 ; i++) {
+@@ -456,31 +459,18 @@
+ mouse_oldbuttonstate = mouse_buttonstate;
+ }
+ #ifdef Joystick
++ /* FreeBSD does not fully support multi-buttoned joysticks */
+ if (joystick_avail) {
+- while (read(joy_fd, &e, sizeof(struct js_event))!=-1) {
+- if (JS_EVENT_BUTTON & e.type) {
+- key_index = (e.number < 4) ? K_JOY1 : K_AUX1;
+- if (e.value) {
+- in_state->Key_Event_fp (key_index + e.number, true);
+- }
+- else {
+- in_state->Key_Event_fp (key_index + e.number, false);
+- }
+- //joy_oldbuttonstate = e.number;
+- }
+- else if (JS_EVENT_AXIS & e.type) {
+- switch (e.number) {
+- case 0:
+- jx = e.value;
+- break;
+- case 1:
+- jy = e.value;
+- break;
+- case 3:
+- jt = e.value;
+- break;
+- }
+- }
++ if (read(joy_fd, &j, sizeof(struct joystick)) != -1) {
++ if (j.b1)
++ in_state->Key_Event_fp (K_JOY1, true);
++ else
++ in_state->Key_Event_fp (K_JOY1, false);
++ if (j.b2)
++ in_state->Key_Event_fp (K_JOY2, true);
++ else
++ in_state->Key_Event_fp (K_JOY2, false);
++ jx = j.x; jy = j.y;
+ }
+ }
+ #endif
+@@ -542,25 +532,26 @@
+ }
+ #ifdef Joystick
+ if (joystick_avail) {
++ int djx = (jx - center_jx) * j_sensitivity->value / 10,
++ djy = (jy - center_jy) * j_sensitivity->value / 10;
+ // add joy X/Y movement to cmd
+ if ( (*in_state->in_strafe_state & 1) ||
+ (lookstrafe->value && mlooking ))
+- cmd->sidemove += m_side->value * (jx/100);
++ cmd->sidemove += m_side->value * djx;
+ else
+- in_state->viewangles[YAW] -= m_yaw->value * (jx/100);
++ in_state->viewangles[YAW] -= m_yaw->value * djx;
+
+ if ( (mlooking || freelook->value) &&
+ !(*in_state->in_strafe_state & 1))
+ {
+ if (j_invert_y)
+- in_state->viewangles[PITCH] -= m_pitch->value * (jy/100);
++ in_state->viewangles[PITCH] -= m_pitch->value * djy;
+ else
+- in_state->viewangles[PITCH] += m_pitch->value * (jy/100);
+- cmd->forwardmove -= m_forward->value * (jt/100);
++ in_state->viewangles[PITCH] += m_pitch->value * djy;
+ }
+ else
+ {
+- cmd->forwardmove -= m_forward->value * (jy/100);
++ cmd->forwardmove -= m_forward->value * djy;
+ }
+ }
+ #endif
diff --git a/games/quake2lnx/files/patch-src::ref_candygl::gl_rmisc.c b/games/quake2lnx/files/patch-src::ref_candygl::gl_rmisc.c
new file mode 100644
index 000000000000..5579805c15ac
--- /dev/null
+++ b/games/quake2lnx/files/patch-src::ref_candygl::gl_rmisc.c
@@ -0,0 +1,12 @@
+--- src/ref_candygl/gl_rmisc.c.orig Thu Jun 12 18:05:46 2003
++++ src/ref_candygl/gl_rmisc.c Thu Jun 12 18:08:56 2003
+@@ -100,9 +100,6 @@
+ int x,y;
+ byte data[8][8][4];
+
+- byte *pic, *palette;
+- int width, height;
+-
+ partscale = (float)((int)gl_partscale->value)*0.01;
+ if (partscale>1)
+ partscale=1;
diff --git a/games/quake2lnx/pkg-descr b/games/quake2lnx/pkg-descr
new file mode 100644
index 000000000000..902c23c3adf0
--- /dev/null
+++ b/games/quake2lnx/pkg-descr
@@ -0,0 +1,7 @@
+Quake2-LNX project aims to further develop and bug fix original Quake II
+code released by id Software in 1998, as well as support multiple
+architectures (currently i386, alpha, sparc64, and powerpc are supported).
+It also includes additional rendering drivers, eyecandy stuff from
+Quake2Max project, and experimental IPv6 support.
+
+WWW: http://www.icculus.org/quake2/
diff --git a/games/quake2lnx/pkg-message b/games/quake2lnx/pkg-message
new file mode 100644
index 000000000000..c9aed33cea09
--- /dev/null
+++ b/games/quake2lnx/pkg-message
@@ -0,0 +1,13 @@
+===================================================
+
+ Install additional mission paks and mods in
+ ${PREFIX}/share/quake2lnx/ directory and be
+ sure to run executable binary from there as
+ well (that is, [sdl]quake2). You also must
+ own full registered version of Quake II, or
+ rebuild the port with -DWITH_SHAREWARE_DATA
+ defined to install demo version data files.
+ Note that you don't need full version to be
+ able to run dedicated server.
+
+===================================================
diff --git a/games/quake2lnx/pkg-plist b/games/quake2lnx/pkg-plist
new file mode 100644
index 000000000000..b441f950b3a2
--- /dev/null
+++ b/games/quake2lnx/pkg-plist
@@ -0,0 +1,84 @@
+@comment === EXECUTABLES ===
+%%CLIENT%%bin/quake2
+%%SDLCLIENT%%bin/sdlquake2
+%%SERVER%%bin/q2ded
+@comment === DOCS ===
+%%PORTDOCS%%share/doc/quake2lnx/README
+%%PORTDOCS%%@dirrm share/doc/quake2lnx
+@comment === RENDERERS ===
+%%SVGA%%share/quake2lnx/ref_soft.so
+%%SDL%%share/quake2lnx/ref_softsdl.so
+%%SDLGL%%share/quake2lnx/ref_sdlgl.so
+%%X11%%share/quake2lnx/ref_softx.so
+%%GLX%%share/quake2lnx/ref_glx.so
+%%AA%%share/quake2lnx/ref_softaa.so
+@comment === DATA ===
+%%GAME%%share/quake2lnx/baseq2/game%%ARCH%%.so
+%%QMAX%%share/quake2lnx/baseq2/maxpak.pak
+%%SHAREWARE%%share/quake2lnx/baseq2/pak0.pak
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/athena.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/athena_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/brianna.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/brianna_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/cobalt.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/cobalt_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/doomgal.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/doomgal_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/ensign.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/ensign_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/jezebel.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/jezebel_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/jungle.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/jungle_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/lotus.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/lotus_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/stiletto.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/stiletto_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/tris.md2
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/venus.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/venus_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/voodoo.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/voodoo_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/weapon.md2
+%%SHAREWARE%%share/quake2lnx/baseq2/players/female/weapon.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/cipher.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/cipher_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/claymore.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/claymore_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/flak.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/flak_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/grunt.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/grunt_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/howitzer.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/howitzer_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/major.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/major_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/nightops.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/nightops_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/pointman.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/pointman_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/psycho.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/psycho_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/rampage.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/rampage_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/razor.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/razor_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/recon.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/recon_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/scout.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/scout_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/skin.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/sniper.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/sniper_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/tris.md2
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/viper.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/viper_i.pcx
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/weapon.md2
+%%SHAREWARE%%share/quake2lnx/baseq2/players/male/weapon.pcx
+%%SHAREWARE%%@dirrm share/quake2lnx/baseq2/players/male
+%%SHAREWARE%%@dirrm share/quake2lnx/baseq2/players/female
+%%SHAREWARE%%@dirrm share/quake2lnx/baseq2/players
+%%CTF%%share/quake2lnx/ctf/game%%ARCH%%.so
+%%CTF%%@dirrm share/quake2lnx/ctf
+@dirrm share/quake2lnx/baseq2
+@dirrm share/quake2lnx