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

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

  ViewVC Help
Powered by ViewVC 1.1.20