/[gentoo-x86]/eclass/games-ut2k4mod.eclass
Gentoo

Contents of /eclass/games-ut2k4mod.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Wed Mar 16 01:51:51 2005 UTC (13 years, 4 months ago) by wolf31o2
Branch: MAIN
Changes since 1.3: +44 -28 lines
Updated with more error checking to allow for non-mods to be installed, such as CBP1 and CBP2.

1 # Copyright 1999-2004 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/games-ut2k4mod.eclass,v 1.3 2005/02/24 13:51:36 wolf31o2 Exp $
4
5 inherit games
6
7 ECLASS=games-ut2k4mod
8 INHERITED="$INHERITED $ECLASS"
9
10 EXPORT_FUNCTIONS pkg_fetch src_unpack src_install pkg_postinst
11
12 DESCRIPTION="UT2004 - ${MOD_DESC}"
13
14 SLOT="0"
15 KEYWORDS="-* x86 amd64"
16 IUSE=""
17 RESTRICT="nomirror fetch"
18
19 DEPEND="app-arch/tar
20 app-arch/bzip2"
21
22 RDEPEND="virtual/libc
23 >=games-fps/ut2004-3339"
24
25 S=${WORKDIR}
26 dir=${GAMES_PREFIX_OPT}/ut2004
27 Ddir=${D}/${dir}
28
29 check_dvd() {
30 # The following is a nasty mess to determine if we are installing from
31 # a DVD or from multiple CDs. Anyone feel free to submit patches to this
32 # to bugs.gentoo.org as I know it is a very ugly hack.
33 USE_DVD=
34 USE_ECE_DVD=
35 if [ -n "${CD_ROOT}" ]
36 then
37 [ -d "${CD_ROOT}/CD1" ] && USE_DVD=1
38 [ -d "${CD_ROOT}/CD7" ] && USE_ECE_DVD=1
39 else
40 local mline=""
41 for mline in `mount | egrep -e '(iso|cdrom)' | awk '{print $3}'`
42 do
43 [ -d "${mline}/CD1" ] && USE_DVD=1
44 [ -d "${mline}/CD7" ] && USE_ECE_DVD=1
45 done
46 fi
47 }
48
49 games-ut2k4mod_pkg_fetch() {
50 einfo "Please download ${A} and put it into ${DISTDIR}"
51 einfo "http://liflg.org/?catid=6&gameid=17"
52 }
53
54 games-ut2k4mod_src_unpack() {
55 [ -z "${MOD_TBZ2}" ] && die "what are we supposed to unpack ?"
56 [ -z "${MOD_NAME}" ] && die "what is the name of this ut2k4mod ?"
57
58 for makeself in ${A}
59 do
60 unpack_makeself ${makeself}
61 done
62
63 mkdir ${S}/unpack
64 for tarball in ${MOD_TBZ2}
65 do
66 if [ -e "${tarball}_${PV}-english.tar.bz2" ]
67 then
68 tar xjf ${tarball}_${PV}-english.tar.bz2 -C ${S}/unpack \
69 || die "uncompressing tarball"
70 elif [ -e "${tarball}_${PV}.tar.bz2" ]
71 then
72 tar xjf ${tarball}_${PV}.tar.bz2 -C ${S}/unpack \
73 || die "uncompressing tarball"
74 else [ -e "${tarball}.tar.bz2" ]
75 tar xjf ${tarball}.tar.bz2 -C ${S}/unpack \
76 || die "uncompressing tarball"
77 fi
78 done
79 }
80
81 games-ut2k4mod_src_install() {
82 dodir ${dir}
83 cp -r ${S}/unpack/* ${Ddir}
84
85 if [ -e ${S}/README.${MOD_BINS} ]
86 then
87 dodoc README.${MOD_BINS} || die "dodoc failed"
88 else
89 for tbz2 in ${MOD_TBZ2}
90 do
91 if [ -e ${S}/README.${tbz2} ]
92 then
93 dodoc README.${tbz2} || die "dodoc failed"
94 fi
95 done
96 fi
97 if [ -n "${MOD_BINS}" ]
98 then
99 exeinto ${dir}
100 doexe bin/${MOD_BINS} || die "doexe failed"
101 games_make_wrapper ${MOD_BINS} ./${MOD_BINS} ${dir}
102 make_desktop_entry ${MOD_BINS} "UT2004 - ${MOD_NAME}" ${MOD_ICON}
103 fi
104
105 [ -e ${MOD_ICON} ] && doicon ${MOD_ICON}
106
107 prepgamesdirs
108 }
109
110 games-ut2k4mod_pkg_postinst() {
111 if [ -n "${MOD_BINS}" ]
112 then
113 einfo "To play this mod run:"
114 einfo " ${MOD_BINS}"
115 fi
116
117 games_pkg_postinst
118 }

  ViewVC Help
Powered by ViewVC 1.1.20