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

Contents of /eclass/games-ut2k4mod.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (hide annotations) (download)
Wed Mar 7 15:23:39 2007 UTC (10 years, 10 months ago) by wolf31o2
Branch: MAIN
Changes since 1.9: +13 -13 lines
Change from using a single [ to using [[.

1 wolf31o2 1.1 # Copyright 1999-2004 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 wolf31o2 1.10 # $Header: /var/cvsroot/gentoo-x86/eclass/games-ut2k4mod.eclass,v 1.9 2006/09/28 21:32:12 wolf31o2 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    
16     DEPEND="app-arch/tar
17     app-arch/bzip2"
18    
19 wolf31o2 1.9 RDEPEND="sys-libs/glibc"
20     PDEPEND=">=games-fps/ut2004-3339"
21 wolf31o2 1.1
22     S=${WORKDIR}
23     dir=${GAMES_PREFIX_OPT}/ut2004
24     Ddir=${D}/${dir}
25    
26 wolf31o2 1.2 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 wolf31o2 1.3 USE_ECE_DVD=
32 wolf31o2 1.10 if [[ -n "${CD_ROOT}" ]]
33 wolf31o2 1.2 then
34 wolf31o2 1.10 [[ -d "${CD_ROOT}/CD1" ]] && USE_DVD=1
35     [[ -d "${CD_ROOT}/CD7" ]] && USE_ECE_DVD=1
36 wolf31o2 1.2 else
37     local mline=""
38     for mline in `mount | egrep -e '(iso|cdrom)' | awk '{print $3}'`
39     do
40 wolf31o2 1.10 [[ -d "${mline}/CD1" ]] && USE_DVD=1
41     [[ -d "${mline}/CD7" ]] && USE_ECE_DVD=1
42 wolf31o2 1.2 done
43     fi
44     }
45    
46 wolf31o2 1.5 games-ut2k4mod_pkg_nofetch() {
47 wolf31o2 1.1 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 wolf31o2 1.10 [[ -z "${MOD_TBZ2}" ]] && die "what are we supposed to unpack ?"
53     [[ -z "${MOD_NAME}" ]] && die "what is the name of this ut2k4mod ?"
54 wolf31o2 1.4
55 wolf31o2 1.9 for src_uri in ${A}
56 wolf31o2 1.4 do
57 wolf31o2 1.9 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 wolf31o2 1.4 done
72    
73 wolf31o2 1.1 mkdir ${S}/unpack
74 wolf31o2 1.4 for tarball in ${MOD_TBZ2}
75     do
76 wolf31o2 1.10 if [[ -e "${tarball}_${PV}-english.tar.bz2" ]]
77 wolf31o2 1.4 then
78     tar xjf ${tarball}_${PV}-english.tar.bz2 -C ${S}/unpack \
79     || die "uncompressing tarball"
80 wolf31o2 1.10 elif [[ -e "${tarball}_${PV}.tar.bz2" ]]
81 wolf31o2 1.4 then
82     tar xjf ${tarball}_${PV}.tar.bz2 -C ${S}/unpack \
83     || die "uncompressing tarball"
84 wolf31o2 1.10 else [[ -e "${tarball}.tar.bz2" ]]
85 wolf31o2 1.4 tar xjf ${tarball}.tar.bz2 -C ${S}/unpack \
86     || die "uncompressing tarball"
87     fi
88     done
89 wolf31o2 1.1 }
90    
91     games-ut2k4mod_src_install() {
92     dodir ${dir}
93     cp -r ${S}/unpack/* ${Ddir}
94    
95 wolf31o2 1.8 for readme in README*
96     do
97     dodoc ${readme} || die "dodoc failed"
98     done
99 wolf31o2 1.10 if [[ -n "${MOD_BINS}" ]]
100 wolf31o2 1.4 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 wolf31o2 1.1 fi
106    
107 wolf31o2 1.4 [ -e ${MOD_ICON} ] && doicon ${MOD_ICON}
108 wolf31o2 1.1
109     prepgamesdirs
110     }
111    
112     games-ut2k4mod_pkg_postinst() {
113 wolf31o2 1.10 if [[ -n "${MOD_BINS}" ]]
114 wolf31o2 1.4 then
115     einfo "To play this mod run:"
116     einfo " ${MOD_BINS}"
117     fi
118 wolf31o2 1.1
119     games_pkg_postinst
120     }

  ViewVC Help
Powered by ViewVC 1.1.20