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

Contents of /eclass/games-ut2k4mod.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Thu Sep 28 21:32:12 2006 UTC (11 years, 11 months ago) by wolf31o2
Branch: MAIN
Changes since 1.8: +18 -6 lines
Moved RESTRICT into the individual ebuilds.  Added code so that we don't always assume that everything in A is a makeself archive.

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.8 2006/03/31 02:39:32 wolf31o2 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
16 DEPEND="app-arch/tar
17 app-arch/bzip2"
18
19 RDEPEND="sys-libs/glibc"
20 PDEPEND=">=games-fps/ut2004-3339"
21
22 S=${WORKDIR}
23 dir=${GAMES_PREFIX_OPT}/ut2004
24 Ddir=${D}/${dir}
25
26 check_dvd() {
27 # The following is a nasty mess to determine if we are installing from
28 # a DVD or from multiple CDs. Anyone feel free to submit patches to this
29 # to bugs.gentoo.org as I know it is a very ugly hack.
30 USE_DVD=
31 USE_ECE_DVD=
32 if [ -n "${CD_ROOT}" ]
33 then
34 [ -d "${CD_ROOT}/CD1" ] && USE_DVD=1
35 [ -d "${CD_ROOT}/CD7" ] && USE_ECE_DVD=1
36 else
37 local mline=""
38 for mline in `mount | egrep -e '(iso|cdrom)' | awk '{print $3}'`
39 do
40 [ -d "${mline}/CD1" ] && USE_DVD=1
41 [ -d "${mline}/CD7" ] && USE_ECE_DVD=1
42 done
43 fi
44 }
45
46 games-ut2k4mod_pkg_nofetch() {
47 einfo "Please download ${A} and put it into ${DISTDIR}"
48 einfo "http://liflg.org/?catid=6&gameid=17"
49 }
50
51 games-ut2k4mod_src_unpack() {
52 [ -z "${MOD_TBZ2}" ] && die "what are we supposed to unpack ?"
53 [ -z "${MOD_NAME}" ] && die "what is the name of this ut2k4mod ?"
54
55 for src_uri in ${A}
56 do
57 URI_SUFFIX="${src_uri##*.}"
58 case ${URI_SUFFIX##*.} in
59 run|bin)
60 # We have a Makeself archive, use unpack_makeself
61 unpack_makeself ${src_uri}
62 # Since this is a Makeself archive, it has a lot of useless
63 # files (for us), so we delete them.
64 rm -rf setup.data setup.sh uninstall
65 ;;
66 bz2|gz|Z|z|ZIP|zip)
67 # We have a normal tarball/zip file, use unpack
68 unpack ${src_uri}
69 ;;
70 esac
71 done
72
73 mkdir ${S}/unpack
74 for tarball in ${MOD_TBZ2}
75 do
76 if [ -e "${tarball}_${PV}-english.tar.bz2" ]
77 then
78 tar xjf ${tarball}_${PV}-english.tar.bz2 -C ${S}/unpack \
79 || die "uncompressing tarball"
80 elif [ -e "${tarball}_${PV}.tar.bz2" ]
81 then
82 tar xjf ${tarball}_${PV}.tar.bz2 -C ${S}/unpack \
83 || die "uncompressing tarball"
84 else [ -e "${tarball}.tar.bz2" ]
85 tar xjf ${tarball}.tar.bz2 -C ${S}/unpack \
86 || die "uncompressing tarball"
87 fi
88 done
89 }
90
91 games-ut2k4mod_src_install() {
92 dodir ${dir}
93 cp -r ${S}/unpack/* ${Ddir}
94
95 for readme in README*
96 do
97 dodoc ${readme} || die "dodoc failed"
98 done
99 if [ -n "${MOD_BINS}" ]
100 then
101 exeinto ${dir}
102 doexe bin/${MOD_BINS} || die "doexe failed"
103 games_make_wrapper ${MOD_BINS} ./${MOD_BINS} ${dir}
104 make_desktop_entry ${MOD_BINS} "UT2004 - ${MOD_NAME}" ${MOD_ICON}
105 fi
106
107 [ -e ${MOD_ICON} ] && doicon ${MOD_ICON}
108
109 prepgamesdirs
110 }
111
112 games-ut2k4mod_pkg_postinst() {
113 if [ -n "${MOD_BINS}" ]
114 then
115 einfo "To play this mod run:"
116 einfo " ${MOD_BINS}"
117 fi
118
119 games_pkg_postinst
120 }

  ViewVC Help
Powered by ViewVC 1.1.20