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

Contents of /eclass/games-ut2k4mod.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (hide annotations) (download)
Wed Jul 6 20:20:03 2005 UTC (13 years, 3 months ago) by agriffis
Branch: MAIN
Changes since 1.5: +1 -2 lines
Remove ECLASS= and INHERITED= which haven't been necessary for a long time now

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

  ViewVC Help
Powered by ViewVC 1.1.20