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

Diff of /eclass/games-ut2k4mod.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1.1.1 Revision 1.13
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2009 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/games-ut2k4mod.eclass,v 1.1.1.1 2005/11/30 09:59:21 chriswhite Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/games-ut2k4mod.eclass,v 1.13 2011/01/31 13:58:12 scarabeus dead $
4 4
5inherit games 5# @DEAD
6 6# To be removed on 2011/11/30.
7 7ewarn "Please fix your package (${CATEGORY}/${PF}) to not use ${ECLASS}.eclass"
8EXPORT_FUNCTIONS pkg_nofetch src_unpack src_install pkg_postinst
9
10DESCRIPTION="UT2004 - ${MOD_DESC}"
11
12SLOT="0"
13KEYWORDS="-* x86 amd64"
14IUSE=""
15RESTRICT="nomirror fetch"
16
17DEPEND="app-arch/tar
18 app-arch/bzip2"
19
20RDEPEND="virtual/libc
21 >=games-fps/ut2004-3339"
22
23S=${WORKDIR}
24dir=${GAMES_PREFIX_OPT}/ut2004
25Ddir=${D}/${dir}
26
27check_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
47games-ut2k4mod_pkg_nofetch() {
48 einfo "Please download ${A} and put it into ${DISTDIR}"
49 einfo "http://liflg.org/?catid=6&gameid=17"
50}
51
52games-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
79games-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
108games-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}

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.20