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

Contents of /eclass/games-ut2k4mod.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Fri Mar 31 02:39:32 2006 UTC (12 years, 5 months ago) by wolf31o2
Branch: MAIN
Changes since 1.7: +5 -13 lines
Make sure we install all of the README files.

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 for readme in README*
84 do
85 dodoc ${readme} || die "dodoc failed"
86 done
87 if [ -n "${MOD_BINS}" ]
88 then
89 exeinto ${dir}
90 doexe bin/${MOD_BINS} || die "doexe failed"
91 games_make_wrapper ${MOD_BINS} ./${MOD_BINS} ${dir}
92 make_desktop_entry ${MOD_BINS} "UT2004 - ${MOD_NAME}" ${MOD_ICON}
93 fi
94
95 [ -e ${MOD_ICON} ] && doicon ${MOD_ICON}
96
97 prepgamesdirs
98 }
99
100 games-ut2k4mod_pkg_postinst() {
101 if [ -n "${MOD_BINS}" ]
102 then
103 einfo "To play this mod run:"
104 einfo " ${MOD_BINS}"
105 fi
106
107 games_pkg_postinst
108 }

  ViewVC Help
Powered by ViewVC 1.1.20