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

Diff of /eclass/games-ut2k4mod.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.11 Revision 1.12
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2009 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/games-ut2k4mod.eclass,v 1.11 2007/07/12 23:57:42 wolf31o2 Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/Attic/games-ut2k4mod.eclass,v 1.12 2009/11/30 04:19:36 abcd Exp $
4 4
5inherit games 5# @DEAD
6 6# To be removed on 2011/11/30.
7EXPORT_FUNCTIONS pkg_nofetch src_unpack src_install pkg_postinst 7ewarn "Please fix your package (${CATEGORY}/${PF}) to not use ${ECLASS}.eclass"
8
9DESCRIPTION="UT2004 - ${MOD_DESC}"
10
11SLOT="0"
12KEYWORDS="-* x86 amd64"
13IUSE=""
14
15DEPEND="app-arch/tar
16 app-arch/bzip2"
17RDEPEND="sys-libs/glibc"
18PDEPEND=">=games-fps/ut2004-3339"
19
20S=${WORKDIR}
21dir=${GAMES_PREFIX_OPT}/ut2004
22Ddir=${D}/${dir}
23
24check_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
29 USE_DVD=
30 USE_ECE_DVD=
31 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}
55
56games-ut2k4mod_pkg_nofetch() {
57 einfo "Please download ${SRC_URI} and put it into ${DISTDIR}"
58 einfo "http://liflg.org/?catid=6&gameid=17"
59}
60
61games-ut2k4mod_src_unpack() {
62 [[ -z "${MOD_TBZ2}" ]] && die "What are we supposed to unpack?"
63 [[ -z "${MOD_NAME}" ]] && die "What is the name of this ut2k4mod?"
64
65 local src_uri uri_suffix
66 for src_uri in ${A} ; do
67 uri_suffix="${src_uri##*.}"
68 case ${uri_suffix##*.} in
69 run|bin)
70 # We have a Makeself archive, use unpack_makeself
71 unpack_makeself "${src_uri}"
72 # 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 unpack "${src_uri}"
79 ;;
80 esac
81 done
82
83 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 || die "uncompressing tarball"
89 elif [[ -e "${tarball}_${PV}.tar.bz2" ]] ; then
90 tar xjf "${tarball}_${PV}.tar.bz2" -C "${S}"/unpack \
91 || die "uncompressing tarball"
92 else
93 tar xjf "${tarball}.tar.bz2" -C "${S}"/unpack \
94 || die "uncompressing tarball"
95 fi
96 done
97}
98
99games-ut2k4mod_src_install() {
100 insinto "${dir}"
101 doins -r "${S}"/unpack/* || die "doins -r unpack failed"
102
103 for readme in README* ; do
104 dodoc "${readme}" || die "dodoc failed"
105 done
106 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 fi
112
113 if [[ -n "${MOD_ICON}" ]] && [[ -e "${MOD_ICON}" ]] ; then
114 doicon "${MOD_ICON}" || die "doicon ${MOD_ICON} failed"
115 fi
116
117 prepgamesdirs
118}
119
120games-ut2k4mod_pkg_postinst() {
121 if [[ -n "${MOD_BINS}" ]] ; then
122 elog "To play this mod, run:"
123 elog " ${MOD_BINS}"
124 fi
125
126 games_pkg_postinst
127}

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.20