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

Contents of /eclass/games-ut2k4mod.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (show annotations) (download) (vendor branch)
Wed Nov 30 09:59:21 2005 UTC (12 years, 9 months ago) by chriswhite
Changes since 1.1: +66 -32 lines
*** empty log message ***

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

  ViewVC Help
Powered by ViewVC 1.1.20