#Author Alexander Gretencord S=${WORKDIR}/ DESCRIPTION="Quake III" SRC_URI="ftp://ftp.idsoftware.com/idstuff/quake3/linux/linuxq3apoint-1.31.x86.run" HOMEPAGE="http://www.idsoftware.com" LICENSE="GPL" DEPEND="${RDEPEND}" RDEPEND="virtual/glibc opengl? ( virtual/opengl ) X? ( x11-base/xfree )" SLOT="0" src_unpack() { tail +175 ${DISTDIR}/linuxq3apoint-1.31.x86.run | gzip -cd | tar xf - } src_install () { dodir /opt/quake3/ dodir /opt/quake3/Help dodir /opt/quake3/missionpack dodir /opt/quake3/baseq3 insinto /opt/quake3/baseq3 doins baseq3/*.pk3 insinto /opt/quake3/Help doins Help/* insinto /opt/quake3/missionpack doins missionpack/*.pk3 insinto /opt/quake3/ doins bin/x86/quake3.x86 bin/x86/q3ded quake3.xpm README* Q3A_EULA.txt doins ${FILESDIR}/quake3 doins ${FILESDIR}/startq3ded chown -R root.games ${D}/opt/quake3 find ${D}/opt/quake3 -type d -print0 | xargs --null chmod 755 find ${D}/opt/quake3 -type f -print0 | xargs --null chmod 744 fperms 754 /opt/quake3/quake3 fperms 754 /opt/quake3/quake3.x86 fperms 754 /opt/quake3/q3ded fperms 754 /opt/quake3/startq3ded insinto /etc/env.d ; newins ${FILESDIR}/quake3.envd 90quake3 insinto /etc/init.d newins ${FILESDIR}/q3ded.rc q3ded fperms u+x /etc/init.d/q3ded } pkg_postinst() { if [ -z `awk -F":" '/^q3:/ { print }' /etc/passwd` ]; then useradd -g games -d /opt/quake3 -c "Quake3 dedicated server user" -s /bin/bash q3 fi einfo "\t#########################################" einfo "\t# You need to copy pak0.pk3 from your #" einfo "\t# Quake3 CD into /opt/quake3/baseq3. #" einfo "\t# Or if you got a Windows installation #" einfo "\t# of Q3 make a symlink to save space. #" einfo "\t# #" einfo "\t# Note that only users in the group #" einfo "\t# 'games' can play quake3. #" einfo "\t# #" einfo "\t# Use the q3ded file in init.d to start #" einfo "\t# a quake3 dedicated server. It uses #" einfo "\t# screen so you can get to the console #" einfo "\t# whenever you want with: #" einfo "\t# #" einfo "\t# screen -r q3ded #" einfo "\t# #" einfo "\t# Have a look at startq3ded in the #" einfo "\t# quake3 dir to set other options when #" einfo "\t# starting the server. #" einfo "\t# #" einfo "\t# The Server is started by the user q3 #" einfo "\t#########################################" } pkg_postrm() { userdel q3 }