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

Contents of /eclass/games-ut2k4mod.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (hide annotations) (download)
Wed Jul 6 20:23:20 2005 UTC (13 years, 3 months ago) by agriffis
Branch: MAIN
Changes since 1.6: +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.7 # $Header: /var/cvsroot/gentoo-x86/eclass/games-ut2k4mod.eclass,v 1.6 2005/07/06 20:20:03 agriffis Exp $
4 wolf31o2 1.1
5     inherit games
6    
7    
8 wolf31o2 1.5 EXPORT_FUNCTIONS pkg_nofetch src_unpack src_install pkg_postinst
9 wolf31o2 1.1
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 wolf31o2 1.2 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 wolf31o2 1.3 USE_ECE_DVD=
33 wolf31o2 1.2 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 wolf31o2 1.5 games-ut2k4mod_pkg_nofetch() {
48 wolf31o2 1.1 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 wolf31o2 1.4 [ -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 wolf31o2 1.1 mkdir ${S}/unpack
62 wolf31o2 1.4 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 wolf31o2 1.1 }
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 wolf31o2 1.4 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 wolf31o2 1.1 fi
102    
103 wolf31o2 1.4 [ -e ${MOD_ICON} ] && doicon ${MOD_ICON}
104 wolf31o2 1.1
105     prepgamesdirs
106     }
107    
108     games-ut2k4mod_pkg_postinst() {
109 wolf31o2 1.4 if [ -n "${MOD_BINS}" ]
110     then
111     einfo "To play this mod run:"
112     einfo " ${MOD_BINS}"
113     fi
114 wolf31o2 1.1
115     games_pkg_postinst
116     }

  ViewVC Help
Powered by ViewVC 1.1.20