ChangeLog

# ChangeLog for games-fps/quake2-icculus
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
# $Header: /var/cvsroot/gentoo-x86/games-fps/quake2-icculus/ChangeLog,v 1.31 2008/02/29 19:22:02 carlo Exp $

29 Feb 2008; Carsten Lohrke
quake2-icculus-0.16.1.ebuild, quake2-icculus-0.16.1-r1.ebuild:
Remove icon extension from desktop entry to match Icon Theme Specification.

19 Feb 2008; Mike Frysinger
+files/quake2-icculus-0.16.1-no-asm-io.patch,
quake2-icculus-0.16.1-r1.ebuild:
Fix building with sanitized kernel headers #193107.

15 Feb 2008; Chris Gianelloni
quake2-icculus-0.16.1.ebuild, quake2-icculus-0.16.1-r1.ebuild:
Fix quoting.

28 Jan 2008; Michael Sterrett
quake2-icculus-0.16.1-r1.ebuild:
make the doc message more generic (bug #207773)

13 Mar 2007; Chris Gianelloni
quake2-icculus-0.16.1.ebuild, quake2-icculus-0.16.1-r1.ebuild:
Change which to type -P for QA.

22 Feb 2007; Piotr Jaroszyński ChangeLog:
Transition to Manifest2.

09 Jan 2007; Chris Gianelloni
quake2-icculus-0.16.1-r1.ebuild:
Fix up the einfos into elogs and make sure we don't do anything w/ q2ded
unless USE=dedicated.

05 Dec 2006; Chris Gianelloni
quake2-icculus-0.16.1.ebuild, quake2-icculus-0.16.1-r1.ebuild:
Removing old virtual/x11 dependency.

27 Jun 2006; Chris Gianelloni
+files/0.16-rogue-armor.patch, quake2-icculus-0.16.1.ebuild,
quake2-icculus-0.16.1-r1.ebuild:
Added patch to fix compiling of rogue. Closing bug #137855.

*quake2-icculus-0.16.1-r1 (27 Jun 2006)

27 Jun 2006; Chris Gianelloni
+quake2-icculus-0.16.1-r1.ebuild:
Revision bump to add support for the demo data. Closing bug #137522.

05 Jun 2006; Diego Pettenò
quake2-icculus-0.16.1.ebuild:
Add ~x86-fbsd keyword and accept freebsd-ubin as alternative to sharutils
(the same command are installed by that package on Gentoo/FreeBSD).

25 May 2006; Diego Pettenò
quake2-icculus-0.16.1.ebuild:
Use the correct CC value for cross-distcc, and add missing jpeg dependency.
Closes bug #134319.

06 May 2006; +files/quake2-icculus-0.16.1-gcc41.patch,
quake2-icculus-0.16.1.ebuild:
Fixing build with xatrix and gcc-4.1, bug #118299 by Adomas Jackevicius

15 Mar 2006; Chris Gianelloni
quake2-icculus-0.16.1.ebuild:
Changed to use idsoftware thirdpartymirror.

03 Nov 2005; Chris Gianelloni
files/quake2-icculus-0.16.1-gentoo-paths.patch,
quake2-icculus-0.16.1.ebuild:
Made the ebuild respect USE=dedicated and also adjusted the path patch.
Closing bug #104613. Thanks to Paul Bredbury and Tuomas Suutari for finding
and fixing these.

01 Sep 2005; Mike Frysinger
quake2-icculus-0.16.1.ebuild:
Add support for USE=alsa #102791 by roma1390.

29 Aug 2005; Mike Frysinger
-files/0.16-Makefile-gentoo-opts.patch, -files/0.16-gentoo-path.patch,
+files/quake2-icculus-0.16.1-gentoo-paths.patch,
quake2-icculus-0.16.1.ebuild:
Clean up the way we pass custom settings to the build system.

29 May 2005; Mike Frysinger
quake2-icculus-0.16.1.ebuild:
Add support for just building a dedicated server #94187 by Jan Reitz.

30 Apr 2005; Mike Frysinger
+files/quake2-icculus-0.16.1-amd64.patch, quake2-icculus-0.16.1.ebuild:
On amd64, select the glx video renderer by default until the software
renderers work #86552.

*quake2-icculus-0.16.1 (10 Mar 2005)

10 Mar 2005; Mike Frysinger
+quake2-icculus-0.16.1.ebuild:
Version bumpage.

*quake2-icculus-0.16 (03 Jan 2005)

03 Jan 2005; Mike Frysinger
+files/0.16-Makefile-gentoo-opts.patch, +files/0.16-gentoo-path.patch,
+files/0.16-rogue-nan.patch, +quake2-icculus-0.16.ebuild:
Version bump. Also update the gentoo path patch to fix game .so searching
#42389 and video .so searching #60752.

*quake2-icculus-0.15-r2 (27 Nov 2004)

27 Nov 2004; Chris Gianelloni
+files/0.15-Makefile-amd64.patch, +files/0.15-amd64.patch,
files/0.15-gentoo-path.patch, -quake2-icculus-0.15-r1.ebuild,
+quake2-icculus-0.15-r2.ebuild:
Fixed up the path patch, added initial amd64 support, and closing bugs
#61801 and #40328.

23 Nov 2004; Chris Gianelloni
quake2-icculus-0.15-r1.ebuild:
Updated DEPEND and IUSE and closing bug #63062.

01 Jul 2004; Michael Sterrett
quake2-icculus-0.15-r1.ebuild:
Fix typo (bug #55843); no backquotes

28 Jun 2004; Aron Griffis
quake2-icculus-0.15-r1.ebuild:
fix use invocation, glibc -> libc

27 Mar 2004; Michael Sterrett
quake2-icculus-0.15-r1.ebuild:
use || in RDEPEND to say what we really mean; depend on sed >= 4; error check
sed

*quake2-icculus-0.15-r1 (08 Jan 2004)

08 Jan 2004; Mike Frysinger :
Fix installed paths #35952.

*quake2-relnev-0.15 (29 Jun 2003)

27 Dec 2003; Mike Frysinger :
Add xatrix/rogue game support #33029.

30 Jun 2003; Mike Frysinger :
renamed (whoops) and added support to build qmax & normal binary.

29 Jun 2003; Mike Frysinger :
Reworked and cleaned up to close #8222.
All optional features are supported and qmax has been added.

*quake2-0.15.1 (18 Nov 2002)

18 Nov 2002; Mike Frysinger :
Version bump from lundy.

*quake2-0.14.1 (06 Nov 2002)

06 Nov 2002; Mike Frysinger :
Initial import. Ebuild submitted by Mike Lundy .

Manifest

AUX 0.16-rogue-armor.patch 312 RMD160 3b3da747164b3f3f5e7c6d7eeae103856237a1a3 SHA1 941b80ef9fd7c921799b5a4c066003bee6f4ddc0 SHA256 8198edf3c33d04cfe1cbde0ac64174f85614b1952478c39ad5986736057145a2
AUX 0.16-rogue-nan.patch 242 RMD160 b95d2ff792831da963ae782cc0bca706b1ce62ce SHA1 dadb29e8644e228575c1397cbf36cacb1ea64032 SHA256 9de64221141c8e9e2c519504176029a57ad627ca9b68830e53d53db31f01a3c0
AUX README-postinstall 3083 RMD160 fc8094e39bf5ed779fdd4c5e2b911422e69d03da SHA1 2faf360f81683b78a47fab6a069325e9c24fda49 SHA256 90f8cce0737adf8a95afac11ca30911a59801659cb5ebf29943792586eed1a45
AUX quake2-icculus-0.16.1-amd64.patch 534 RMD160 ad9193d1977ac2c0036e30022b198e5ff8b850dd SHA1 16776e9c7edf09e190393dd5c6646db1c4680bd1 SHA256 e95aeace865f089b6c1c9e0c362da407d1bd603147fb6886b9c13b37218c3a37
AUX quake2-icculus-0.16.1-gcc41.patch 364 RMD160 b85910d79a8e7e2cc71da21f5f22e331b94c0719 SHA1 3c80e62267223fbf83aa2f7ce73fcf6eba0297c9 SHA256 1010f97c15f202de682f56ac372cc342299f1e6c20e9072d8fa346a1469adf72
AUX quake2-icculus-0.16.1-gentoo-paths.patch 7688 RMD160 db521205c1d787fb31262d1710a57b7da50194a9 SHA1 dcf87cd07cade4b31251a63834819c131cfb81c2 SHA256 22d47f76fe1f06028088d2b7d9b1bc0bf1c91c559149859373af29f467ed2ea9
AUX quake2-icculus-0.16.1-no-asm-io.patch 513 RMD160 0ae685e8f5d02511013b6f5b9106e11c024cc2a9 SHA1 53651b2175b9e547e8f01215bf9e6f94f3cee539 SHA256 05a648b32ce0c260046706ee2f4c6f49a0e7049ed07cd02fd895f6fd83556012
AUX quake2.xpm 1234 RMD160 4afa56af8446c288b5779cf7e2c0b8dfe98e9bba SHA1 7adcc4c3242ea6468c259d181e9cd251ce1fd570 SHA256 0a5232384c56ccead145345a30e4ed7004bf36fe7656d43c46f1bed34d8fc2a9
DIST maxpak.pak 3282742 RMD160 6b5223fee63dbb2c886e3c1e39d9e157d65f589f SHA1 ecafe118f20b96c7ba74842839702fde6965d640 SHA256 653569fe880f1ed5f7529483ac961b22078482e6ff0e83f4d9d1bc503c866770
DIST quake2-r0.16.1.tar.gz 1525384 RMD160 dbbf9cad08ab381e0c2cd037e317104085455c23 SHA1 9226acadc896ddc9924c6b7f9b71857078af5dba SHA256 49f4d3d53772b6ffd7733506f5d121c7893bfd8884133bfc36a28039c0744642
DIST roguesrc320.shar.Z 626769 RMD160 767c5b1a7a1123370e9c924282656dfdcc6cebba SHA1 7c5cadde75f5353622552cd28501ce60ac83dca2 SHA256 ceefb2fd748961cb0bc3244220f3eb09d8f7b8ca2eb32cdf9b284727a2fdc919
DIST xatrixsrc320.shar.Z 455917 RMD160 357182dcd760a95b27942cdf807ba1242bcb1160 SHA1 ec67b6d2be623dd344c100869fc48bcbadea927a SHA256 94bf596cd85d38ea294b99ccb0ebb5e4b9776cca335001b3803e2d8407395589
EBUILD quake2-icculus-0.16.1-r1.ebuild 5602 RMD160 4ae9bc4b69e4f1475d7640169daa71067544e894 SHA1 410a7110d33685da2b353b7cf564de3a754d6a88 SHA256 7388b2003b3f8098f312891b759e2c41ae2458a0a2a2e18b2987a34006b205e3
EBUILD quake2-icculus-0.16.1.ebuild 4833 RMD160 f50286273cf02c3aeaa54ad081ce16376f6473fa SHA1 d59f56617645acb8b2286659e6d39fc48f3e3313 SHA256 ffffa3ccd067b1c705e52ce6c2402951414d161d5c6042d609db3fdbd6451c25
MISC ChangeLog 5892 RMD160 15a593782361bac7ffe096e26abede26c1ba9cb2 SHA1 8d7fb9c850927b69b22a557b79cc6faf21ff77ac SHA256 f57e5492fcddd7feacd7c1b5611661fe525cb7ac6012e21ed04d930e1a7fc442
MISC metadata.xml 588 RMD160 721e11fa5eaea409cb368e0b96e5fe71cc1b328d SHA1 0d645dac5673f6869970cf1b17b20378a50352a3 SHA256 523eef2f6b29b071d5af6959c72977d78ee1176a6ac4a300228484121f4ad644

files

metadata.xml




games

Install the demo files (quake2-demodata) and configure for use
Do not build the pretty version (quake max)
Build the pretty version (quake max)
Build support for the 'Ground Zero' Mission Pack (rogue)
Build support for the 'The Reckoning' Mission Pack (xatrix)

quake2-icculus-0.16.1-r1.ebuild

# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-fps/quake2-icculus/quake2-icculus-0.16.1-r1.ebuild,v 1.11 2008/02/29 19:22:02 carlo Exp $

inherit eutils toolchain-funcs games

MY_P="quake2-r${PV}"
DESCRIPTION="The icculus.org Linux port of iD's Quake 2 engine"
HOMEPAGE="http://icculus.org/quake2/"
SRC_URI="http://icculus.org/quake2/files/${MY_P}.tar.gz
qmax? ( http://icculus.org/quake2/files/maxpak.pak )
rogue? ( mirror://idsoftware/quake2/source/roguesrc320.shar.Z )
xatrix? ( mirror://idsoftware/quake2/source/xatrixsrc320.shar.Z )"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86 ~x86-fbsd"
IUSE="aalib alsa arts cdinstall dedicated demo ipv6 joystick opengl qmax rogue sdl svga X xatrix"

UIDEPEND="aalib? ( media-libs/aalib )
alsa? ( media-libs/alsa-lib )
arts? ( kde-base/arts )
opengl? ( virtual/opengl )
svga? ( media-libs/svgalib )
sdl? ( media-libs/libsdl )"
RDEPEND="${UIDEPEND}
cdinstall? ( games-fps/quake2-data )
demo? ( games-fps/quake2-demodata )"
DEPEND="${UIDEPEND}
X? (
x11-proto/xproto
x11-proto/xextproto
x11-proto/xf86dgaproto
x11-proto/xf86vidmodeproto )
rogue? ( || ( sys-freebsd/freebsd-ubin app-arch/sharutils ) )
xatrix? ( || ( sys-freebsd/freebsd-ubin app-arch/sharutils ) )"

S=${WORKDIR}/${MY_P}

pkg_setup() {
games_pkg_setup

local alert_user

if ! use qmax && $( use opengl || use sdl ) ; then
einfo "The 'qmax' graphical improvements are recommended."
echo
alert_user=y
fi

if ! use sdl ; then
ewarn "The ALSA sound driver for this game is broken."
ewarn "The 'sdl' USE flag is recommended instead."
echo
alert_user=y
fi

if [[ -n "${alert_user}" ]] ; then
ebeep
epause
fi
}

src_unpack() {
unpack ${MY_P}.tar.gz
cd "${S}"
sed -i -e 's:BUILD_SOFTX:BUILD_X11:' Makefile || die
epatch "${FILESDIR}"/${P}-amd64.patch # make sure this is still needed in future versions
epatch "${FILESDIR}"/${P}-gentoo-paths.patch
epatch "${FILESDIR}"/${P}-no-asm-io.patch #193107

# Now we deal with the silly rogue / xatrix addons ... this is ugly :/
ln -s $(type -P echo) "${T}"/more
for g in rogue xatrix ; do
use ${g} || continue
mkdir -p "${S}"/src/${g}
cd "${S}"/src/${g}
local shar=${g}src320.shar
unpack ${shar}.Z
sed -i \
-e 's:^read ans:ans=yes :' ${shar} \
|| die "sed ${shar} failed"
echo ">>> Unpacking ${shar} to ${PWD}"
env PATH="${T}:${PATH}" unshar ${shar} || die "unpacking ${shar} failed"
rm ${shar}
done
if use xatrix ; then
epatch "${FILESDIR}/${P}"-gcc41.patch
fi
if use rogue ; then
cd "${S}"/src
epatch \
"${FILESDIR}"/0.16-rogue-nan.patch \
"${FILESDIR}"/0.16-rogue-armor.patch
fi
}

yesno() {
for f in "$@" ; do
if ! use $f ; then
echo NO
return 1
fi
done
echo YES
return 0
}

src_compile() {
# xatrix fails to build
# rogue fails to build
local libsuffix
for BUILD_QMAX in YES NO ; do
use qmax && [[ ${BUILD_QMAX} == "NO" ]] && continue
[[ ${BUILD_QMAX} == "YES" ]] \
&& libsuffix=-qmax \
|| libsuffix=
make clean || die "cleaning failed"
emake -j1 build_release \
BUILD_SDLQUAKE2=$(yesno sdl) \
BUILD_SVGA=$(yesno svga) \
BUILD_X11=$(yesno X) \
BUILD_GLX=$(yesno opengl) \
BUILD_SDL=$(yesno sdl) \
BUILD_SDLGL=$(yesno sdl opengl) \
BUILD_CTFDLL=YES \
BUILD_XATRIX=$(yesno xatrix) \
BUILD_ROGUE=$(yesno rogue) \
BUILD_JOYSTICK=$(yesno joystick) \
BUILD_DEDICATED=$(yesno dedicated) \
BUILD_AA=$(yesno aalib) \
BUILD_QMAX=${BUILD_QMAX} \
HAVE_IPV6=$(yesno ipv6) \
BUILD_ARTS=$(yesno arts) \
BUILD_ALSA=$(yesno alsa) \
SDLDIR=/usr/lib \
DEFAULT_BASEDIR="${GAMES_DATADIR}/quake2" \
DEFAULT_LIBDIR="$(games_get_libdir)/${PN}${libsuffix}" \
OPT_CFLAGS="${CFLAGS}" \
CC="$(tc-getCC)" \
|| die "make failed"
# now we save the build dir ... except for the object files ...
rm release*/*/*.o
mv release* my-rel-${BUILD_QMAX}
cd my-rel-${BUILD_QMAX}
rm -rf ref_{gl,soft} ded game client ctf/*.o
mkdir baseq2
mv game*.so baseq2/
cd ..
done
}

src_install() {
local q2dir=$(games_get_libdir)/${PN}
local q2maxdir=$(games_get_libdir)/${PN}-qmax

dodoc readme.txt README TODO "${FILESDIR}"/README-postinstall

# regular q2 files
dodir "${q2dir}"
cp -rf my-rel-NO/* "${D}/${q2dir}"/
dogamesbin "${D}/${q2dir}"/quake2
rm "${D}/${q2dir}"/quake2
use dedicated \
&& dogamesbin "${D}/${q2dir}"/q2ded \
&& rm "${D}/${q2dir}"/q2ded
use sdl \
&& dogamesbin "${D}/${q2dir}"/sdlquake2 \
&& rm "${D}/${q2dir}"/sdlquake2

doicon "${FILESDIR}"/quake2.xpm
make_desktop_entry quake2 "Quake 2" quake2

# q2max files
if use qmax ; then
dodir "${q2maxdir}"
cp -rf my-rel-YES/* "${D}/${q2maxdir}"/ || die
newgamesbin "${D}/${q2maxdir}"/quake2 quake2-qmax || die
newgamesbin "${D}/${q2maxdir}"/q2ded q2ded-qmax || die
rm "${D}/${q2maxdir}"/{quake2,q2ded}
use sdl \
&& newgamesbin "${D}/${q2maxdir}"/sdlquake2 sdlquake2-qmax \
&& rm "${D}/${q2maxdir}"/sdlquake2

insinto "${q2maxdir}"/baseq2
doins "${DISTDIR}"/maxpak.pak || die

make_desktop_entry quake2-qmax Quake2-qmax quake2
fi

prepgamesdirs
}

pkg_postinst() {
games_pkg_postinst

elog "Go read README-postinstall in /usr/share/doc/${PF}"
elog "right now! It's important - This install is just the engine, you still need"
elog "the data paks. Go read."

if use demo && ! built_with_use "games-fps/quake2-demodata" symlink ; then
ewarn "To play the Quake 2 demo,"
ewarn "emerge games-fps/quake2-demodata with the 'symlink' USE flag."
echo
fi
}

quake2-icculus-0.16.1.ebuild

# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-fps/quake2-icculus/quake2-icculus-0.16.1.ebuild,v 1.22 2008/02/29 19:22:02 carlo Exp $

inherit eutils toolchain-funcs games

MY_P="quake2-r${PV}"
DESCRIPTION="The icculus.org linux port of iD's quake2 engine"
HOMEPAGE="http://icculus.org/quake2/"
SRC_URI="http://icculus.org/quake2/files/${MY_P}.tar.gz
!noqmax? ( http://icculus.org/quake2/files/maxpak.pak )
rogue? ( mirror://idsoftware/quake2/source/roguesrc320.shar.Z )
xatrix? ( mirror://idsoftware/quake2/source/xatrixsrc320.shar.Z )"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="alpha amd64 ppc sparc x86 ~x86-fbsd"
IUSE="aalib alsa arts dedicated ipv6 joystick noqmax opengl rogue sdl svga X xatrix"

RDEPEND="opengl? ( virtual/opengl )
svga? ( media-libs/svgalib )
sdl? ( media-libs/libsdl )
aalib? ( media-libs/aalib )
X? (
x11-libs/libX11
x11-libs/libXext
x11-libs/libXxf86dga
x11-libs/libXxf86vm )
alsa? ( media-libs/alsa-lib )
arts? ( kde-base/arts )
media-libs/jpeg"
DEPEND="${RDEPEND}
X? (
x11-proto/xproto
x11-proto/xextproto
x11-proto/xf86dgaproto
x11-proto/xf86vidmodeproto )
rogue? ( || ( sys-freebsd/freebsd-ubin app-arch/sharutils ) )
xatrix? ( || ( sys-freebsd/freebsd-ubin app-arch/sharutils ) )"

S=${WORKDIR}/${MY_P}

src_unpack() {
unpack ${MY_P}.tar.gz
cd "${S}"
sed -i -e 's:BUILD_SOFTX:BUILD_X11:' Makefile
epatch "${FILESDIR}"/${P}-amd64.patch # make sure this is still needed in future versions
epatch "${FILESDIR}"/${P}-gentoo-paths.patch

# Now we deal with the silly rogue / xatrix addons ... this is ugly :/
ln -s $(type -P echo) "${T}"/more
for g in rogue xatrix ; do
use ${g} || continue
mkdir -p "${S}"/src/${g}
cd "${S}"/src/${g}
local shar=${g}src320.shar
unpack ${shar}.Z
sed -i \
-e 's:^read ans:ans=yes :' ${shar} \
|| die "sed ${shar} failed"
echo ">>> Unpacking ${shar} to ${PWD}"
env PATH="${T}:${PATH}" unshar ${shar} || die "unpacking ${shar} failed"
rm ${shar}
done
if use xatrix ; then
epatch "${FILESDIR}/${P}"-gcc41.patch
fi
if use rogue ; then
cd "${S}"/src
epatch "${FILESDIR}"/0.16-rogue-nan.patch
epatch "${FILESDIR}"/0.16-rogue-armor.patch
fi
}

yesno() {
for f in "$@" ; do
if ! use $f ; then
echo NO
return 1
fi
done
echo YES
return 0
}

src_compile() {
# xatrix fails to build
# rogue fails to build
local libsuffix
for BUILD_QMAX in YES NO ; do
use noqmax && [[ ${BUILD_QMAX} == "YES" ]] && continue
[[ ${BUILD_QMAX} == "YES" ]] \
&& libsuffix=-qmax \
|| libsuffix=
make clean || die "cleaning failed"
emake -j1 build_release \
BUILD_SDLQUAKE2=$(yesno sdl) \
BUILD_SVGA=$(yesno svga) \
BUILD_X11=$(yesno X) \
BUILD_GLX=$(yesno opengl) \
BUILD_SDL=$(yesno sdl) \
BUILD_SDLGL=$(yesno sdl opengl) \
BUILD_CTFDLL=YES \
BUILD_XATRIX=$(yesno xatrix) \
BUILD_ROGUE=$(yesno rogue) \
BUILD_JOYSTICK=$(yesno joystick) \
BUILD_DEDICATED=$(yesno dedicated) \
BUILD_AA=$(yesno aalib) \
BUILD_QMAX=${BUILD_QMAX} \
HAVE_IPV6=$(yesno ipv6) \
BUILD_ARTS=$(yesno arts) \
BUILD_ALSA=$(yesno alsa) \
SDLDIR=/usr/lib \
DEFAULT_BASEDIR="${GAMES_DATADIR}/quake2" \
DEFAULT_LIBDIR="$(games_get_libdir)/${PN}${libsuffix}" \
OPT_CFLAGS="${CFLAGS}" \
CC="$(tc-getCC)" \
|| die "make failed"
# now we save the build dir ... except for the object files ...
rm release*/*/*.o
mv release* my-rel-${BUILD_QMAX}
cd my-rel-${BUILD_QMAX}
rm -rf ref_{gl,soft} ded game client ctf/*.o
mkdir baseq2
mv game*.so baseq2/
cd ..
done
}

src_install() {
local q2dir=$(games_get_libdir)/${PN}
local q2maxdir=$(games_get_libdir)/${PN}-qmax

dodoc readme.txt README TODO "${FILESDIR}"/README-postinstall

# regular q2 files
dodir "${q2dir}"
cp -rf my-rel-NO/* "${D}/${q2dir}"/
dogamesbin "${D}/${q2dir}"/{quake2,q2ded}
rm "${D}/${q2dir}"/{quake2,q2ded}
use sdl \
&& dogamesbin "${D}/${q2dir}"/sdlquake2 \
&& rm "${D}/${q2dir}"/sdlquake2

doicon "${FILESDIR}"/quake2.xpm
make_desktop_entry quake2 Quake2 quake2

# q2max files
if ! use noqmax ; then
dodir "${q2maxdir}"
cp -rf my-rel-YES/* "${D}/${q2maxdir}"/
newgamesbin "${D}/${q2maxdir}"/quake2 quake2-qmax
newgamesbin "${D}/${q2maxdir}"/q2ded q2ded-qmax
rm "${D}/${q2maxdir}"/{quake2,q2ded}
use sdl \
&& newgamesbin "${D}/${q2maxdir}"/sdlquake2 sdlquake2-qmax \
&& rm "${D}/${q2maxdir}"/sdlquake2

insinto "${q2maxdir}"/baseq2
doins "${DISTDIR}"/maxpak.pak

make_desktop_entry quake2-qmax Quake2-qmax quake2
fi

prepgamesdirs
}

pkg_postinst() {
games_pkg_postinst
einfo "Go read /usr/share/doc/${PF}/README-postinstall.gz right now!"
einfo "It's important- This install is just the engine, you still need"
einfo "the data paks. Go read."
}