# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 EAPI="3" inherit games DESCRIPTION="Rise of the Triad game data" HOMEPAGE="http://www.3drealms.com/rott/" SRC_URI="" LICENSE="as-is" SLOT="0" KEYWORDS="amd64 x86" IUSE="doc" DEPEND="" RDEPEND="" S=${WORKDIR} # Function to handle copying and renaming files from installation directory copy_file() { local dest="${2}" local f=$(basename "${1}") if [ "${f:0:1}" == '*' ]; then return 0 else echo "Copying '${f}'" local d=$(echo ${f} | tr "[:upper:]" "[:lower:]") cp -f "${1}" "${dest}/${d}" return $? fi } pkg_setup() { export CDROM_NAME_SET=("Existing Install", "Existing Install", "RotT CD-ROM") cdrom_get_cds darkwar.wad:DARKWAR.RTC:rottinst/darkwar.wad case ${CDROM_SET} in [01]) ROTTDIR=. ;; 2) ROTTDIR=rottinst ;; *) die "unrecognized CD" esac } src_install() { local SRC="${CDROM_ROOT}"/"${ROTTDIR}" local DST="${GAMES_DATADIR}"/rott dodir "${DST}" insinto "${DST}" # Copy all available data files (include optional levels, etc.) for i in "${SRC}"/*.{dmo,DMO,rtc,RTC,rtl,RTL,rts,RTS,wad,WAD}; do copy_file "$i" "${D}/${DST}" || die "copy '${i}' failed" done #doins "${SRC}"/*.{dmo,rtc,rtl,rts,wad} || die "Error installing data files."; # Verify that, at least, the main data files are included if [ ! -f "${D}/${DST}"/darkwar.rtc \ -o ! -f "${D}/${DST}"/huntbgin.rtc ]; then die "Required data files not found" fi # Install optional documentation if use doc; then for i in "${SRC}"/*.{txt,TXT,pdf,PDF}; do copy_file "$i" "${WORKDIR}" || die "copy '${i}' failed" done dodoc {license,readme}.txt if [ $(ls "${SRC}"/*.pdf 2>/dev/null | wc -l) -gt 0 ]; then insinto usr/share/doc/"${PF}" doins *.pdf fi fi prepgamesdirs } pkg_postinst() { elog "This is just the data portion of the game. You also need to install" elog "a game engine, such as games-fps/rott, to play the game." }