# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit games DESCRIPTION="Huge collection of CTF maps" HOMEPAGE="http://ftp.games.skynet.be/pub/www.filesnetwork.com/Unreal_Tournament_2004/Maps/Capture_the_Flag/" B="mirror://beyondunreal/nalicity/ut2k4ctf" SRC_URI="${B}/2k4_ctf-lost2004.zip ${B}/2k4_ctf-satellite9.zip ${B}/barnburnerl337.zip ${B}/coral_crossings_1.75_by-ekm-5p3c7r4.zip ${B}/crater.zip ${B}/ctf-1on1-collector.zip ${B}/ctf-1on1-convoy.zip ${B}/ctf-1on1-greathall.zip ${B}/ctf-1on1-hybrid.zip ${B}/ctf-1on1-mhoeb.zip ${B}/ctf-1on1miniarena.zip ${B}/ctf-1on1-tdc.zip ${B}/ctf-2chickenpankakes2k4_final.zip ${B}/ctf-2k4woody.zip ${B}/ctf-addien-dwy2.zip ${B}/ctf-aeasus.zip ${B}/ctf-aedes-final.zip ${B}/ctf-aftermath.zip ${B}/ctf-altract.zip ${B}/ctf-amoude-2004.zip ${B}/ctf-anaction_2.zip ${B}/ctf-anfractuous2.zip ${B}/ctf-angkorian.zip ${B}/ctf-ankholforest-v2.1.zip ${B}/ctf-arenaofpain.zip ${B}/ctf-ark-twistedbase.zip ${B}/ctf-arrakis-ut2k4.zip ${B}/ctf-avali-2k4.zip ${B}/ctf-avengerdocks.zip ${B}/ctf-baleth.zip ${B}/ctf-battlecanyon.zip ${B}/ctf-belowtokaradeluxe.zip ${B}/ctf-beta-doggjpt.zip ${B}/ctf-beyondreality.zip ${B}/ctf-boardwalk.zip ${B}/ctf-bollwerkruins2004-pro.zip ${B}/ctf-bravenewworld.zip ${B}/ctf-bridge_of_the_gods.zip ${B}/ctf-brutaldeluxe2019-2004.zip ${B}/ctf-buggle-paradise.zip ${B}/ctf-cadium4.zip ${B}/ctf-canalfinal.zip ${B}/ctf-catatonic.zip ${B}/ctf-cbp1-techdream.zip ${B}/ctf-cbp2-botanic.zip ${B}/ctf-cbp2-deep_2k4.zip ${B}/ctf-cbp2-pistola.zip ${B}/ctf-citadel_real_time.zip ${B}/ctf-colawars2.zip ${B}/ctf-colawars-fragbu-v2.zip ${B}/ctf-coldfront-se.zip ${B}/ctf-coldpass2-v2.zip ${B}/ctf-collateral.zip ${B}/ctf-confrontation.zip ${B}/ctf-contiguity.zip ${B}/ctf-coretclassic.zip ${B}/ctf-crystal.zip ${B}/ctf-ctcr-bedrooms2k4.zip ${B}/ctf-ctcr-hallofredemption2k4.zip ${B}/ctf-dana.zip ${B}/ctf-deck17_ttf.zip ${B}/ctf-de-lavagiant2.zip ${B}/ctf-diepiggypiggy2k4.zip ${B}/ctf-dionysus.zip ${B}/ctf-divergence.zip ${B}/ctf-dividedland2.zip ${B}/ctf-doomedheaven-gold.zip ${B}/ctf-doomedheavenv1.5.zip ${B}/ctf-doublecarraige-v2.zip ${B}/ctf-dp-chrystal.zip ${B}/ctf-dreary2k4.zip ${B}/ctf-dr-hispeed.zip ${B}/ctf-dr-retribution_final.zip ${B}/ctf-dr-retribution_gold.zip ${B}/ctf-duku2k4.zip ${B}/ctf-egyptiancivilwarse.zip ${B}/ctf-egyptian-harbors-2004.zip ${B}/ctf-egyptiantemple.zip ${B}/ctf-electrodeoverload.zip ${B}/ctf-envy.zip ${B}/ctf-erosion2.zip ${B}/ctf-es-anuket.zip ${B}/ctf-es-tarantula.zip ${B}/ctf-eternalcave2004.zip ${B}/ctf-eternalcaves-classic.zip ${B}/ctf-eternity.zip ${B}/ctf-evermore.zip ${B}/ctf-eyeofra.zip ${B}/ctf-facingpyramids.zip ${B}/ctf-football2004.zip ${B}/ctf-forgottencityfinal.zip ${B}/ctf-fp2-gauntlet-classic.zip ${B}/ctf-g0thik_h3ll.zip ${B}/ctf-ganimade3.zip ${B}/ctf-gauss.zip ${B}/ctf-gl-otherworld.zip ${B}/ctf-godstomb.zip ${B}/ctf-goliath-full.zip ${B}/ctf-gralada.zip ${B}/ctf-gravity.zip ${B}/ctf-gritwind.zip ${B}/ctf-hallofgiants2004.zip ${B}/ctf-hanger18.zip ${B}/ctf-haven.zip ${B}/ctf-helltemples.zip ${B}/ctf-high_low.zip ${B}/ctf-hl-2fort-ut2k4.zip ${B}/ctf-hot_coldfinal.zip ${B}/ctf-hut-stonefallsf.zip ${B}/ctf-hydro16-2k4-dw.zip ${B}/ctf-hydro2004.zip ${B}/ctf-hydro64-le.zip ${B}/ctf-hydro64.zip ${B}/ctf-icepalace.zip ${B}/ctf-ice_v2.00.zip ${B}/ctf_ig_scafander.zip ${B}/ctf-inner_sanctums.zip ${B}/ctf-interface.zip ${B}/ctf-inversef.zip ${B}/ctf-isis.zip ${B}/ctf-is-thewall.zip ${B}/ctf-jedivalleymcw.zip ${B}/ctf-jump.zip ${B}/ctf-knighthawk.zip ${B}/ctf-komoritemples.zip ${B}/ctf-lagoona.zip ${B}/ctf_lars.zip ${B}/ctf-lasthope.zip ${B}/ctf-lavagiant-classic-v3.zip ${B}/ctf-lavagiant.zip ${B}/ctf-legomaniac2k4.zip ${B}/ctf-liandrifield.zip ${B}/ctf-liandri-warehouse2k4.zip ${B}/ctf-linear2004.zip ${B}/ctf-lucius2004se2.zip ${B}/ctf-lucius2004se.zip ${B}/ctf-lucius2004.zip ${B}/ctf-luryx.zip ${B}/ctf-luxushorapaths.zip ${B}/ctf-marsurface.zip ${B}/ctf-maul2005-ce.zip ${B}/ctf-mb-bud.zip ${B}/ctf-mcswartzly2004.1.2.zip ${B}/ctf-mead.zip ${B}/ctf-megadeth.zip ${B}/ctf-meltedfaith.zip ${B}/ctf-meta1.zip ${B}/ctf-metal.zip ${B}/ctf-metro_final.zip ${B}/ctf-micado-1.1.zip ${B}/ctf-mok-littleegypt_2k4.zip ${B}/ctf-mok-madness_2k4.zip ${B}/ctf-mok-toxic_2k4.zip ${B}/ctf-musgo.zip ${B}/ctf-mythos-classic.zip ${B}/ctf-mythos-se3.zip ${B}/ctf-naelir.zip ${B}/ctf-nagashistomb.zip ${B}/ctf-nightstronghold.zip ${B}/ctf-nitro-domes.1.1.zip ${B}/ctf-niven2049.zip ${B}/ctf-niven2051.zip ${B}/ctf_northface_2k4.zip ${B}/ctf-nyx.zip ${B}/ctf-oasis_of_ra.zip ${B}/ctf-ominous.zip ${B}/ctf-onyx.zip ${B}/ctf-oppressive_2k4.zip ${B}/ctf-oraxin-se.zip ${B}/ctf-orbital3.zip ${B}/ctf-orodruin2004.zip ${B}/ctf-outflow2004.zip ${B}/ctf-pandorasbox.zip ${B}/ctf-philae_nightfall.zip ${B}/ctf-pipes_v1.1.zip ${B}/ctf-planet-qx-9.zip ${B}/ctf-ramses.zip ${B}/ctf-range.zip ${B}/ctf-redzone_2k5_final.zip ${B}/ctf-romramoonstation2k4.zip ${B}/ctf-ruinsofwar2k4.zip ${B}/ctf-rvt.zip ${B}/ctf-sandofeternity2.zip ${B}/ctf-satis.zip ${B}/ctf-scuddysctfmappack1.zip ${B}/ctf-semiramis.zip ${B}/ctf-sempervirens.zip ${B}/ctf-sg-logical.zip ${B}/ctf-skyhop.zip ${B}/ctf-sky_lake.zip ${B}/ctf-smallcave.zip ${B}/ctf-snowage.zip ${B}/ctf_snowflake.zip ${B}/ctf-_sop_-bedrooms2k4.zip ${B}/ctf-spacedecks.zip ${B}/ctf-spacestation.zip ${B}/ctf-spamarena.zip ${B}/ctf-stadium2k4.zip ${B}/ctf-stairwaytoheaven.zip ${B}/ctf-stargatesg1.zip ${B}/ctf-structural.zip ${B}/ctf-sucellus.zip ${B}/ctf-sucks.zip ${B}/ctf-supplicant.zip ${B}/ctf-suspension.zip ${B}/ctf-suziscivilwar.zip ${B}/ctf-terrafirma.zip ${B}/ctf-thewall.zip ${B}/ctf-thorns2k4ce.zip ${B}/ctf-thornsrebirth.zip ${B}/ctf-thornsv2_2k4.zip ${B}/ctf-thornsv42k4.zip ${B}/ctf-tinmanut2k4.zip ${B}/ctf-torinosu20.zip ${B}/ctf-tributetoguk.zip ${B}/ctf-tron_20.zip ${B}/ctf-tutorial2004.zip ${B}/ctf-twinbases.zip ${B}/ctf-twosretrock2.zip ${B}/ctf-tyco.zip ${B}/ctf-ucmp2-campgrounds.zip ${B}/ctf-ucmp2-enlightenment.zip ${B}/ctf-ucmp2-vadamerca.zip ${B}/ctf-ucmp-aithanarid.zip ${B}/ctf-ucmp-aquatica_le.zip ${B}/ctf-ucmp-aquatica.zip ${B}/ctf-ucmp-decanecaldera.zip ${B}/ctf-ued-arboreaunderground.zip ${B}/ctf-uk-underlandv1.zip ${B}/ctf-unearthed_se_2004.zip ${B}/ctf-valley_of_peace_se.zip ${B}/ctf-vectorv_2.zip ${B}/ctf-w00t2k4v2.zip ${B}/ctf-w3-zm1jungle2se.zip ${B}/ctf-yosemitestation.zip ${B}/egyptiancivilwar.zip ${B}/eternal_crossings_1.1_by_ekm_5p3c7r4.zip ${B}/hallofgraphicsce2k4.zip ${B}/hitandrunse.zip ${B}/hotcoldv2.zip ${B}/oraxin.zip ${B}/orbiting_monolith.zip" LICENSE="freedist" SLOT="0" KEYWORDS="~x86" IUSE="" RESTRICT="mirror strip" RDEPEND=">=games-fps/ut2004-3355 games-fps/ut2004-bonuspack-mega" DEPEND="games-util/uz2unpack" S=${WORKDIR} dir=${GAMES_PREFIX_OPT}/ut2004 movefiles() { find . -name "*.${1}" -type f | while read f ; do movefile "${f}" "${2}" \; done } movefile() { local b=$(basename "${1}") # Check that source and destination are not identical if [[ "${1}" != "./${2}/${b}" ]] ; then if [[ ! -d "${2}" ]] ; then # Create destination directory mkdir "${2}" fi # Move file to destination directory mv "${1}" "${2}" fi } ut2004_unpack() { # Generic UT2004 file installer for non-subdirectory-mods # Unpack any uz2 files local f newf find . -name "*.uz2" -type f | while read f ; do newf=${f%%.uz2} uz2unpack "${f}" "${newf}" || die "uz2unpack ${f} ${newf} failed" rm "${f}" done # Move the files into the correct directory local ext dest i declare -a ext=( doc rtf txt ut2 ogg utx uax usx int u ucl ) declare -a dest=( Help Help Help Maps Music Textures Sounds StaticMeshes System System System ) for i in $(seq 0 $((${#ext[@]} - 1))) ; do movefiles "${ext[${i}]}" "${dest[${i}]}" done # Remove common collisions with already-installed files. # System/BootsOfJumping.u and System/BootsOfJumping.int are candidates, # when we have ut2004-common to install them. declare -a collisions=( Help/ReadMe.int.txt ) for i in $(seq 0 $((${#collisions[@]} - 1))) ; do f="${collisions[${i}]}" [[ -e "${f}" ]] && rm "${f}" done } ut2004_install() { insinto "${dir}" doins -r Help Maps Music Textures Sounds StaticMeshes System || die "doins failed" } src_unpack() { unpack ${A} ut2004_unpack } src_install() { ut2004_install prepgamesdirs }