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

Contents of /eclass/games-ut2k4mod.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (hide annotations) (download)
Thu Jul 12 23:57:42 2007 UTC (11 years, 2 months ago) by wolf31o2
Branch: MAIN
Changes since 1.10: +60 -53 lines
Added two new mirrors and also made sure to add the obselete directory, in case a newer version comes out before we can update the eclass.

1 wolf31o2 1.11 # Copyright 1999-2007 Gentoo Foundation
2 wolf31o2 1.1 # Distributed under the terms of the GNU General Public License v2
3 wolf31o2 1.11 # $Header: $
4 wolf31o2 1.1
5     inherit games
6    
7 wolf31o2 1.5 EXPORT_FUNCTIONS pkg_nofetch src_unpack src_install pkg_postinst
8 wolf31o2 1.1
9     DESCRIPTION="UT2004 - ${MOD_DESC}"
10    
11     SLOT="0"
12     KEYWORDS="-* x86 amd64"
13     IUSE=""
14    
15     DEPEND="app-arch/tar
16     app-arch/bzip2"
17 wolf31o2 1.9 RDEPEND="sys-libs/glibc"
18     PDEPEND=">=games-fps/ut2004-3339"
19 wolf31o2 1.1
20     S=${WORKDIR}
21     dir=${GAMES_PREFIX_OPT}/ut2004
22     Ddir=${D}/${dir}
23    
24 wolf31o2 1.2 check_dvd() {
25     # The following is a nasty mess to determine if we are installing from
26     # a DVD or from multiple CDs. Anyone feel free to submit patches to this
27     # to bugs.gentoo.org as I know it is a very ugly hack.
28 wolf31o2 1.11
29 wolf31o2 1.2 USE_DVD=
30 wolf31o2 1.3 USE_ECE_DVD=
31 wolf31o2 1.11 USE_MIDWAY_DVD=
32     USE_GERMAN_MIDWAY_DVD=
33    
34     local r
35     for r in "${CD_ROOT}" "${CD_ROOT_1}" \
36     `mount | egrep -e '(iso|cdrom)' | awk '{print $3}'` ; do
37     if [[ -n "${r}" ]] ; then
38     einfo "Searching ${r}"
39     if [[ -e "${r}/AutoRunData/Unreal.ico" ]] \
40     && [[ -e "${r}/Disk5/data6.cab" ]] ; then
41     USE_MIDWAY_DVD=1
42     USE_DVD=1
43     elif [[ -e "${r}/autorund/unreal.ico" ]] \
44     && [[ -e "${r}/disk7/data8.cab" ]] ; then
45     USE_MIDWAY_DVD=1
46     USE_GERMAN_MIDWAY_DVD=1
47     USE_DVD=1
48     else
49     [[ -d "${r}/CD1" ]] && USE_DVD=1
50     [[ -d "${r}/CD7" ]] && USE_ECE_DVD=1
51     fi
52     fi
53     done
54 wolf31o2 1.2 }
55    
56 wolf31o2 1.5 games-ut2k4mod_pkg_nofetch() {
57 wolf31o2 1.11 einfo "Please download ${SRC_URI} and put it into ${DISTDIR}"
58 wolf31o2 1.1 einfo "http://liflg.org/?catid=6&gameid=17"
59     }
60    
61     games-ut2k4mod_src_unpack() {
62 wolf31o2 1.11 [[ -z "${MOD_TBZ2}" ]] && die "What are we supposed to unpack?"
63     [[ -z "${MOD_NAME}" ]] && die "What is the name of this ut2k4mod?"
64 wolf31o2 1.4
65 wolf31o2 1.11 local src_uri uri_suffix
66     for src_uri in ${A} ; do
67     uri_suffix="${src_uri##*.}"
68     case ${uri_suffix##*.} in
69 wolf31o2 1.9 run|bin)
70     # We have a Makeself archive, use unpack_makeself
71 wolf31o2 1.11 unpack_makeself "${src_uri}"
72 wolf31o2 1.9 # Since this is a Makeself archive, it has a lot of useless
73     # files (for us), so we delete them.
74     rm -rf setup.data setup.sh uninstall
75     ;;
76     bz2|gz|Z|z|ZIP|zip)
77     # We have a normal tarball/zip file, use unpack
78 wolf31o2 1.11 unpack "${src_uri}"
79 wolf31o2 1.9 ;;
80     esac
81 wolf31o2 1.4 done
82    
83 wolf31o2 1.11 mkdir "${S}"/unpack
84     local tarball
85     for tarball in ${MOD_TBZ2} ; do
86     if [[ -e "${tarball}_${PV}-english.tar.bz2" ]] ; then
87     tar xjf "${tarball}_${PV}-english.tar.bz2" -C "${S}"/unpack \
88 wolf31o2 1.4 || die "uncompressing tarball"
89 wolf31o2 1.11 elif [[ -e "${tarball}_${PV}.tar.bz2" ]] ; then
90     tar xjf "${tarball}_${PV}.tar.bz2" -C "${S}"/unpack \
91 wolf31o2 1.4 || die "uncompressing tarball"
92 wolf31o2 1.11 else
93     tar xjf "${tarball}.tar.bz2" -C "${S}"/unpack \
94     || die "uncompressing tarball"
95 wolf31o2 1.4 fi
96     done
97 wolf31o2 1.1 }
98    
99     games-ut2k4mod_src_install() {
100 wolf31o2 1.11 insinto "${dir}"
101     doins -r "${S}"/unpack/* || die "doins -r unpack failed"
102 wolf31o2 1.1
103 wolf31o2 1.11 for readme in README* ; do
104     dodoc "${readme}" || die "dodoc failed"
105 wolf31o2 1.8 done
106 wolf31o2 1.11 if [[ -n "${MOD_BINS}" ]] ; then
107     exeinto "${dir}"
108     doexe bin/"${MOD_BINS}" || die "doexe ${MOD_BINS} failed"
109     games_make_wrapper "${MOD_BINS}" ./"${MOD_BINS}" "${dir}"
110     make_desktop_entry "${MOD_BINS}" "UT2004 - ${MOD_NAME}" "${MOD_ICON}"
111 wolf31o2 1.1 fi
112    
113 wolf31o2 1.11 if [[ -n "${MOD_ICON}" ]] && [[ -e "${MOD_ICON}" ]] ; then
114     doicon "${MOD_ICON}" || die "doicon ${MOD_ICON} failed"
115     fi
116 wolf31o2 1.1
117     prepgamesdirs
118     }
119    
120     games-ut2k4mod_pkg_postinst() {
121 wolf31o2 1.11 if [[ -n "${MOD_BINS}" ]] ; then
122     elog "To play this mod, run:"
123     elog " ${MOD_BINS}"
124 wolf31o2 1.4 fi
125 wolf31o2 1.1
126     games_pkg_postinst
127     }

  ViewVC Help
Powered by ViewVC 1.1.20