Merge github#920: app-arch/zopfli: Version bump 1.0.1.
[gentoo.git] / games-fps / ut2003-bonuspack-epic / ut2003-bonuspack-epic-1.ebuild
1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6 inherit games
7
8 DESCRIPTION="Epic Bonus Pack for UT2003"
9 HOMEPAGE="http://www.moddb.com/games/unreal-tournament-2003"
10 SRC_URI="http://ftp.student.utwente.nl/pub/games/UT2003/BonusPack/UT2003-epicbonuspackone.exe"
11
12 LICENSE="ut2003"
13 SLOT="1"
14 KEYWORDS="x86"
15 IUSE=""
16 RESTRICT="strip"
17
18 DEPEND="app-arch/unzip"
19 RDEPEND="games-fps/ut2003"
20
21 S=${WORKDIR}/UT2003-BonusPack
22
23 dir=${GAMES_PREFIX_OPT}/ut2003
24 Ddir=${D}/${dir}
25
26 src_unpack() {
27         unzip -qq "${DISTDIR}"/${A} || die
28         # This is done since the files are the same
29         rm -f "${S}"/Textures/LastManStanding.utx || die
30 }
31
32 src_install() {
33         insinto "${dir}"/Help
34         newins "${S}"/Help/BonusPackReadme.txt EpicBonusPack.README
35
36         exeinto "${dir}"
37         doexe "${FILESDIR}"/epic-installer
38         dodir "${dir}"/System
39
40         cp -r "${S}"/{Maps,Sounds,StaticMeshes,Textures} "${Ddir}" || die
41         cp "${S}"/System/{*.{det,est,frt,int,itt,kot,tmt,u},User.ini} "${Ddir}"/System || die
42         cp -v "${S}"/System/Manifest.ini "${Ddir}"/System/Manifest.ini.epic || die
43
44         prepgamesdirs
45 }
46
47 pkg_postinst() {
48         games_pkg_postinst
49         elog "You will need to run:"
50         elog "emerge --config =${CATEGORY}/${PF}"
51         elog "to make the necessary changes to the system .ini files."
52         elog
53         elog "Each user whom has already played the game will need to run:"
54         elog " ${dir}/epic-installer"
55         echo
56         elog "to update their configuration files in their home directory."
57         echo
58 }
59
60 pkg_config() {
61         cd ${dir}/System || die
62         cp Manifest.ini Manifest.ini.pre-epic || die
63         cp ${dir}/System/Manifest.ini.epic Manifest.ini || die
64
65         cp Default.ini Default.ini.pre-epic || die
66         cat >> Default.ini <<EOT
67
68 [Xinterface.Tab_AudioSettings]
69 BonusPackInfo[1]=(PackageName="AnnouncerEvil.uax",Description="Evil")
70 BonusPackInfo[2]=(PackageName="AnnouncerFemale.uax",Description="Female")
71 BonusPackInfo[3]=(PackageName="AnnouncerSexy.uax",Description="Aroused")
72
73 EOT
74
75         ed Default.ini >/dev/null 2>&1 <<EOT
76 /\[xInterface.ExtendedConsole\]
77 a
78 MusicManagerClassName=OGGPlayer.UT2OGGMenu
79 .
80 w
81 q
82 EOT
83
84         ed Default.ini >/dev/null 2>&1 <<EOT
85 $
86 ?EditPackages?
87 a
88 EditPackages=BonusPack
89 EditPackages=SkaarjPack
90 EditPackages=SkaarjPack_rc
91 .
92 w
93 q
94 EOT
95
96         ed Default.ini >/dev/null 2>&1 <<EOT
97 $
98 ?ServerPackages?
99 a
100 ServerPackages=BonusPack
101 ServerPackages=SkaarjPack
102 ServerPackages=SkaarjPack_rc
103 .
104 w
105 q
106 EOT
107
108         cp DefUser.ini DefUser.ini.pre-epic || die
109         sed -i 's/^F11=.*$/F11=MusicMenu/g' DefUser.ini || die
110         chown games:games ${dir}/System/*.ini || die
111 }