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

Contents of /eclass/games-ut2k4mod.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Wed Feb 23 12:31:38 2005 UTC (13 years, 4 months ago) by wolf31o2
Branch: MAIN
Changes since 1.1: +21 -1 lines
Updated eclass.

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.1 2004/11/25 00:08:12 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 dodir ${dir}
56 unpack_makeself
57 mkdir ${S}/unpack
58 if [ -e ${MOD_TBZ2}_${PV}-english.tar.bz2 ]
59 then
60 tar xjf ${MOD_TBZ2}_${PV}-english.tar.bz2 -C ${S}/unpack \
61 || die "uncompressing tarball"
62 elif [ -e ${MOD_TBZ2}_${PV}.tar.bz2 ]
63 then
64 tar xjf ${MOD_TBZ2}_${PV}.tar.bz2 -C ${S}/unpack \
65 || die "uncompressing tarball"
66 else
67 tar xjf ${MOD_TBZ2}.tar.bz2 -C ${S}/unpack \
68 || die "uncompressing tarball"
69 fi
70 }
71
72 games-ut2k4mod_src_install() {
73 [ -z "${MOD_NAME}" ] && die "what is the name of this ut2k4mod ?"
74
75 dodir ${dir}
76 cp -r ${S}/unpack/* ${Ddir}
77
78 if [ -e ${S}/README.${MOD_BINS} ]
79 then
80 dodoc README.${MOD_BINS} || die "dodoc failed"
81 else
82 dodoc README.${MOD_TBZ2} || die "dodoc failed"
83 fi
84 exeinto ${dir}
85 doexe bin/${MOD_BINS} || die "doexe failed"
86
87 games_make_wrapper ${MOD_BINS} ./${MOD_BINS} ${dir}
88
89 insinto /usr/share/pixmaps
90 [ -e ${MOD_ICON} ] && doins ${MOD_ICON}
91
92 prepgamesdirs
93 make_desktop_entry ${MOD_BINS} "UT2004 - ${MOD_NAME}" ${MOD_ICON}
94 }
95
96 games-ut2k4mod_pkg_postinst() {
97
98 einfo "To play this mod run:"
99 einfo " ${MOD_BINS}"
100
101 games_pkg_postinst
102 }

  ViewVC Help
Powered by ViewVC 1.1.20